Scripter Javascript Tutorial
javascriptmusiclogicscripterbookexcerpttutorial88 Extra Returns and Indents for Code Blocks
The following is syntactically correct but gains nothing:
var NeedsTimingInfo = true;
var activeNotes = [];
var lastBlockStart;
function HandleMIDI( event ) {
if ( event instanceof NoteOn ) {
.push( event );
activeNoteselse if ( event instanceof NoteOff ) {
} // remove the note from activeNotes
}}function ProcessMIDI() {
var timingInfo = GetTimingInfo();
if ( timingInfo.playing ) {
var currBlockStart = Math.floor(timingInfo.blockStartBeat);
if ( currBlockStart != lastBlockStart \&\&
<= 1 || currBlockStart \% timingInfo.meterNumerator == 0 ) ) {
( currBlockStart Trace(lastBlockStart + " - " + currBlockStart)
}}}
What may seem like a benefit in having everything viewable in a single window pane will be much harder to maintain when returned to days or even weeks later.