Abstraction Reference
Hmmmm…
Hmmmm…
Returns the number of keys in a dict
When using a dict to mimic an array, use this to retrieve the length of the array.
number of keys in dict
symbol
dict name
flowchart TB; TapIn((Tap\nIn)) PattrIn((Pattr\nIn)) AudioIn((Audio\nIn)) MidiIn((MIDI In)) DataIn((File\nData\nIn)) PresetIn((Presets In)) PattrBroadcast[Asynchronous\nInput\nBroadcaster] Master[Master Control] Audio[Djazz Audio] Midi[Djazz MIDI] PattrStorage[PattrStorage] click Master "./../components/master_control.html" "Master Control" click Audio "audio.html" "Master Control" click Midi "midi.html" "Master Control" AudioOut(((Audio\nOut))) MidiOut(((MIDI\nOut))) PattrOut(((Pattr\nOut))) TapIn-->Master PattrIn-->PattrBroadcast AudioIn--->Audio MidiIn--->Midi DataIn-->Master DataIn-->Audio DataIn-->Midi Master-->Audio Master-->Midi Audio-->AudioOut Midi-->MidiOut PresetIn-->PattrStorage PattrStorage-->PattrOut
flowchart TB;
%% FLOW -----------------------------------------------
TapInput---->|bang| MasterControl
DataInput--->MasterControl
MasterControl--->|beat number, beat label, tempo| MidiGenerators
MidiInput---->MidiIn
DataInput----->MidiData
MidiOuts-->MidiOutput
MasterControl--->|beat number, beat label, tempo| AudioGenerators
AudioInput---->AudioIn
DataInput----->AudioData
AudioOuts-->AudioOutput
PresetInput---->PattrStorage
PattrStorage------>PattrOutput
PattrInput--->PattrBroadcaster
%% INPUTS ------------------------------------------------
AudioInput((Audio\nIn L/R))
DataInput((File\nData\nIn))
MidiInput((MIDI In))
TapInput((Tap\nIn))
PresetInput((Presets In))
PattrInput((Pattr\nIn))
%% OUTPUTS -----------------------------------------------
AudioOutput(((Audio\nOut\n1-3 L/R)))
MidiOutput(((MIDI Out)))
PattrOutput(((Pattr Out)))
%% COMPONENTS ------------------------------------------------
PattrStorage[PattrStorage]
PattrBroadcaster[Asynchronous\nInput\nBroadcaster]
MasterControl[Master Control]
subgraph Midi[Djazz MIDI];
direction TB
MidiIn-->MidiData
MidiIn[MIDI\nIn]
subgraph MidiOut[MIDI\nOut]
direction TB
MidiData-->MidiGenerators
MidiGenerators-->MidiPlayer-->MidiOuts
MidiData[Data\nLoader]
MidiGenerators[Generators]
MidiPlayer["Midi\nPlayer"]
MidiOuts[MIDI\nOuts]
end
end
subgraph Audio[Djazz Audio];
direction TB
AudioIn-->AudioData
AudioIn[Audio\nIn]
subgraph AudioOut[Audio Out]
direction TB
AudioData-->AudioGenerators
AudioGenerators-->AudioPlayers-->AudioOuts
AudioData[Data\nLoader]
AudioGenerators[Generator 1]
AudioPlayers[Audio Beat Player 1];
AudioOuts[Audio\nTrack 1]
end
end
flowchart TB;
%% FLOW -----------------------------------------------
TapInput---->|bang| MasterIn
DataInput---->MasterData
DataInput--->aData
DataInput--->mData
MidiInput---->mInIn
AudioInput--->aInIn
PattrInput-->PattrBroadcaster
PresetInput---->PattrStorage
PattrStorage---------->PattrOutput
MasterOut--->|beat number, beat label, tempo| mOutIn
MasterOut-->|beat number, beat label, tempo| aOutIn
mOutOut-->MidiOutput
aOutOut--->AudioOutput
%% INPUTS ------------------------------------------------
AudioInput((Audio\nIn L/R))
DataInput((File\nData\nIn))
MidiInput((MIDI In))
TapInput((Tap\nIn))
PresetInput((Presets In))
PattrInput((Pattr\nIn))
%% OUTPUTS -----------------------------------------------
AudioOutput(((Audio\nOut\n1-3 L/R)))
MidiOutput(((MIDI Out)))
PattrOutput(((Pattr Out)))
%% COMPONENTS ------------------------------------------------
PattrStorage[PattrStorage]
PattrBroadcaster[Asynchronous\nInput\nBroadcaster]
%% MASTER CONTROL -----------------------------------------
subgraph MasterControl[Master Control];
direction TB
MasterIn(( ))
MasterOut(( ))
MasterData[Song Data Loader]
MasterAntescofo["Antescofo\n(to infer tempo)"]
BeatClock[Beat Clock]
GetBeatLabel["get beat label"]
MasterData --> MasterAntescofo
MasterData --> BeatClock
MasterData --> GetBeatLabel
MasterIn-->MasterAntescofo-->|tempo| MasterOut
MasterIn-->BeatClock-->|beat number| MasterOut
MasterIn-->GetBeatLabel-->|beat label| MasterOut
end
%% MIDI -----------------------------------------------
subgraph Midi[Djazz MIDI];
direction TB
%% MIDI IN -----------------------------------
subgraph MidiIn[MIDI\nIn]
direction TB
mInIn(( ))
mRecordBeatList[record beat data]
mBuildFactorOracle[build factor oracle]
mInIn --> mRecordBeatList
mRecordBeatList --> mBuildFactorOracle
mRecordBeatList --> mInOut
mBuildFactorOracle -->mInOut
mInOut(( ))
end
%% MIDI OUT -----------------------------------
subgraph MidiOut[MIDI\nOut]
direction TB
mOutIn(( ))
mData[Data\nLoader]
mg1[Generator 1]
mg2[Generator 2]
mg3[Generators 3-15]
subgraph mbPlayer[MIDI Beat Player];
mbPlayerAntescofo[Antescofo]
end
mt1[MIDI\nTrack 1]
mt2[MIDI\nTrack 2]
mt3[MIDI\nTracks 3-15]
mOutOut(( ))
mOutIn --> mg1
mOutIn --> mg2
mOutIn --> mg3
mData --> mg1
mData --> mg2
mData --> mg3
mg1 --> mbPlayer --> mt1 --> mOutOut
mg2 --> mbPlayer --> mt2 --> mOutOut
mg3 --> mbPlayer --> mt3 --> mOutOut
end
mInOut --> mData
end
%% end MIDI ---------------------------------------------
%% AUDIO ------------------------------------------------
subgraph Audio[Djazz Audio];
direction TB
%% AUDIO IN -----------------------------------
subgraph AudioIn[Audio\nIn]
direction TB
aInIn(( ))
aRecordBuffer[record audio buffer]
aRecordBeatList[record beat data]
aBuildFactorOracle[build factor oracle]
aInIn --> aRecordBuffer
aInIn --> aRecordBeatList
aRecordBeatList --> aBuildFactorOracle
aRecordBuffer --> aInOut
aRecordBeatList --> aInOut
aBuildFactorOracle -->aInOut
aInOut(( ))
end
subgraph AudioOut[Audio Out]
direction TB
aOutIn(( ))
aData[Data\nLoader]
ag1[Generator 1]
ag2[Generator 2]
ag3[Generator 3]
subgraph abPlayer1[Audio Beat Player 1];
direction TB
svp1[supersvp]
end
subgraph abPlayer2[Audio Beat Player 2];
direction TB
svp2[supersvp]
end
subgraph abPlayer3[Audio Beat Player 3];
direction TB
svp3[supersvp]
end
at1[Audio\nTrack 1]
at2[Audio\nTrack 2]
at3[Audio\nTrack 3]
aOutOut(( ))
aOutIn --> ag1 --> abPlayer1
abPlayer1 --> at1 --> aOutOut
aOutIn --> ag2 --> abPlayer2
abPlayer2 --> at2 --> aOutOut
aOutIn --> ag3 --> abPlayer3
abPlayer3 --> at3 --> aOutOut
aData --> ag1
aData --> ag2
aData --> ag3
end
aInOut --> aData
end
%% end AUDIO -------------------------------------------
click Master "./../components/master_control.html" "Master Control"
click Audio "audio.html" "Master Control"
click Midi "midi.html" "Master Control"
signal Audio signal is sent to djazz_audio_in
signal Audio signal is sent to djazz_audio_in
list (int pitch, int velocity, int channel) sent to djazz_midi_in
bang All active tracks MIDI and audio tracks will play their data located at the current beat in tempo when a bang is received. Any armed recording tracks will record any input during this beat in tempo.
list (symbol argument-name anything argument-value) See the section on pattrs
symbol The name of a Max dict that has been loaded with a JSON file. These are either song files or score files.
anything This is only used to send the “clientwindow” message to the pattrstorage object, which is useful for debugging. Any preset-related messages could be sent, but they should actually be sent to djazz_control.
Audio signal
Audio signal
Audio signal
Audio signal
Audio signal
Audio signal
A MIDI note is sent out as a list (int pitch, int velocity, int channel)
None
### MESSAGES
-See asynchronous messages.
-See
Page not found: /3_api/1_abstraction_references/components/master_control
for details about the following:/master_control
Page not found: /3_api/1_abstraction_references/components/master_control#loop-section-active
0/1Page not found: /3_api/1_abstraction_references/components/master_control
list (int int) start-beat end-beat master::start_beat int
flowchart TB;
TapInput -------->|"tempo,
beat number,
beat label"| mGens
MidiInput-->mInIn
DataInput------->|score dictionaries| mData
mInOut --->|dictionaries| mData
mOuts-->|MIDI data| Output
TapInput(("from
Master Control"))
MidiInput(("MIDI
Input"))
DataInput((from
data loaders))
Output(((MIDI
Output)))
%% MIDI IN -----------------------------------
subgraph MidiIn["<div style="width:25em;
height:10em;
display:flex;
justify-content: flex-start;
">MIDI In</div>"]
direction TB
mInIn -->|MIDI data| mRecordBeatList
mRecordBeatList --> |dictionary| mBuildFactorOracle
mRecordBeatList --> |dictionary| mInOut
mBuildFactorOracle -->|dictionary| mInOut
mInIn(( ))
mRecordBeatList[record beat data]
mBuildFactorOracle[build factor oracle]
mInOut(( ))
end
%% MIDI OUT -----------------------------------
subgraph MidiOut["<div style="width:35em;
height:10em;
display:flex;
justify-content: flex-start;
">MIDI Out</div>"]
direction TB
mData[Data Loader]
mGens[Generators]
mPlayer[MIDI Beat Player];
mOuts[MIDI Outs]
mData -->|dictionaries| mGens
mGens -->|beat data dictionaries| mPlayer -->|MIDI data| mOuts
end
Sets the entry at the given index
When using a dict to mimic an array, use this as the assignment operator [] or set.
list
left inlet: (int anything) index, entry
symbol
right inlet: dict name
Takes a label representing the current musical state, and returns another label to be used by the improvisation algorithm.
The input label can be passed to it by anything–the master control, other generators, or the same generator in which this analyzer resides.
Currently only passes the chord label for the next beat, passed by the master control, directly through without modification.
So for now this object exists more as a placeholder. This is where real-time music analysis code should go.
label + new symbol
symbol
a label representing the current musical state to be used by the improvisation algorithm.
djazz.listener_control
djazz.listeners_router
djazz.beat_generator
djazz.midi.midi_beat_generator
djazz.audio.beat_generator
Converts an antescofo file into a Max dict (which can then be saved as a JSON file).
Dict format:
tracks
int
beat
int
notes
int: note data
int: note data
int
…
tracks dict name
symbol
full path to antescofo file
clear
clears the Max dict
Uses antescofo to infer the current tempo based on time between input messages.
Loads the file antescofo_djazz.txt, which must be in the Max search path (currently in data/antescofo_scores).
tempo inferred from time between inputs
bang
left inlet: bangs will cause inferred tempo to be output. Initial tempo must be set and bangs must not deviate far from current tempo. Two bangs must occur before tempo is inferred.
initial_tempo
left inlet: ( + float) tempo to set antescofo’s tempo inference mechanism. Initial input tempo must be close to this.
Upon receipt of a beat number, label, and tempo, sends data about the next beat to read to the beat reader.
Pattr messages (must be passed via an external pattrhub/pattrstorage):
transpose_pitch (int) -255 - +255
transpose_octave (int) -255 - +255
next_beat (int) 0-255
end_beat (int) 0-255
speed_active (int) 0/1
speed_numerator (int) 1-255
speed_denominator (int) 1-255
loop_length (int) 1-8
loop_section_active (int) 0/1
loop_section_beats (list: int int)
improvise (int) 0/1
pitch_range (int) 0-11
max_continuity (int) 0-255
(int int int int) 1. beat generator number, 2. track number, 3. start time in ms, 4. end time in ms
symbol
right inlet: label for analyzer
beat
left inlet: (+ int) incoming beat number
label
left inlet: (+ symbol) incoming beat label
tempo
left inlet: (+ float) current tempo
factor_oracle
left inlet: (+ symbol) dict name
beat_dict_name
left inlet: (+ symbol) dict name
djazz.beat_generator
djazz.audio.audio_out
Plays back a beat of audio at a time from a buffer, where beats are passed in in a dict.
Uses supervp to playback in tempo and with pitch transposition.
audio out 1
audio out 2
list
left inlet: (int float int int) 1. pitch transposition, 2. tempo, 3. start time, 4. end time
audio_buffer_offset_in_ms
middle inlet: (+ int) adjusts the latency of the audio output. Default is 170 ms.
crossfade_time_in_ms
middle inlet: (+ int) adjusts the crossfade time between beats.
audio_buffer_name
right inlet: (+ symbol) audio buffer to play from
djazz.audio.beat_generator
djazz.audio.supervp_player
Reads the note data at the given beat data and sends it out to the beat player.
(int int int) 1. track number, 2. start time in ms 3. end time in ms
beat count
list
left inlet: (symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo
symbol
right inlet: beat list dict name
Controls which other audio generator(s) a generator will listen to
Pattr messages (must be passed via an external pattrhub/pattrstorage):
include_master (int) 0/1
listener_1 (int 1-3) which player listener 1 is listening to
listener_2 (int 1-3) which player listener 2 is listening to
listener_3 (int 1-3) which player listener 3 is listening to
label received from player being listened to
list
right inlet: (int symbol) listener number and label passed from listener
label
left inlet: (symbol) the label passed from the master control. Will be passed through if include_master is set to 1
djazz.analyzer
Records an audio buffer and a beat list, given the appropriate input.
sends every time a new repetition is added to beat list
sets the size of the buffer when recording is started/stopped, with/without clearing it, respectively
signal
left inlet: audio in 1
signal
in1: audio in 2
audio_buffer_name
right inlet: (+ symbol) name of audio buffer to record to
audio_score_dict_name
right inlet: (+ symbol) name of audio score (+ beat list) to write to
beat
right inlet: (+ int) starts writing a new beat when received
initial_tempo
right inlet: (+ float) bpm by which to calculate next beat and note durations
loop_section_beats
right inlet: (+ list: int int) start beat, end beat
will begin a new repetition whenever end beat is reached, restarting at start beat
djazz.audio
Wraps the supervp player for audio playback
audio out 1
audio out 2
position in audio file
list
left inlet: float float float int:1. start time in ms, 2. end time in ms, 3. duration in ms, 4. transposition (in semitones)
int
in1: crossfade time between beats in ms
symbol
right inlet: buffer name to play from
Adjusts message being sent to djaz.audio.beat_player so that the audio will be transposed up the desired number of octaves.
Pattr messages (must be passed via an external pattrhub/pattrstorage):
octaves (int) -255 to 255
(symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo
list
left inlet: (+ list: symbol int float) 1. beat dict name, 2. pitch transposition 3. tempo
Adjusts message being sent to djaz.audio.beat_player so that the audio will be transposed up the desired number of semitones.
Pattr messages (must be passed via an external pattrhub/pattrstorage):
semitones (int) -255 to 255
symbol int float; 1. beat dict name, 2. pitchtransposition, 3. tempo
list
left inlet: (+ list: symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo
Handles all the audio portion of djazz.
flowchart TB;
TapInput ----->|"tempo,
beat number,
beat label"| mGens
TapInput -->|"tempo,
beat number,
beat label"| mRecordBeatList
AudioInput--->|audio data|mRecordAudioBuffer
DataInput---->|score dictionaries| mData
mOuts--->|audio data| Output
mRecordBeatList --> |dictionary| mData
mBuildFactorOracle -->|dictionary| mData
TapInput(("from
Master Control"))
AudioInput(("Audio
Input"))
DataInput((from
data loaders))
Output(((Audio
Output)))
%% Audio IN -----------------------------------
subgraph AudioIn["<div style="width:40em;
height:10em;
display:flex;
justify-content: flex-start;
">Audio In</div>"]
direction TB
mRecordBeatList --> |dictionary| mBuildFactorOracle
mRecordAudioBuffer[record audio buffer]
mRecordBeatList[record beat data]
mBuildFactorOracle[build factor oracle]
end
%% Audio OUT -----------------------------------
subgraph AudioOut["<div style="width:50em;
height:10em;
display:flex;
justify-content: flex-start;
">Audio Out</div>"]
direction TB
mData[Data Loader]
mGens[Generators]
mPlayer[Audio Beat Player];
mOuts[Audio Outs]
mData -->|dictionaries| mGens
mGens -->|beat data dictionaries| mPlayer -->|Audio data| mOuts
end
audio out 1 left
audio out 1 right
audio out 2 left
audio out 2 right
audio out 3 left
audio out 3 right
signal
left inlet: audio in 1
signal
in1: audio in 2
-
audio_buffer_name
in2: (+ symbol) name of audio buffer to record to and play from
record_active
in2: (+ 0/1) 1 arms the audio buffer to record; will not start recording until a beat number is received. 0 turns off record state.
initial_tempo
in2: (+ float) bpm by which to calculate next beat and note durations
loop_section_beats
in2: (+ list: int int) start beat, end beat
will begin a new repetition whenever end beat is reached, restarting at start beat
max_repetitions
in2: (+ int) will stop recording when this number is reached
in
right inlet: (+ symbol) folder name audio data to load for audio in subpatcher
out
right inlet: (+ symbol) folder name audio data to load for audio out subpatcher
djazz.audio.record
djazz.audio.supervp_player
Passes audio signal through. Control with djazz.view.audio_track.
Pattr messages (must be passed via an external pattrhub/pattrstorage):
volume (int) 0-127
active (int) 0/1
solo (int) 0/1
mute (int) 0/1
audio signal 1/L
audio signal 2/R
signal
left inlet: audio signal 1/L
right inlet: audio signal 2/R
djazz.view.audio_out_track
djazz.solo_bank
When active, will output beats in the polyrhythm given by numerator/denominator. Incoming beats will not be output, except for those that fall in phase with the output beats.
bang
depends on polyrhythm state
left inlet: When effect off (active = 0), passed directly through. When effect on (active = 1), triggers a new polyrhythm, or is ignored if a polyrhythm is in course.
active
left inlet: (+ 0/1) turns effect off or on
numerator
left inlet: (+ int) number of evenly spaced bangs to output in the space of denominator beats at the given tempo
denominator
left inlet: (+ int) number of beats to output numerator evenly spaced bangs over
Inputs bangs and outputs a beat number, based on loop, step, start, and end parameters.
Will not output when end beat is reached or after.
next beat
bang when loop occurs
bang when end is reached
bang
left inlet: bang for next beat
next_beat
right inlet: (+ int) sets the next beat to play when next bang is received
end
right inlet: (+ int) sets the end beat; when reached, no more output will occur
step
right inlet: (+ int) how many beats to advance upon receiving a bang; default is 1