Pilcrow Records

Scripter Javascript Tutorial

javascriptmusiclogicscripterbookexcerpttutorial

79 Summary

A summary comment can contain basic information about the script and can provide helpful context to the script when going back into it after a long time. It’s similar to a README file:

/*
Name: Live Humanize
Author(s): Philip Regan
Purpose: Randomize velocity, beatPos, and detune by Ticks during play
Information: 
	* Need to increase Tick range to ensure more noticeable changes
Change History:
	21_10_23_01_00_00: Started script
	21_10_23_01_01_00: Added NoteOn and NoteOff capturing
*/

In the above example, basic but important information is captured in this comment:

Summary comments can also be used for at least moderately complex functions:

/*
Purpose: Modifies an event's properties based on control settings
Input: MIDI event
Output: modified MIDI event
*/
function humanizeEvent(event) {
	// do something
}