Abstraction Reference

Hmmmm…

Subsections of Abstraction Reference

darr.get_size

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.

OUTLETS
0   int

number of keys in dict

MESSAGES

symbol
dict name

SEE ALSO

djazz

flowchart TB;

AudioIn1((Audio\nIn L))
AudioIn2((Audio\nIn R))
MidiIn((MIDI In))
TapIn((Tap\nIn))
PattrIn((Pattr\nIn))
DataIn((File\nData\nIn))
PresetIn((Presets In))

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"


AudioOut1(((Audio\nOut 1L)))
AudioOut2(((Audio\nOut 1R)))
AudioOut3(((Audio\nOut 2L)))
AudioOut4(((Audio\nOut 2R)))
AudioOut5(((Audio\nOut 3L)))
AudioOut6(((Audio\nOut 3R)))
MidiOut(((MIDI Out)))
PattrOut(((Pattr Out)))


AudioIn1--->Audio
AudioIn2--->Audio

TapIn-->Master

PattrIn-->Master
PattrIn-->Audio
PattrIn-->Midi

DataIn-->Audio
DataIn-->Midi
DataIn-->Master

Master-->Audio
Master-->Midi

MidiIn-->Midi

Audio-->AudioOut1
Audio-->AudioOut2
Audio-->AudioOut3
Audio-->AudioOut4
Audio-->AudioOut5
Audio-->AudioOut6

Midi-->MidiOut

PresetIn-->PattrStorage
PattrStorage-->PattrOut

INLETS

1   signal

Audio In 1

signal Audio signal is sent to djazz_audio_in

2   signal

Audio In 2

signal Audio signal is sent to djazz_audio_in

3   list

Midi In

list (int pitch, int velocity, int channel) sent to djazz_midi_in

4   bang

Triggers next beat

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.

5   list

Asynchronous input (such as that sent from pattr objects)

list (symbol argument-name anything argument-value) See the section on pattrs

6   symbol

Loads records needed for playback

symbol The name of a Max dict that has been loaded with a JSON file. These are either song files or score files.

7   anything

Messages to the pattrstorage objects

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.

OUTLETS

0   signal

Audio Track 1 Out 1

Audio signal

1   signal

Audio Track 1 Out 2

Audio signal

2   signal

Audio Track 2 Out 1

Audio signal

3   signal

Audio Track 2 Out 2

Audio signal

4   signal

Audio Track 3 Out 1

Audio signal

5   signal

Audio Track 3 Out 2

Audio signal

6   list

MIDI output

A MIDI note is sent out as a list (int pitch, int velocity, int channel)

7   list

View control data

ATTRIBUTES

None

MESSAGES

### 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/1

Page not found: /3_api/1_abstraction_references/components/master_control

list (int int) start-beat end-beat master::start_beat int
master::end_beat int
master::initial_tempo float
-See Audio In for details about the following:
/audio_in
audio::audio_in::record_active 0/1
audio::audio_in::max_repetitions int
audio::audio_in::save::folder_path symbol
-See Audio Out for details about the following:
/audio_out
(for n from 1-3):
audio::audio_out::beat_players::beat_player_n::crossfade_time_in_ms int
audio::audio_out::beat_players::beat_player_n::audio_buffer_offset_in_ms int
(for n from 1-3):
audio::audio_out::listeners::listener_n 0/1
audio::audio_out::listeners::include_master 0/1
(for n from 1-3):
audio::audio_out::audio_out_bank::track_n::volume int 0-127
audio::audio_out::audio_out_bank::track_n::mute 0/1
audio::audio_out::audio_out_bank::track_n::solo 0/1
audio::audio_out::audio_out_bank::track_n::active 0/1
(for n from 1-3):
audio::audio_out::generators::audio_beat_generator_n::loop_length int
audio::audio_out::generators::audio_beat_generator_n::speed_numerator int
audio::audio_out::generators::audio_beat_generator_n::end_beat int
audio::audio_out::generators::audio_beat_generator_n::next_beat int
audio::audio_out::generators::audio_beat_generator_n::loop_section_active 0/1
audio::audio_out::generators::audio_beat_generator_n::speed_denominator int
audio::audio_out::generators::audio_beat_generator_n::speed_active 0/1
audio::audio_out::generators::audio_beat_generator_n::loop_section_beats int
audio::audio_out::generators::audio_beat_generator_n::pitch_range int
audio::audio_out::generators::audio_beat_generator_n::max_continuity int
audio::audio_out::generators::audio_beat_generator_n::improvise 0/1
audio::audio_out::generators::audio_beat_generator_n::transpose_octave int
audio::audio_out::generators::audio_beat_generator_n::transpose_pitch int
(for n from 1-3):
audio::audio_out::data_loaders::track_loader_n::repetition int
(for n from 1-15):
midi::midi_out::midi_out_bank::track_n::mute 0/1
midi::midi_out::midi_out_bank::track_n::active 0/1
midi::midi_out::midi_out_bank::track_n::solo 0/1
midi::midi_out::midi_out_bank::track_n::volume int 0-127
midi::midi_out::midi_out_bank::track_n::port symbol
midi::midi_out::midi_out_bank::track_n::channel_out int 1-16
midi::midi_out::midi_out_bank::track_n::ctrl_msg int
midi::midi_out::midi_out_bank::track_n::effect_list::transpose_octave::octaves int -255-+255
midi::midi_out::midi_out_bank::track_n::effect_list::transpose_pitch::semitones int -255-+255
midi::midi_out::data_loaders::scores::score_file_1::file_path symbol
midi::midi_out::data_loaders::scores::score_file_2::file_path symbol
midi::midi_out::data_loaders::track_loader_1::repetition int 0-255
midi::midi_out::data_loaders::track_loader_2::repetition int 0-255
(for n from 1-15):
midi::midi_out::listeners::listener_n
midi::midi_out::listeners::include_master
(for n from 1-15):
midi::midi_out::generators::midi_beat_generator_n::loop_length int
midi::midi_out::generators::midi_beat_generator_n::speed_numerator int
midi::midi_out::generators::midi_beat_generator_n::end_beat int
midi::midi_out::generators::midi_beat_generator_n::start_beat int
midi::midi_out::generators::midi_beat_generator_n::loop_section_active 0/1
midi::midi_out::generators::midi_beat_generator_n::speed_denominator int
midi::midi_out::generators::midi_beat_generator_n::speed_active 0/1
midi::midi_out::generators::midi_beat_generator_n::loop_section_beats list (int int)
midi::midi_out::generators::midi_beat_generator_n::pitch_range 0-255
midi::midi_out::generators::midi_beat_generator_n::max_continuity 0-255
midi::midi_out::generators::midi_beat_generator_n::improvise 0/1
midi::midi_in::folder_path symbol
midi::midi_in::record_active 0/1
midi::midi_in::save::folder_path symbol
SEE ALSO

