"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 0A                            */
/* Writing a Character                                 */
/* (grey's theme)                                      */
/* (c) Sean Kelly, 2014                                */
/*                                                     *
   Can you see the world from orbit?  
   Spin a coin, and tell me whose side does it land on?
   With your fall at the horizon,
   were your two cents worth their wait for revolution?
    
   ~ If you don’t believe in anything at everything
   ~ don’t you believe you can’t believe in anything?
   ~ Once you don’t believe in everything at anything
   ~ you can’t believe you must believe in anything.
    
   When encompassing turned tables, 
   which direction is your guiding needle spinning?
   If your points are tracked in records, 
   is repeating them a sign that something’s broken?
    
   ~
    
   Does your mirror reflect your values?  
   Can you see them backwards in your burnished image?
   Focus your illumination:
   do your negatives develop in the shadow?
    
   ~
    
   When the sky sheds tears of sorrow,
   she’s not blue, so tell me whose reign should we fall for?
   Do you give your life so easy
   to be ruling, or be ruling out, tomorrow?
   
/* --------------------------------------------------- */
DATA_CHIPTUNES["Writing a Character"] = {
		"chip": "oneofeach"
	,	"bpm": 240 // 120bpm in 8ths
	,	"priority": 1 // baseline nonzero for BGM
	,	"songdata" : {
			"st":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 1.0, "end": 0.0, "dur": 0}
					}
				//,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
				//		"data": {"start": 1.0, "end": 1.0, "dur": 0}
				//	}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 5}
					}
				// 4&
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 2"
						]
					}
				// verse line 1
				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 240} // (back) into 8ths
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 1"
						,	"Dn4 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn3 1"
						,	"Bn3 1"
						,	"Dn4 1"
						,	"Gn4 1"
						,	"Bn4 1"
						,	"Gn4 1"
						,	"Dn4 1"
						,	"Bn3 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf3 1"
						,	"Dn4 1"
						,	"Fn4 1"
						,	"Bf4 1"
						,	"Dn5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn4 1"
						,	"En4 1"
						,	"Gn4 1"
						,	"Cn5 1"
						,	"En5 1"
						,	"Cn5 1"
						,	"Gn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Dn5 1"
						,	"Fn5 1"
						,	"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An3 1"
						]
					}

				// verse line 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 1"
						,	"Dn4 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn3 1"
						,	"Bn3 1"
						,	"Dn4 1"
						,	"Gn4 1"
						,	"Bn4 1"
						,	"Gn4 1"
						,	"Dn4 1"
						,	"Bn3 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf3 1"
						,	"Dn4 1"
						,	"Fn4 1"
						,	"Bf4 1"
						,	"Dn5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn4 1"
						,	"En4 1"
						,	"Gn4 1"
						,	"Cn5 1"
						,	"En5 1"
						,	"Cn5 1"
						,	"Gn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Dn5 1"
						,	"Fn5 1"
						,	"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"En4 1"
						,	"Dn4 1"
						,	"An3 1"
						,	"En4 1"
						,	"Df4 1"
						]
					}

				// refrain iter 1
				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 480} // into 16ths
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 1"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"En3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn3 2"
						,	"Fn3 2"
						,	"Fn3 2"
						,	"Fn3 2"
						,	"Gn3 2"
						,	"Gn3 2"
						,	"Gn3 2"
						,	"Gn3 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn4 1"
						,	"Fn3 1"
						,	"Cn4 1"
						,	"Fn3 1"
						,	"Fn4 1"
						,	"Fn3 1"
						,	"An4 1"
						,	"Fn3 1"
						,	"Gn4 1"
						,	"Fn3 1"
						,	"Fn4 1"
						,	"Fn3 1"
						,	"En4 1"
						,	"An3 1"
						,	"Gn4 1"
						,	"An3 2"
						]
					}

				// refrain iter 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn3 2"
						,	"Gn3 2"
						,	"Gn3 2"
						,	"Gn3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 2"
						,	"An3 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 1"
						,	"An3 1"
						,	"Dn4 1"
						,	"An4 1"
						,	"Dn5 1"
						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"

						,	"An4 1"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An3 1"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An3 1"
						,	"En4 1"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -27, "times": 1}
					}
				]
		,	"tri":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.75}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.2}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}
				// 4&
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn3 2"
						]
					}

				// verse line 1
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 3"
						,	"Dn3 1"
						,	"Dn3 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn2 3"
						,	"Gn2 1"
						,	"Gn2 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf2 3"
						,	"Bf2 1"
						,	"Bf2 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn3 3"
						,	"Cn3 1"
						,	"Cn3 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 3"
						,	"Dn3 3"
						,	"Dn3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 3"
						,	"Dn3 2"
						,	"An2 3"
						]
					}

				// verse line 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 3"
						,	"Dn3 1"
						,	"Dn3 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn2 3"
						,	"Gn2 1"
						,	"Gn2 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf2 3"
						,	"Bf2 1"
						,	"Bf2 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn3 3"
						,	"Cn3 1"
						,	"Cn3 4"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 3"
						,	"Dn3 3"
						,	"Dn3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn2 3"
						,	"Dn2 3"
						,	"Dn2 1"
						,	"Dn2 1"
						]
					}

				// refrain iter 1
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 2"
						,	"Dn3 2"
						,	"Cn3 2"
						,	"Cn3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf2 2"
						,	"Bf2 2"
						,	"An2 2"
						,	"An2 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn2 2"
						,	"Gn2 2"
						,	"En3 2"
						,	"En3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn3 2"
						,	"Fn3 2"
						,	"Df3 2"
						,	"Df3 2"
						]
					}

				// refrain iter 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 2"
						,	"Dn3 2"
						,	"Cn3 2"
						,	"Cn3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf2 2"
						,	"Bf2 2"
						,	"An2 2"
						,	"An2 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn2 2"
						,	"Gn2 2"
						,	"An2 2"
						,	"An2 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						,	"Dn3 1"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -21, "times": 1}
					}
				
				]
		,	"sq":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.075}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5625}
					}
				// 4&
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 1"
						,	"An3 1"
						]
					}

				// verse line 1
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 5"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bn4 1"
						,	"Gn4 5"
						,	"Dn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn4 5"
						,	"Fn4 1"
						,	"Gn4 1"
						,	"Fn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En4 2"
						,	"Dn4 2"
						,	"Cn4 2"
						,	"En4 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 3"
						,	"An3 5"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 6"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 1"
						,	"Dn4 1"
						]
					}

				// verse line 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 5"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bn4 1"
						,	"Gn4 5"
						,	"Fn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn4 2"
						,	"Fn4 1"
						,	"Gn4 2"
						,	"An4 3"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn4 2"
						,	"Fn4 2"
						,	"En4 2"
						,	"Cn4 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 3"
						,	"Dn4 5"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 6"
						,	"Rst 2"
						]
					}

				// refrain iter 1
				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 480} // into 16ths
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.5}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.25}
					}

				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 2"
						,	"Gn4 2"
						,	"Fn4 2"
						,	"An4 1"
						,	"Gn4 3"
						,	"Fn4 2"
						,	"En4 2"
						,	"Gn4 1"
						,	"Fn4 3"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En4 2"
						,	"Dn4 2"
						,	"Fn4 1"
						,	"En4 3"
						,	"Dn4 2"
						,	"Cs4 2"
						,	"An3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf3 2"
						,	"Cn4 2"
						,	"Dn4 2"
						,	"Fn4 2"
						,	"Gn4 2"
						,	"An4 2"
						,	"Cn4 2"
						,	"Dn4 1"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 1.0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Cn4 13"
						,	"Cs4 4"
						]
					}

				// refrain iter 2
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.5}
					}

				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 2"
						,	"Gn4 2"
						,	"Fn4 2"
						,	"An4 1"
						,	"Gn4 3"
						,	"Fn4 2"
						,	"En4 2"
						,	"Gn4 1"
						,	"Fn4 3"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En4 2"
						,	"Dn4 2"
						,	"Fn4 1"
						,	"En4 3"
						,	"Dn4 2"
						,	"Cs4 2"
						,	"An3 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf3 2"
						,	"Cn4 2"
						,	"Dn4 2"
						,	"Fn4 2"
						,	"Gn4 2"
						,	"An4 2"
						,	"Dn4 2"
						,	"Cn4 1"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 1.0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 13"
						]
					}

				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 240} // (back) into 16ths
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.675}
					}

				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 1"
						,	"An3 1"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -35, "times": 1}
					}


				]
		,	"sin":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "end": 1.0, "dur": 0}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.15}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.375}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 5}
					}
				// offset
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 0.25"
						]
					}
				// 4&
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 1"
						,	"An3 1"
						]
					}

				// verse line 1
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "end": 1.0, "dur": 0}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.15}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.375}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 5"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bn4 1"
						,	"Gn4 5"
						,	"Dn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn4 5"
						,	"Fn4 1"
						,	"Gn4 1"
						,	"Fn4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En4 2"
						,	"Dn4 2"
						,	"Cn4 2"
						,	"En4 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 3"
						,	"An3 5"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An3 6"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "end": 1.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 1"
						,	"Dn4 1"
						]
					}

				// verse line 2
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 5"
						,	"Fn4 1"
						,	"Dn4 1"
						,	"An4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bn4 1"
						,	"Gn4 5"
						,	"Fn4 1"
						,	"En4 1"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Fn4 2"
						,	"Fn4 1"
						,	"Gn4 2"
						,	"An4 3"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn4 2"
						,	"Fn4 2"
						,	"En4 2"
						,	"Cn4 2"
						]
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"An4 3"
						,	"Dn4 5"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Dn4 6"
						,	"Rst 1.75" // back in sync
						]
					}

				// refrain iter 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.25}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.25}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 0.5, "dur": 0.25}
					}
				,	{"command": "notes", 
						"data": [
							"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Rst 2"
						,	"Gn2 2"
						,	"Rst 1"
						,	"Fn3 1" // Fn3 - hi tom
						,	"Cs3 1" // Cs3 - mid tom
						,	"Gn2 1" // Gn2 - low tom
						]
					}

				// refrain iter 2
				,	{"command": "notes", 
						"data": [
							"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Rst 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 2"

						,	"Fn3 3" // Fn3 - hi tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 1" // Gn2 - low tom
						]
					}

				// offset
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 0.25"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -28, "times": 1}
					}
				]
		}
	};
