Ableton Live11 - add_new_notes/apply_note_modifications (dictionary methode)

dfwaudio's icon

Hello, hello. Another day, another issue.
I wanted to update one of my patches for Live11. Since there is a major change in note manipulation with all these 'new' parameters, i have to change a lot of things in the patch. I'm able to read out note parameters with 'get_notes_extended', but I'm not able to find out how to format the dictionaries in a way to add new notes or modificate them.
Another problem i have: I can't manipulate these note dictionaries with the
'set notes::pitch $1' method, like in the 'dict' reference described. I think it's because of the square brackets in the dictionary text, which aren't used in all these reference examples.
I hope one of you great guys can give the crucial tip for my problems.
Thanks in advance

Matthias

Max Patch
Copy patch and select New From Clipboard in Max.

dfwaudio's icon

Ah.... 'get_notes_extended' outputs a dictionary array of note parameters in a key named 'notes:'
Manipulation of arrays must be indexed: 'set notes[0]::pitch $1' modifies the pitch value for note 1 in the array. I should study the reference more carefully. But maybe it helps someone.
For me it's a step further, but now i have to figure out how to apply new array entries and put all that in the right format. If somebody has some tips... you are welcome. But anyway... I will update my progress.

dfwaudio's icon

Had success in manipulating notes in live11. Only thing to do is to manage the right format for arrayed dictionary. Had no problems to create an array with more than one notes. But i don't know how to create an dictionary array format (with square brackets) with only one dictionary entry. So i built a workaround... Even if there is only one note manipulated, the patch outputs 2 identical notes... its not perfect, but it works. Maybe someone can help me to understand how to build the right format with only one dict entry output.
Here my example:

Max Patch
Copy patch and select New From Clipboard in Max.

More about how to write new notes will follow.

broc's icon

I think an array with only one entry is not possible. So if a key may be associated with a single entry or an array you need different handlings (which can be controlled with 'gettype').

dfwaudio's icon

Thanks for you answer. Ok... the problem is: live.object with 'call apply_note_modifications ...' only handles dicts with notes stored in an array format, i think.

broc's icon

But according to the LOM, apply_note_modifications should accept the output from get_notes_extended regardless of the number of notes...

dfwaudio's icon

I tried different formats... unfortunatly no succes. But you can try it by yourself with the above patch. Delete the massage outlet for the dummy note. I always get an error. Maybe i will contact the support, since there is no explaination anywhere. Also M4L examples are based on the old process for reading and writing notes in Live10.

broc's icon

Just did some tests but found no proper solution. So it would be nice to get clarification from support.

dfwaudio's icon

https://cycling74.com/articles/what's-new-in-live-11-part-2/
This article explains everything related to the new notes API in Live11. Very comprehensibly examples for every command.

LDMdesign's icon

oh many thanks for sharing. I've been struggling all day why I can't seem to do anything in JS with this.