SEE ALSO

djazz_data djazz_control djazz_view_control

darr.set_at

Sets the entry at the given index

When using a dict to mimic an array, use this as the assignment operator [] or set.

MESSAGES

list
left inlet: (int anything) index, entry

symbol
right inlet: dict name

SEE ALSO

djazz view

djazz.analyzer

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.

OUTLETS
0   list: symbol symbol

label + new symbol

MESSAGES

symbol
a label representing the current musical state to be used by the improvisation algorithm.

SEE ALSO

djazz.listener_control
djazz.listeners_router
djazz.beat_generator
djazz.midi.midi_beat_generator
djazz.audio.beat_generator

djazz view control

djazz.antescofo_file_to_tracks_dict

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

OUTLETS
0   symbol

tracks dict name

MESSAGES

symbol
full path to antescofo file

clear
clears the Max dict

SEE ALSO

djazz.antescofo_get_tempo

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).

OUTLETS
0   float

tempo inferred from time between inputs

MESSAGES

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.

SEE ALSO

djazz.audio.beat_generator

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

OUTLETS
0   list

(int int int int) 1. beat generator number, 2. track number, 3. start time in ms, 4. end time in ms

MESSAGES

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

SEE ALSO

djazz.beat_generator
djazz.audio.audio_out

djazz.audio.beat_player

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.

OUTLETS
0   signal

audio out 1

1   signal

audio out 2

MESSAGES

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

SEE ALSO

djazz.audio.beat_generator
djazz.audio.supervp_player

djazz.audio.beat_reader

Reads the note data at the given beat data and sends it out to the beat player.

OUTLETS
0   list

(int int int) 1. track number, 2. start time in ms 3. end time in ms

1   int

beat count

MESSAGES

list
left inlet: (symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo

symbol
right inlet: beat list dict name

SEE ALSO

djazz.audio.listeners_router

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

OUTLETS
0   symbol

label received from player being listened to

MESSAGES

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

SEE ALSO

djazz.analyzer

djazz.audio.record

Records an audio buffer and a beat list, given the appropriate input.

OUTLETS
0   repetitions + int

sends every time a new repetition is added to beat list

1   setsize + int, crop 0 + int

sets the size of the buffer when recording is started/stopped, with/without clearing it, respectively

MESSAGES

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

SEE ALSO

djazz.audio

djazz.audio.supervp_player

Wraps the supervp player for audio playback

OUTLETS
0   signal

audio out 1

1   signal

audio out 2

2   signal

position in audio file

MESSAGES

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

SEE ALSO

djazz control

djazz.audio.transpose_octaves

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

OUTLETS
0   list

(symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo

MESSAGES

list
left inlet: (+ list: symbol int float) 1. beat dict name, 2. pitch transposition 3. tempo

SEE ALSO

djazz.audio.transpose_pitch

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

OUTLETS
0   list

symbol int float; 1. beat dict name, 2. pitchtransposition, 3. tempo

MESSAGES

list
left inlet: (+ list: symbol int float) 1. beat dict name, 2. pitch transposition, 3. tempo

SEE ALSO

djazz.audio

Handles all the audio portion of djazz.

OUTLETS
0   signal

audio out 1 left

1   signal

audio out 1 right

2   signal

audio out 2 left

3   signal

audio out 2 right

4   signal

audio out 3 left

5   signal

audio out 3 right

MESSAGES

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

SEE ALSO

djazz.audio.record
djazz.audio.supervp_player

djazz.audio_out_track

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

OUTLETS
0   signal

audio signal 1/L

1   signal

audio signal 2/R

MESSAGES

signal
left inlet: audio signal 1/L
right inlet: audio signal 2/R

SEE ALSO

djazz.view.audio_out_track
djazz.solo_bank

djazz.bang_speed

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.

OUTLETS
0   bang

-bangs over time in the polyrhythm determined by numerator and denominator

1   float

-tempo using output bangs as beat

MESSAGES

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

SEE ALSO

djazz.beat_clock

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.

OUTLETS
0   int

next beat

1   bang

bang when loop occurs

2   bang

bang when end is reached

MESSAGES

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

SEE ALSO