---
name: "numm.getting-started"
section: "7"
platform: "linux"
package: "python-numm"
version: "0.5-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/numm.getting-started"
---

# numm.getting-started(7)

numm installation and usage

## NAME

getting started - numm installation and usage

## SYNOPSIS

numm-run *FILE*\
 **import numm**

## DESCRIPTION

numm is a python library — the bastard child of **Processing.org** and **MATLAB**, if you will — that fuses **python**, **numpy**, and **gstreamer** together to create a numerical-computing environment for multimedia generation, analysis, and interaction.

### Installation

A **Debian** package is provided for ease of installation on Debian and derivative operating systems, such as **Ubuntu**; we recommend you abandon alternative systems and install Debian, but in the interim direct your attention to  virtualization software such as **VirtualBox**.

Numm is available as a package in Debian and Ubuntu:

```
% sudo apt-get install python-numm
```

### Usage

At its simplest, **numm** provides three pairs of invertable functions that connect common media formats with **numpy**:

Images represented as (*height*, *width*, *color*) **numpy.uint8** arrays.

- •

  image2np(*path*) → np

- •

  np2image(*np*, *path*)

Sounds as (*frames*, *channels*) **numpy.int16**s

- •

  sound2np(*path*) → np

- •

  np2sound(*np*, *path*)

Videos as (*frames*, *height*, *width*, *color*) **numpy.uint8**s

- •

  video2np(*path*) → np

- •

  np2video(*np*, *path*)

Additionally, iterators are provided for incremental loading of media files:

- •

  sound\_chunks(*path*) → np iterator

- •

  video\_frames(*path*) → np iterator (by frame)

For rapid-prototyping of interactive numpy-based audio-visual experiments, the numm package has a real-time mode. The **numm** package installs a program named **numm-run**, which launches (and reloads on modification) python scripts that may implement any subset of the following functions, which are asynchronously called as needed:

- •

  video\_in(*a*)                      # webcam

- •

  video\_out(*a*)                     # mutate *a* in-place to set video

- •

  audio\_in(*a*)                      # mic

- •

  audio\_out(*a*)                     # mutate *a* for audio output

- •

  mouse\_in(*type*, *px*, *py*, button)

- •

  keyboard\_in(*type*, *key*)

## SEE ALSO

[**numm-run**(1)](/numm-run/1.md), [**numm.one-bit-instrument**(7)](/numm.one-bit-instrument/7.md), [**numm.spectral-analysis**(7)](/numm.spectral-analysis/7.md)
