Skip to main content

# numm

For programmers familiar with python or matlab who are interested in toying with the sounds and images around them; for artists, designers, and composers seeking a deeper understanding of the numerical systems that underlie modern media production.

numm is a minimalist media library that translates popular sound, image, and video formats to and from numpy arrays. By coercing inputs into common modes (eg. sample rate, bit depth), combining and mutating these numpy arrays is greatly simplified.

The general strategy for these functions is to make any assumptions necessary such that a single array of numbers provides sufficient information with which to reconstruct a media file, without any additional metadata. For example, width and height are contained in the dimensions of an array, so they may be different image to image, but framerate, samplerate, &c is not inherent to the data, so it should be made uniform unless explicitly specified.

In the transition from an image to an array, the primary considerations are resolution (wxh) and mode (RGB, RGBA, 8bit, 16bit, &c). We choose not to provide any special API for resampling an Image–this can be done with numpy if desired–and always return 8bit RGB buffers.

image2np(path) np2image(np, path)

In the case of audio, we choose to force all input to 44100Hz stereo.

sound2np(path) np2sound(np, path)

Video is an array of wxhx3 arrays 30frames per second. Square pixels are assumed.

video2np(path) np2video(np, path)

Note that in particular in the case of video, these numpy buffers will require a considerable amount of memory; preprocess accordingly (eg in ffmpeg). We should also raise a NotEnoughMemory exception when RAM will not hold our buffer.

The live interface is provided by numpy.run.run(), a function with just a few input-output controls, communicated through function passing.

## Requirements

  • PyGst

  • PIL

Recommended:

  • OpenCV

## Licence

Copyright (C) 2011, Dafydd Harries <daf@numm.org> Copyright (C) 2011, Robert Ochshorn <rmo@numm.org>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Release files for numm 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numm 0.3
File Size Uploaded
numm-0.3.tar.gz 34.3 kB Details

Release files / numm-0.3.tar.gz

Download URL numm-0.3.tar.gz
Size 34.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d82bb050452eafe2755e3902f64cce2580c3f6d633cd01930c95262920d70826
BLAKE2b-256 checksum
How to use checksums
25d57ede5f2092341ab3d311254bf65bab3add2be8a5a1b8485ab5e6fa066a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page