Perform
MIDIConfig
Bases: dict
invertible map from MIDI channel: Notochord instrument
Source code in src/notochord/perform.py
channels
property
set of channels
insts
property
set of instruments
inv(inst)
map from Notochord instrument: MIDI channel
Source code in src/notochord/perform.py
NotoPerformance
track various quantities of a Notochord performance:
event history
- wall time
- nominal dt
- pitch
- velocity (0 for noteoff)
- notochord instrument
query for
- instruments present in the last N events
- number of note_ons by instrument in last N events
- currently playing notes with user data as {(inst, pitch): Any}
- currently playing notes as {inst: pitches}
Source code in src/notochord/perform.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
note_data
property
held notes as {(chan,inst,pitch):held_note_data}. mutable.
note_pairs
property
held notes as {(inst,pitch)}.
returns a new set
; safe to modify history while iterating
note_triples
property
held notes as {(channel,inst,pitch)}.
returns a new set
; safe to modify history while iterating
notes
property
generic way to access notes, returns set of namedtuples
returns a new set
; safe to modify history while iterating
feed(held_note_data=None, **event)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
held_note_data |
Any
|
any Python object to be attached to held notes (ignored for note-offs) |
None
|
Source code in src/notochord/perform.py
held_inst_pitch_map(insts=None)
held notes as {inst:[pitch]} for given instruments
Source code in src/notochord/perform.py
inst_counts(n=0, insts=None)
instrument counts in last n (default all) note_ons