Output array data at outlets

dfwaudio's icon

Tried to edit a .js from M4l NotesApi examples. Want to get a string of all note parameters for every note which is in the array, but i don't understand how to set the right arguments. Or do i have to create a list function before? Only major thing i changed was to delete the sort function from orginal patch. But i only get 'not a number' messages in console and at the outputs.

autowatch = 1
inlets = 2
outlets = 2

var clipApi = null

function id(id) {
    clipApi = new LiveAPI("id " + id)
    if (clipApi.path === "") clipApi = null
}

function getNotes(pitch, pitchSpan, fromeTime)
{
    if (clipApi == null) throw("No clip")

clipApi.call("get_notes_extended", pitch, pitchSpan, fromTime, 1)
    var notesObject = JSON.parse(notesJson)
    var notesArray = notesObject.notes
    getNotes(notesArray[notesArray.length - 1])
}

function getNotes(note) {
    outlet(0,     + note.note_id,
                + note.pitch,
                + note.start_time,
                + note.duration,
                + note.velocity,
                + note.mute,
                + note.probability,
                + note.velocity_deviation,
                + note.release_velocity)
}

thanks for response

Bradley Korth's icon

There shouldn't be plus signs in function getNotes. I've gotten NaN outputs by having something only on the right side of a plus sign.