I'm trying to retrieve all the midi note information from a specific clip on a specific track. I've managed to get data returned but what I am assuming is the pitch info doesn't match what's being played in the clip. The code is below:
Code: Select all
function myfunction(trk, slot){
var api = new LiveAPI(function(result){
this.call('select_all_notes');
var notes = this.call('get_selected_notes','pitch'); //adding the pitch argument seems to make no difference
/*
SHOULD RETURN:
count [int] is the number of note lines to follow.
pitch [int] is the MIDI note number, 0...127, 60 is C3.
time [double] is the note start time in beats of absolute clip time.
duration [double] is the note length in beats.
velocity [int] is the note velocity, 1 ... 127.
muted [bool] is 1 if the note is deactivated.
*/
post(notes);
}, "live_set tracks "+trk+" clip_slots "+slot+" clip");
}Based on the docs the first two values tell me the "count" or total number of notes in the clip. and then there is a "note" followed by 5 values. I am assuming that as per the docs, the values should be pitch, time, duration,velocity,muted in that order. However as I stated before, the pitches listed do not match what is being played and in this set I put together there is only one midi clip. Am I reading this wrong? or is there something wrong with how I'm calling the function?
Furthermore, according to the docs, arguments can be added to "get_selected_notes" so if I wanted only the pitch values I could add the "pitch" argument to "get_selected_notes". When I tried to add the pitch argument in javascript it still returns everything though. What am I doing wrong?