I´m on Live 11 so the recommended function is "add_new_notes" (documentation: https://docs.cycling74.com/max8/vignett ... model#Clip)
Code: Select all
add_new_notes
Parameter:
dictionary
Key: "notes" [list of note specification dictionaries]
Note specification dictionaries have the following keys:
pitch: [int] the MIDI note number, 0...127, 60 is C3.
start_time: [float] the note start time in beats of absolute clip time.
duration: [float] the note length in beats.
velocity (optional): [float] the note velocity, 0 ... 127 (100 by default).
mute (optional): [bool] 1 = the note is deactivated (0 by default).
probability (optional): [float] the chance that the note will be played:
1.0 = the note is always played
0.0 = the note is never played
(1.0 by default).
velocity_deviation (optional): [float] the range of velocity values at which the note can be played:
0.0 = no deviation; the note will always play at the velocity specified by the velocity property
-127.0 to 127.0 = the note will be assigned a velocity value between velocity and velocity + velocity_deviation, inclusive; if the resulting range exceeds the limits of MIDI velocity (0 to 127), then it will be clamped within those limits
(0.0 by default).
release_velocity (optional): [float] the note release velocity (64 by default).
For MIDI clips only.
Available since Live 11.0.
Code: Select all
# get clip ...
notes = []
note = {
"pitch": 79,
"start_time": 1,
"duration": 4,
"velocity ": 127,
}
notes.append(note)
new_notes = {"notes": notes}
clip.add_new_notes(new_notes)
No registered converter was able to produce a C++ rvalue of type struct NPythonClip::TNoteSpecification from this Python object of type str
Does anybody know how to to it correctly?