"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 18                            */
/* a Breath of Darkness                                */
/* (Malfose lab)                                       */
/* (c) Sean Kelly, 2017                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["a Breath of Darkness"] = {
		"chip": "oneofeach"
	,	"bpm": 360 // beats per minute; 120 in 8th-tuples
	,	"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": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				//,	{"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}
					}

				// Delay

				// 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.0, "travel": 1.0, "dur": 0.398, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bf4 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// 2
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 1.0, "travel": -1.0, "dur": 0.853, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Ef4 1"
						,	"Rst 2"
						//,	"Rst 3"
						]
					}

				// 3
				,	{"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": 0.374, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Af4 1"
						,	"Rst 2"
						,	"Rst 3"
						,	"Rst 3"
						]
					}

				// 4
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75, "travel": -0.5, "dur": 0.597, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bn3 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// Un-Delay
				,	{"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 3"
						]
					}

				// 5
				,	{"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": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.0, "end": 1.0, "dur": 0.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 27"
						]
					}
				,	{"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.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 3"
						]
					}

				//,	{"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": -4, "times": 1}
				//	}
				]
		,	"sq":	// 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": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				//,	{"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}
					}

				// Delay
				,	{"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.75"
						]
					}

				// 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.0, "travel": 1.0, "dur": 0.606, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bf4 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// 2
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 1.0, "travel": -1.0, "dur": 0.696, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Ef4 1"
						,	"Rst 2"
						//,	"Rst 3"
						]
					}

				// 3
				,	{"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": 0.882, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Af4 1"
						,	"Rst 2"
						,	"Rst 3"

						,	"Rst 3"
						]
					}

				// 4
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75, "travel": -0.5, "dur": 0.371, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bn3 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// Un-Delay
				,	{"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.25"
						]
					}

				// 5
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5625}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.0, "end": 1.0, "dur": 0.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": [
							"Bf3 27"
						]
					}
				,	{"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.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": [
							"Bf3 3"
						]
					}

				//,	{"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": -4, "times": 1}
				//	}
				]
		,	"tri":	// 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": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				//,	{"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}
					}

				// Delay
				,	{"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.5"
						]
					}

				// 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.0, "travel": 1.0, "dur": 0.118, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bf4 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// 2
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 1.0, "travel": -1.0, "dur": 0.451, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Ef4 1"
						,	"Rst 2"
						//,	"Rst 3"
						]
					}

				// 3
				,	{"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": 0.989, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Af4 1"
						,	"Rst 2"
						,	"Rst 3"

						,	"Rst 3"
						]
					}

				// 4
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75, "travel": -0.5, "dur": 0.698, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bn3 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// Un-Delay
				,	{"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.5"
						]
					}

				// 5
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.6875}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.0, "end": 1.0, "dur": 0.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": [
							"An2 27"
						]
					}
				,	{"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.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": [
							"An2 9"
						]
					}

				// ???
				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 180}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.15}
					}
				,	{"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": [
							"Ef2 1"
						,	"Ef2 1"
						,	"Rst 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -2, "times": 5}
					}
				]

		,	"sin":	// 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": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				//,	{"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}
					}

				// Delay
				,	{"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.25"
						]
					}
				// 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.0, "travel": 1.0, "dur": 0.544, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bf4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bf4 1"
						,	"Rst 2"
						//,	"Rst 3"
						]
					}

				// 2
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 1.0, "travel": -1.0, "dur": 0.638, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Ef4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Ef4 1"
						,	"Rst 2"
						,	"Rst 3"

						,	"Rst 3"
						]
					}

				// 3
				,	{"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": 0.930, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Af4 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Af4 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// 4
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75, "travel": -0.5, "dur": 0.674, "alternate":true} // less precise, but easier for SoundEdit JSON
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.05}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"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": [
							"Bn3 1"
						]
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0125}
					}
				,	{"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": [
							"Bn3 1"
						,	"Rst 2"
						,	"Rst 3"
						]
					}

				// Un-Delay
				,	{"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.75"
						]
					}

				// 5
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.3125}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.0, "end": 1.0, "dur": 0.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": [
							"Bf2 27"
						]
					}
				,	{"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.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": [
							"Bf2 9"
						]
					}

				// ???
				,	{"command": "tempo", // change tempo mid-tune
						"data": {"bpm": 185} // yes, you are going crazy.
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.15}
					}
				,	{"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": [
							"Ef2 1"
						,	"Ef2 1"
						,	"Rst 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -2, "times": 5}
					}
				]
		}
	};
