API reference¶
Every name below is re-exported from the top level: music.note(...) works
regardless of which submodule defines it.
Synthesis¶
Notes¶
Each returns a numpy array of PCM samples. note is the plain wavetable
lookup; the rest layer vibrato, pitch transitions, frequency modulation and
movement onto it.
Synthesize a basic musical note. |
|
Synthesize a basic musical note with a phase. |
|
Synthesize a musical note with a vibrato. |
|
A note with a vibrato that also has a secondary oscillatory pattern. |
|
A note with a pitch transition: a glissando. |
|
A note with a pitch transition (a glissando) and a vibrato. |
|
A note with a glissando and a vibrato that also has a secondary oscillatory pattern. |
|
A note with an arbitrary sequence of pitch transition and a meta-vibrato. |
|
A sound with arbitrary meta-vibratos, transitions of frequency and localization. |
|
Synthesize a musical note with FM synthesis. |
|
A simple note with a transition of localization and resulting Doppler effect. |
|
Makes a trill. |
Envelopes and noise¶
Filters¶
Amplitude¶
Synthesize an ADSR envelope. |
|
A shorthand to make an ADSR envelope for a stereo sound. |
|
Creates a note with a vibrato and an ADSR envelope. |
|
A fade in or out. |
|
Cross fade in duration milisseconds. |
|
An envelope for a linear or exponential transition of amplitude. |
|
An envelope with linear or exponential transitions of amplitude. |
Spectral and spatial¶
Apply a FIR filter to a sonic_array. |
|
Apply an IIR filter to a signal. |
|
Apply an artificial reverberation or return the impulse response. |
|
Make a mono sound stereo and localize it by a very naive method. |
|
Make a mono sound stereo and localize it by experimental methods. |
|
Localize a sound along a straight path between two angles. |
|
Makes a sequence of squeezes of the fragment in x. |
Input and output¶
Reads a WAV file and return an array of its values. |
|
Writes a mono WAV file for a numpy array. |
|
Write a stereo WAV files for a numpy array. |
|
Play a sonic vector using the |
|
Normalize a mono sonic vector. |
|
Normalize a stereo sonic vector. |
Sequencing¶
Schedules notes and renders them as audio. |
Musical structures¶
Permutations, algebraic groups and change-ringing peals.
Get permutations of n elements in meaningful sequences. |
|
Transposes (shifts) the elements of a permutation by a given step. |
|
Computes the cyclic distance between the two elements of a permutation. |
|
A collection of named peals that can be acted on a domain. |
|
Uses permutations to make peals and represents peals as permutations. |
|
Presents plain changes as swaps and acts in domains to make peals. |
|
Prints a peal with colored numbers. |
Utilities¶
Conversions¶
Converts a frequency in Hertz to a MIDI note number. |
|
Converts a MIDI note number to the corresponding frequency in Hertz. |
|
Converts a MIDI interval to the corresponding frequency interval in |
|
Generates a list of frequencies based on a list of semitones and a starting frequency. |
|
Converts a difference in decibels to a difference in amplitude. |
|
Converts a difference in amplitude to a difference in decibels. |
|
Returns durations from rhythmic patterns. |
Combining sonic vectors¶
Creates a horizontal stack of arrays while preserving bidimensional |
|
Mixes two sonic vectors. |
|
Mix sonic vectors of arbitrary lengths. |
|
Mixes two stereo sonic vectors. |
|
Mix two sonic vector by placing the beginning of the second one a specified number of seconds after the first one. |
|
Mix sonic vectors with offsets. |
|
Converts a sound vector to stereo format. |
|
Resolve stereo arguments for a function. |
|
Applies pan transitions to a sonic vector. |
|
Wavetables¶
Provides primary tables for waveform lookup. |
The module-level constants WAVEFORM_SINE, WAVEFORM_TRIANGULAR,
WAVEFORM_SQUARE and WAVEFORM_SAWTOOTH in music.utils are the
lookup tables used by default throughout the package.
Singing¶
Text-to-speech built on the external eCantorix engine. Run setup_engine() once to
clone it; it also needs git, make, perl and espeak on the
system.
Clone the eCantorix repository into the user's cache directory. |
|
Return the path to the local eCantorix engine. |
|
Render a short sung phrase, to check the engine works. |
Legacy¶
Synthesizer classes kept for backwards compatibility, and as material for making more music.
A configurable sequence walker that renders notes. |
|
Simple synthesizer for sound synthesis with vibrato, tremolo, and ADSR. |
|
A synthesizer that iterates through arbitrary lists of variables. |