"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 16                            */
/* And Upwards                                         */
/* (mountain top theme)                                */
/* (c) Sean Kelly, 2016                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["And Upwards"] = {
		"chip": "oneofeach"
	,	"bpm": 640 // beats per minute; 160 in 16ths
	,	"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.25}
					}
				,	{"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; 0.1 is a sane "loud" level
						"data": {"level": 0.0625}
					}
				
				//,	{"command": "tempo", // change tempo mid-tune
				//		"data": {"bpm": 120}
				//	}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// in
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						//"data": {"position": 0.25, "travel": 0.5, "dur": 1/(160/4/60), "alternate":true}
						"data": {"position": 0.25, "travel": 0.5, "dur": 1.5, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"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"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"

						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"

						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"

						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 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"
						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"

						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"

						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"
						,	"Bn2 1"

						,	"Cn3 2"
						,	"Gn2 2"
						]
					}

				// A1
				,	{"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": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Gn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 3}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Bf2 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Bf2 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Fn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 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": [
							"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"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": [
							"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 2"
						]
					}

				// A2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Cn3 1"
						,	"Cn3 1"
						,	"Cn3 2"
						,	"Gn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 3}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Bf2 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Bf2 1"
						,	"Bf2 1"
						,	"Bf2 2"
						,	"Fn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 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": [
							"An2 2"
						,	"An2 1"
						,	"An2 1"
						,	"An2 2"
						,	"An2 1"
						,	"An2 1"
						,	"An2 2"
						,	"An2 1"
						,	"An2 1"
						,	"An2 2"
						,	"Fn2 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 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 1"
						,	"Gn2 1"
						,	"Gn2 2"
						,	"Dn3 2"
						]
					}

				// B1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						//"data": {"position": 0.25, "travel": 0.5, "dur": 1/(160/4/60), "alternate":true}
						"data": {"position": 0.25, "travel": 0.5, "dur": 1.5, "alternate":true} // less precise, but easier for SoundEdit JSON
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Ef3 1"
						,	"Af2 1"
						,	"Cn3 1"
						,	"Ef3 1"

						,	"Af3 1"
						,	"Cn3 1"
						,	"Ef3 1"
						,	"Af3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Af3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Af3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Ef3 1"
						,	"Gn2 1"
						,	"Cn3 1"
						,	"Ef3 1"

						,	"Gn3 1"
						,	"Cn3 1"
						,	"Ef3 1"
						,	"Gn3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Gn3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Gn3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Ef3 1"
						,	"Af2 1"
						,	"Cn3 1"
						,	"Ef3 1"

						,	"Af3 1"
						,	"Cn3 1"
						,	"Ef3 1"
						,	"Af3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Af3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Af3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Ef3 1"
						,	"Gn2 1"
						,	"Cn3 1"
						,	"Ef3 1"

						,	"Gn3 1"
						,	"Cn3 1"
						,	"Ef3 1"
						,	"Gn3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Gn3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Gn3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				// B2
				
				,	{"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": [
							"Af3 1"
						,	"Af2 1"
						,	"Cs3 1"
						,	"Ef3 1"

						,	"Af3 1"
						,	"Cs3 1"
						,	"Ef3 1"
						,	"Af3 1"

						,	"Cs4 1"
						,	"Ef3 1"
						,	"Af3 1"
						,	"Cs4 1"

						,	"Ef4 1"
						,	"Cs4 1"
						,	"Af3 1"
						,	"Ef3 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": [
							"Af3 1"
						,	"Af2 1"
						,	"Cs3 1"
						,	"Ef3 1"

						,	"Af3 1"
						,	"Cs3 1"
						,	"Ef3 1"
						,	"Af3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Af3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Af3 1"
						,	"Ef3 1"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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"
						,	"Cn3 1"
						,	"Ef3 1"
						,	"Gn3 1"

						,	"Cn4 1"
						,	"Ef3 1"
						,	"Gn3 1"
						,	"Cn4 1"

						,	"Ef4 1"
						,	"Cn4 1"
						,	"Gn3 1"
						,	"Ef3 1"

						,	"Cn4 1"
						,	"Gn3 1"
						,	"Ef3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Df4 1"
						,	"Df3 1"
						,	"Fn3 1"
						,	"Af3 1"

						,	"Df4 1"
						,	"Fn3 1"
						,	"Af3 1"
						,	"Df4 1"

						,	"Fn4 1"
						,	"Df4 1"
						,	"Af3 1"
						,	"Fn3 1"

						,	"Df4 1"
						,	"Af3 1"
						,	"Fn3 1"
						,	"Df3 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 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": [
							"Fn3 1"
						,	"Bf2 1"
						,	"Dn3 1"
						,	"Fn3 1"

						,	"Bf3 1"
						,	"Dn3 1"
						,	"Fn3 1"
						,	"Bf3 1"

						,	"Dn4 1"
						,	"Fn3 1"
						,	"Bf3 1"
						,	"Dn4 1"

						,	"Fn4 1"
						,	"Dn4 1"
						,	"Bf3 1"
						,	"Fn3 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"
						,	"Gn2 1"
						,	"Bn2 1"
						,	"Dn3 1"

						,	"Fn3 1"
						,	"Bn2 1"
						,	"Dn3 1"
						,	"Fn3 1"

						,	"Bn3 1"
						,	"Dn3 1"
						,	"Fn3 1"
						,	"Bn3 1"

						,	"Dn4 1"
						,	"Bn3 1"
						,	"Fn3 1"
						,	"Dn3 1"
						]
					}

//				// out
//				,	{"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"
//						,	"Gn2 1"
//						,	"Bn2 1"
//						,	"Dn3 1"
//						
//						,	"Fn3 1"
//						,	"Bn2 1"
//						,	"Dn3 1"
//						,	"Fn3 1"
//						
//						,	"Bn3 1"
//						,	"Dn3 1"
//						,	"Fn3 1"
//						,	"Bn3 1"
//						
//						,	"Dn4 1"
//						,	"Bn3 1"
//						,	"Fn3 1"
//						,	"Dn3 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"
//						,	"Bn3 1"
//						,	"Fn3 1"
//						,	"Dn3 1"
//						
//						,	"Dn4 1"
//						,	"Bn3 1"
//						,	"Fn3 1"
//						,	"Dn3 1"
//						
//						,	"Dn4 1"
//						,	"Bn3 1"
//						,	"Fn3 1"
//						,	"Dn3 1"
//						
//						,	"Dn4 1"
//						,	"Bn3 1"
//						,	"Fn3 1"
//						,	"Dn3 1"
//						]
//					}

				]
		,	"tri":	// name of a channel on the chip	
				[
					{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1875}
					}
				//,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
				//		"data": {"cents": 0}
				//	}

				// in
				// tri-tom
				,	{"command": "pan", 
						"data": {"position": 0.675}
					}
				,	{"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.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.125}
					}

				,	{"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 4" // Gn2 - low tom
						,	"Gn2 4"
						,	"Gn2 4"
						,	"Gn2 4"

						,	"Gn2 4"
						,	"Gn2 4"
						,	"Gn2 2"
						,	"Fn3 2" // Fn3 - hi tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 2"
						]
					}
				// A1
				,	{"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 4" // Gn2 - low tom
						,	"Cs3 6" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						]
					}
				,	{"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 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom *
						,	"Gn2 4" // Gn2 - low tom *
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Fn3 2" // Fn3 - hi tom  *
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						]
					}

				// A2
				,	{"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 4" // Gn2 - low tom
						,	"Cs3 6" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						]
					}
				,	{"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 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom *
						,	"Gn2 4" // Gn2 - low tom *
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 2" // Cs3 - mid tom
						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

						,	"Gn2 4" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Gn2 2" // Gn2 - low tom
						,	"Cs3 4" // Cs3 - mid tom

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

				// B1
				// tri-bass
				,	{"command": "pan", 
						"data": {"position": 0.5}
					}
				,	{"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.25, "dur": 2}
					}
				,	{"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": "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": [
							"Af2 16"
						,	"Af2 8"
						,	"Af2 4"
						,	"Af2 4"

						,	"Gn2 16"
						,	"Gn2 8"
						,	"Gn2 4"
						,	"Gn2 4"

						,	"Af2 16"
						,	"Af2 8"
						,	"Af2 4"
						,	"Af2 4"

						,	"Gn2 16"
						,	"Gn2 8"
						,	"Gn2 4"
						,	"Gn2 4"
						]
					}

				// B2
				,	{"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": [
							"Cs2 16" // formerly Fn2
						,	"Cs2 8"
						,	"Cs2 4"
						,	"Cs2 4"

						,	"Ef2 16"
						,	"Ef2 8"
						,	"Ef2 4"
						,	"Ef2 4"

						,	"Gn2 16"
						,	"Gn2 8"
						,	"Gn2 4"
						,	"Gn2 4"

						,	"Bf2 16"
						,	"Gn2 16"
						]
					}

				// out
				// tri-tom
//				,	{"command": "pan", 
//						"data": {"position": 0.675}
//					}
//				,	{"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.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.125}
//					}
//					
//				,	{"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 4" // Fn3 - hi tom
//						,	"Fn3 4" // Fn3 - hi tom
//						,	"Fn3 4" // Fn3 - hi tom
//						,	"Fn3 4" // Fn3 - hi tom
//						
//						,	"Cs3 4" // Cs3 - mid tom
//						,	"Cs3 4" // Cs3 - mid tom
//						,	"Cs3 4" // Cs3 - mid tom
//						,	"Cs3 4" // Cs3 - mid tom
//						]
//					}

				]
		,	"sq":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.25, "dur": 1.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.0625}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.4375}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// in
				,	{"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 16"
						]
					}
				,	{"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 12"
						,	"Fn3 1"
						,	"Gn3 1"
						,	"An3 1"
						,	"Bn3 1"
						]
					}

				// A1
				,	{"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 12"
						,	"Dn4 4"

						,	"En4 6"
						,	"Fn4 6"
						,	"Gn4 4"

						,	"An4 6"
						,	"Bn4 6"
						,	"Cn5 16"

						,	"Dn5 4"

						,	"Bf4 6"
						,	"An4 6"
						,	"Gn4 4"

						,	"Fn4 16"

						,	"Cn5 10"
						,	"Gn4 2"
						,	"Cn5 2"
						,	"Gn4 2"

						,	"Bn4 12"
						,	"Fn3 1"
						,	"Gn3 1"
						,	"An3 1"
						,	"Bn3 1"
						]
					}

				// A2
				,	{"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 12"
						,	"Dn4 4"

						,	"En4 6"
						,	"Fn4 6"
						,	"Gn4 4"

						,	"An4 6"
						,	"Bn4 6"
						,	"Cn5 16"

						,	"Dn5 4"

						,	"Ef5 6"
						,	"Dn5 6"
						,	"Cn5 4"

						,	"Bf4 16"

						,	"Fn5 4"
						,	"Cn5 4"
						,	"An4 4"
						,	"Fn5 4"

						,	"Gn5 12"
						,	"Af4 1"
						,	"Bf4 1"
						,	"Cn5 1"
						,	"Dn5 1"
						]
					}

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

				// B1
				,	{"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": [
							"Ef5 28"
						,	"Fn5 4"

						,	"Gn5 6"
						,	"Ef5 22"

						,	"Af4 1"
						,	"Bf4 1"
						,	"Cn5 1"
						,	"Dn5 1"

						,	"Ef5 22"

						,	"Fn5 6"
						,	"Gn5 4"

						,	"Gn5 24"

						,	"Af5 4"
						,	"Df5 1"
						,	"Ef5 1"
						,	"Fn5 1"
						,	"Gn5 1"
						]
					}
				// B2
				,	{"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": [
							"Af5 28"

						,	"Bf5 4"

						,	"Cn6 24"

						,	"Df6 4"
						,	"Gn5 1"
						,	"Af5 1"
						,	"Bf5 1"
						,	"Cn6 1"

						,	"Df6 12"
						,	"Df5 2"
						,	"Cn5 2"

						,	"Df5 12"
						,	"Df6 2"
						,	"Bf5 2"

						,	"Fn5 8"
						,	"An4 4"
						,	"Bf4 4"

						,	"Bn4 16"
						]
					}

				// out
//				,	{"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 32"
//						]
//					}

				]
		,	"sin":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.25, "dur": 1.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.05}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.625}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 5}
					}

				// in
				,	{"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 16.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": [
							"Rst 12"
						,	"Fn3 1"
						,	"Gn3 1"
						,	"An3 1"
						,	"Bn3 1"
						]
					}

				// A1
				,	{"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 12"
						,	"Dn4 4"

						,	"En4 6"
						,	"Fn4 6"
						,	"Gn4 4"

						,	"An4 6"
						,	"Bn4 6"
						,	"Cn5 16"

						,	"Dn5 4"

						,	"Bf4 6"
						,	"An4 6"
						,	"Gn4 4"

						,	"Fn4 16"

						,	"Cn5 10"
						,	"Gn4 2"
						,	"Cn5 2"
						,	"Gn4 2"

						,	"Bn4 12"
						,	"Fn3 1"
						,	"Gn3 1"
						,	"An3 1"
						,	"Bn3 1"
						]
					}

				// A2
				,	{"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 12"
						,	"Dn4 4"

						,	"En4 6"
						,	"Fn4 6"
						,	"Gn4 4"

						,	"An4 6"
						,	"Bn4 6"
						,	"Cn5 16"

						,	"Dn5 4"

						,	"Ef5 6"
						,	"Dn5 6"
						,	"Cn5 4"

						,	"Bf4 16"

						,	"Fn5 4"
						,	"Cn5 4"
						,	"An4 4"
						,	"Fn5 4"

						,	"Gn5 12"
						,	"Af4 1"
						,	"Bf4 1"
						,	"Cn5 1"
						,	"Dn5 1"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.25, "end": 1.0, "dur": 1.5}
					}

				// B1
				,	{"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": [
							"Ef5 28"
						,	"Fn5 4"

						,	"Gn5 6"
						,	"Ef5 22"

						,	"Af4 1"
						,	"Bf4 1"
						,	"Cn5 1"
						,	"Dn5 1"

						,	"Ef5 22"

						,	"Fn5 6"
						,	"Gn5 4"

						,	"Gn5 24"

						,	"Af5 4"
						,	"Df5 1"
						,	"Ef5 1"
						,	"Fn5 1"
						,	"Gn5 1"
						]
					}
				// B2
				,	{"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": [
							"Af5 28"

						,	"Bf5 4"

						,	"Cn6 24"

						,	"Df6 4"
						,	"Gn5 1"
						,	"Af5 1"
						,	"Bf5 1"
						,	"Cn6 1"

						,	"Df6 12"
						,	"Df5 2"
						,	"Cn5 2"

						,	"Df5 12"
						,	"Df6 2"
						,	"Bf5 2"

						,	"Fn5 8"
						,	"An4 4"
						,	"Bf4 4"

						//,	"Bn4 16"
						,	"Bn4 15.75"
						]
					}

				// out
//				,	{"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 31.75"
//						]
//					}
				]

		,	"nz":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.2, "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.05}
					}
				,	{"command": "pan", 
						"data": {"position": 0.375}
					}
				//,	{"command": "tempo", // change tempo mid-tune
				//		"data": {"bpm": 120}
				//	}
				//,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" cound when 2 similar frequencies overlap)
				//		"data": {"cents": 0}
				//	}

				// in
				,	{"command": "notes", 
						"data": [
							"Rst 32"
						]
					}

				// A1/A2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}

				,	{"command": "notes", 
						"data": [
							"Rst 4"
						,	"Dn6 1" //hat
						,	"Rst 7"
						,	"Dn6 1" //hat
						,	"Rst 3"
						]
					}

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

				,	{"command": "notes", 
						"data": [
							"Rst 4"
						,	"Dn6 4" //hatsplash
						,	"Dn6 4" //hatsplash
						,	"Dn6 4" //hatsplash
						]
					}

				// B1
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}

				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat

						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						]
					}

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

				// B2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}

				,	{"command": "notes", 
						"data": [
							"Dn6 1" //hat
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat

						,	"Dn6 1" //hat
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						]
					}

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

				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat

						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Gn1 2" //bd
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						]
					}

				,	{"command": "notes", 
						"data": [
							"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Dn6 2" //hatsplash
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat

						,	"Dn6 4" //hatsplash
						,	"Dn6 4" //hatsplash
						,	"Dn6 4" //hatsplash
						,	"Dn6 4" //hatsplash
						]
					}

				//out
//				,	{"command": "notes", 
//						"data": [
//							"Rst 32"
//						]
//					}

				]
		}
	};

