Scripter Javascript Tutorial
javascriptmusiclogicscripterbookexcerpttutorial56 Trace()
and
JSON
MDN: Global Objects: JSON
An important consideration when working with Scripter-sourced objects
(as opposed to objects you create yourself) is that Trace()
will output two different results to the console depending on how the
event is used. Both methods are typically needed to get a complete
picture of an event. In addition to using JSON as shown previously,
there is also using Trace()
on the event itself:
function HandleMIDI(event) {
Trace(event);
}
...which results in the following output in the console:
[NoteOn channel:1 pitch:61 [C#3] velocity:100]
The properties shared by the two outputs are channel
,
pitch
, and velocity
. When working with a new
track, using both the JSON trace and the plain Trace()
are
beneficial to understand just what is happening.