spxl / spxlAudioToMidi

Tool to produce MIDI control messages from a live audio feed using FFT
3 stars 0 forks source link

spxlAudioToMidi

Note: please see the README.md file for individual versions since details vary. This is an overview.

spxlAudioToMidi is a tool made with Processing. Its purpose is to generate MIDI Control Change ("CC") messages from an incoming audio source based on frequency analysis (Fast Fourier Transform, FFT).

The secret sauce in this program is that the measurement of each frequency band is individually normalised; another way of saying that is that the "gain" is maximised for every channel. The result is output peaks across the entire spectrum.

The main space of the display is a column of audio "Meters" on the left, and a column of meter "Monitors" on the right, with lines showing connections between Meters and Monitors in between.

The frequency ranges of the Meters increase going down the display (lowest frequency range at the top, highest range at the bottom). The 10 Monitors each produce MIDI CC messages starting with CC01 for the top Monitor through to CC10 for the bottom Monitor. The values output for a CC message for a Monitor is the output of the Meter it is connected to, scaled to the range specified for the Monitor. The Monitor output range is between 0 (at the least) and 127 (at the most), and can be inverted. The output ranges can be adjusted using the mouse, by some keyboard commands (such as reset range, invert range, randomise range), and also by MIDI input.

Dependencies

spxlAudioToMidi is coded for Processing 2.0 (since v06; there were some breaking changes from the Processing 1.5 versions).

spxlAudioToMidi depends upon two Processing libraries:

You will need to install the proMIDI library in the Sketchbook/libraries folder, or otherwise as described by documentation for Processing.

Controls

This program has mouse, keyboard, and MIDI controls. The mouse controls are a little esoteric, there is no onscreen help for keyboard controls, and the MIDI controls are, for the moment, hardwired...

Mouse Controls

Keyboard Controls

Keyboard controls can be found in the spxlAudioToMidiXX.pde file, if not in the top comments, then in the keyPressed() method.

The most 'exciting' controls are R (upper-case R) to randomise the output ranges of all the monitors, S to reset, and Q to randomise which meter all the monitors are connected to, A to reset.

[1/2/3/../9/0] set output MIDI channel
[!/@/#/../(/)] set input MIDI channel
[p/space] toggle pause
[m] toggle mute on/off
[M] mute shot (short burst followed by mute)
[l] reset meter levels

[E] toggle easing on/off
[e] reset easing value (and turn easing on)
[up] increase snappiness of easing
[down] decrease snappiness of easing

[q/Q] randomise link for monitor/s
[a/A] reset link to default for monitor/s

[f/F] flip min, max for monitor/s
[v/V] invert range for monitor/s
[r/R] random range for monitor/s
[s/S] reset range for monitor/s

[F1] toggle meters display
[F2] toggle monitors display
[h] toggle hex/decimal value display

[F3] Analyse microphone input
[F4] Analyse stereo mix

[[] Decrease expected CC numbers (by 20) and note pitches (by 2 octaves) for MIDI input
[]] Increase expected CC numbers (by 20) and note pitches (by 2 octaves) for MIDI input

Links


Change notes