"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 17                            */
/* Forged in Steel                                     */
/* (sky shrine theme)                                  */
/* (c) Sean Kelly, 2017                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["Forged in Steel"] = {
		"chip": "oneofeach"
	,	"bpm": 720 // beats per minute; 180 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.5}
					}
				,	{"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.075}
					}
				,	{"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": -2}
					}

					// A1

				,	{"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 2"
						,	"Bf3 2"
						,	"Bf2 2"
						,	"Rst 2"
						,	"Bf2 4"
						,	"Bf2 2"
						]
					}
				,	{"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": [
							"Af2 2"
						,	"Af2 2"
						,	"Af3 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 4"
						,	"Af2 2"
						]
					}
				,	{"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": [
							"Fs2 2"
						,	"Fs2 2"
						,	"Fs3 2"
						,	"Fs2 2"
						,	"Rst 2"
						,	"Fs2 4"
						,	"Fs2 2"
						]
					}
				,	{"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": [
							"Fn2 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Fn2 2"
						,	"Rst 2"
						,	"Fn2 4"
						,	"Fn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				// A2


				,	{"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": [
							"Bf2 2"
						,	"Bf2 2"
						,	"Bf3 2"
						,	"Bf2 2"
						,	"Rst 2"
						,	"Bf2 4"
						,	"Bf2 2"
						]
					}
				,	{"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": [
							"Af2 2"
						,	"Af2 2"
						,	"Af3 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 4"
						,	"Af2 2"
						]
					}
				,	{"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": [
							"Gn2 2"
						,	"Gn2 2"
						,	"Gn3 2"
						,	"Gn2 2"
						,	"Rst 2"
						,	"Gn2 4"
						,	"Gn2 2"
						]
					}
				,	{"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": [
							"Fn2 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Fn2 2"
						,	"Rst 2"
						,	"Fn2 4"
						,	"Fn2 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				// B1

				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1125}
					}
				,	{"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": 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": [
							"Fs1 2"
						,	"Fs2 2"
						,	"Fs3 2"
						,	"Fs2 2"
						,	"Fn3 2"
						,	"Bf2 8"

						,	"Fs1 2"
						,	"Fs3 2"
						,	"Fs2 2"
						,	"Fn3 2"
						,	"Bf2 4"
						,	"Fn2 4"

						,	"Fn1 2"
						,	"Fs3 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Bf2 8"

						,	"Fn1 2"
						,	"Fs3 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Bf2 4"
						,	"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": [
							"En1 4"
						,	"Bf2 4"
						,	"Cn3 2"
						,	"Df3 4"
						,	"Cn3 2"

						,	"Df3 4"
						,	"Ef3 2"
						,	"En3 4"
						,	"Ef3 2"
						,	"Df3 4"

						,	"Fn1 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Fn2 2"
						,	"Ef3 2"
						,	"Df3 4"
						,	"Fn2 2"

						,	"Fn3 4"
						,	"Fn3 4"
						,	"Cn3 2"
						,	"Bf2 2"
						,	"An2 2"
						,	"Fn2 2"
						]
					}

				// 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": [
							"Fs1 2"
						,	"Fs2 2"
						,	"Fs3 2"
						,	"Fs2 2"
						,	"Fn3 2"
						,	"Bf2 8"

						,	"Fs1 2"
						,	"Fs3 2"
						,	"Fs2 2"
						,	"Fn3 2"
						,	"Bf2 4"
						,	"Fn2 4"

						,	"Fn1 2"
						,	"Fs3 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Bf2 8"

						,	"Fn1 2"
						,	"Fs3 2"
						,	"Fn2 2"
						,	"Fn3 2"
						,	"Bf2 4"
						,	"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": [
							"Gn1 2"
						,	"Cn3 2"
						,	"Cs3 4"
						,	"Cs3 2"
						,	"Ef3 4"
						,	"Cs3 2"

						,	"Ef3 4"
						,	"Ef3 2"
						,	"En3 4"
						,	"Ef3 2"
						,	"En3 2"
						,	"Fn3 2"

						,	"Fn1 4"
						,	"Fn3 2"
						,	"Fn2 2"
						,	"Cn3 2"
						,	"Df3 4"
						,	"Ef3 4"

						,	"Fn3 4"
						,	"Gf3 4"
						,	"Af3 6"
						]
					}

				// C1/2

				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.075}
					}
				,	{"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": 1.0, "dur": 0.0}
					}

				,	{"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 1"
						,	"Af2 1"
						,	"Bf2 1"
						,	"Rst 1"
						,	"Bf3 1"
						,	"Af3 1"
						,	"Bf3 1"
						,	"Rst 1"
						,	"Bf2 1"
						,	"Af2 1"
						,	"Bf2 1"
						,	"Rst 1"
						,	"Bf3 1"
						,	"Af3 1"
						,	"Bf3 1"
						,	"Rst 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 14}
					}

				,	{"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": 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 2"
						,	"An2 2"
						,	"An2 2"
						,	"An2 2"
						,	"An2 2"
						,	"Rst 6"
						]
					}


				//,	{"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}
				//	}
				]
		,	"sin":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.5, "dur": 0.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.375}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// 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": [
							"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Ef5 16"
						,	"Ef5 16"
						]
					}

				// 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": [
							"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Fn5 16"
						,	"Fn5 14"
						,	"Fn5 2"

						,	"Bf4 16"
						,	"Cn5 16"
						]
					}

				// B1

				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.0625}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.75, "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": [
							"Fs4 16"
						,	"Fs4 16"

						,	"Fn4 16"
						,	"Fn4 16"

						,	"Ef4 16"
						,	"Ef4 16"

						,	"Fn4 16"
						,	"Fn4 16"
						]
					}

				// 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": [
							"Fs4 16"
						,	"Fs4 16"

						,	"Fn4 16"
						,	"Fn4 16"

						,	"Gn4 16"
						,	"Gn4 16"

						,	"Fn4 16"
						,	"Fn4 16"
						]
					}

				// C1

				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.0625}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "end": 1.0, "dur": 1.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": "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 32"

						,	"Af4 32"

						,	"Df5 32"

						,	"Fs4 32"
						]
					}

				// C2

				,	{"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 32"

						,	"Af4 32"

						,	"Df5 32"

						,	"Cn5 32"
						]
					}

				]
		,	"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.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": 2}
					}
				
				// A1

				
				,	{"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.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": [
							"Bf3 26"
						,	"Cn4 4"
						,	"Df4 28"
						,	"Ef4 4"
						,	"Bf3 28"
						,	"Fn4 4"
						,	"Bf3 18"
						,	"An3 16"
						]
					}

				// A2

				
				,	{"command": "vol", // set overall volume of channel
						"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 26"
						,	"Cn5 4"
						,	"Df5 28"
						,	"Ef5 4"
						,	"Ef5 28"
						,	"Cn5 2"
						,	"Ef5 2"
						,	"Fn5 34"
						]
					}

				// B1-2

				,	{"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": "vol", // set overall volume of channel
						"data": {"level": 0.0375}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.5, "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": [
							"Df5 16"
						,	"Bf4 16"
						,	"Df5 16"
						,	"Bf4 16"
						,	"Cn5 16"
						,	"Bf4 16"
						,	"Df5 16"
						,	"An4 16"

						,	"Df5 16"
						,	"Bf4 16"
						,	"Df5 16"
						,	"Bf4 16"
						,	"En5 16"
						,	"Bf4 16"
						,	"Df5 16"
						,	"Cn5 14"
						]
					}

				// C1

				,	{"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.0625}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.75, "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": [
							"Cn4 2" // catch hand-off from B section bass
						,	"Bf4 16"

						,	"Fn5 4"
						,	"Ef5 2"
						,	"Dn5 4"
						,	"Bf4 6"

						,	"Af4 6"
						,	"Bf4 10"

						,	"Fn5 4"
						,	"Ef5 2"
						,	"Dn5 4"
						,	"Bf4 6"

						,	"Fs4 6"
						,	"Bf4 6"
						,	"Cn5 4"

						,	"Df5 4"
						,	"Cn5 2"
						,	"Bf4 10"

						,	"Ef4 6"
						,	"Fs4 6"
						,	"Bf4 4"
						
						,	"Df5 4"
						,	"Cn5 2"
						,	"Bf4 4"
						,	"Fs4 6"
						]
					}

				// C2

				,	{"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 16"

						,	"Fn5 4"
						,	"Ef5 2"
						,	"Dn5 4"
						,	"Bf4 6"

						,	"Af4 6"
						,	"Bf4 10"

						,	"Fn5 4"
						,	"Ef5 2"
						,	"Dn5 4"
						,	"Bf5 6"

						,	"Ef4 6"
						,	"Bf4 6"
						,	"Cn5 4"
						
						,	"Df5 16"
						,	"Ef5 16"
						,	"Fn5 16"
						]
					}

				]
		,	"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.0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.075}
					}

				// A1
				,	{"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": 60.0/(180/2), "alternate":true}
						"data": {"position": 0.0, "travel": 1.0, "dur": 0.66666667, "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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Bf4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Af4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Af4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Gf4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Gf4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Cn4 1"
						,	"Ef4 1"
						,	"Fn4 1"
						,	"Cn5 1"
						,	"Ef5 1"
						,	"Cn5 1"
						,	"Fn4 1"
						,	"Ef4 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 3}
					}

				// 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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Bf4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Af4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Af4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Df4 1"
						,	"Fn4 1"
						,	"Gn4 1"
						,	"Df5 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Gn4 1"
						,	"Fn4 1"
						]
					}
				,	{"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": [
							"Bf3 1"
						,	"Ef4 1"
						,	"Fn4 1"
						,	"Bf4 1"
						,	"Ef5 1"
						,	"Bf3 1"
						,	"Fn4 1"
						,	"Ef4 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 3}
					}

				// B1

				,	{"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.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": [
							"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"

						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Af3 1"

						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Af3 1"

						,	"Fs3 1"
						,	"Af3 1"
						,	"Bf3 1"
						,	"Df4 1"
						,	"Fs4 1"
						,	"Af4 1"
						,	"Bf4 1"
						,	"Df5 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": [
							"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"

						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"Fn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Fn3 1"

						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"Fn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Fs3 1"

						,	"Fn3 1"
						,	"Fs3 1"
						,	"Bf3 1"
						,	"Df4 1"
						,	"Fn4 1"
						,	"Fs4 1"
						,	"Bf4 1"
						,	"Df5 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": [
							"En5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"En4 1"
						,	"En5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"En4 1"

						,	"En5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"En4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"En3 1"

						,	"En5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"En4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Fs3 1"

						,	"En3 1"
						,	"Fs3 1"
						,	"Bf3 1"
						,	"Df4 1"
						,	"En4 1"
						,	"Fs4 1"
						,	"Bf4 1"
						,	"Df5 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": [
							"Fn5 1"
						,	"Cn5 1"
						,	"Bf4 1"
						,	"Gn4 1"
						,	"Fn4 1"
						,	"Cn4 1"
						,	"Bf3 1"
						,	"Gn3 1"

						,	"Fn3 1"
						,	"Gn3 1"
						,	"Bf3 1"
						,	"Cn4 1"
						,	"Fn4 1"
						,	"Gn4 1"
						,	"Bf4 1"
						,	"Cn5 1"

						,	"Fn3 1"
						,	"An3 1"
						,	"Cn4 1"
						,	"Ef4 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Cn5 1"
						,	"Ef5 1"

						,	"Fn5 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Cn5 1"
						,	"Fn5 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Cn5 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": [
							"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"

						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Af3 1"

						,	"Fs5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Af4 1"
						,	"Fs4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Af3 1"

						,	"Fs3 1"
						,	"Af3 1"
						,	"Bf3 1"
						,	"Df4 1"
						,	"Fs4 1"
						,	"Af4 1"
						,	"Bf4 1"
						,	"Df5 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": [
							"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"
						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fn4 1"

						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"Fn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Fn3 1"

						,	"Fn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Fs4 1"
						,	"Fn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Fs3 1"

						,	"Fn3 1"
						,	"Fs3 1"
						,	"Bf3 1"
						,	"Df4 1"
						,	"Fn4 1"
						,	"Fs4 1"
						,	"Bf4 1"
						,	"Df5 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": [
							"Gn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Gn4 1"
						,	"Gn5 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Gn4 1"

						,	"Df5 1"
						,	"Bf4 1"
						,	"Gn4 1"
						,	"Df4 1"
						,	"Df5 1"
						,	"Bf4 1"
						,	"Gn4 1"
						,	"Df4 1"

						,	"Bf4 1"
						,	"Gn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Bf4 1"
						,	"Gn4 1"
						,	"Df4 1"
						,	"Bf3 1"

						,	"Gn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"Gn3 1"
						,	"Gn4 1"
						,	"Df4 1"
						,	"Bf3 1"
						,	"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": [
							"Fn5 1"
						,	"Cn5 1"
						,	"Ef5 1"
						,	"An4 1"
						,	"Cn5 1"
						,	"Fn4 1"
						,	"An4 1"
						,	"Cn4 1"

						,	"Fn4 1"
						,	"Cn4 1"
						,	"Ef4 1"
						,	"An3 1"
						,	"Cn4 1"
						,	"Fn3 1"
						,	"An3 1"
						,	"Cn3 1"
						// past me, you suck and screwed up the pattern.
						,	"Fn3 1"
						,	"Cn3 1"
						,	"An3 1"
						,	"Fn3 1"
						,	"Cn4 1"
						,	"An3 1"
						,	"Fn4 1"
						,	"Cn4 1"

						,	"An4 1"
						,	"Fn4 1"
						,	"Cn5 1"
						,	"An4 1"
						,	"Ef5 1"
						,	"Cn5 1"
						,	"Fn5 1"
						,	"Ef5 1"
						]
					}

				// C1-2

				,	{"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.75, "travel": -0.5, "dur": 60.0/720, "alternate":true}
						"data": {"position": 0.75, "travel": -0.5, "dur": 0.0833333333333333, "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": [
							"Fn6 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Rst 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Rst 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Rst 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Fn6 1"
						,	"Fn6 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 14}
					}

				,	{"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.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": [
							"Fn5 1"
						,	"Rst 1"
						,	"Fn5 1"
						,	"Rst 1"
						,	"Fn5 1"
						,	"Rst 1"
						,	"Fn5 1"
						,	"Rst 1"
						,	"Fn5 1"
						,	"Rst 3"
						,	"Fn4 4"
						]
					}

				]
		,	"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.0625}
					}
				,	{"command": "pan", 
						"data": {"position": 0.625}
					}
				//,	{"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}
				//	}

				// A1
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "notes", 
						"data": [
							"Gn2 1" //hbd
						,	"En4 1" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 1" //hat
						,	"En4 1" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 13}
					}

				,	{"command": "notes", 
						"data": [
							"Gn2 2" //hbd
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplash
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplash
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplash
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						]
					}

				// A2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "notes", 
						"data": [
							"Gn2 1" //hbd
						,	"En4 1" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 1" //hat
						,	"En4 1" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 13}
					}

				,	{"command": "notes", 
						"data": [
							"Gn2 2" //hbd
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplish
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplash
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Dn6 2" //hatsplash
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						]
					}


				// B1
				,	{"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", 
						"data": [
							"Gn1 4" //bd
						,	"Dn6 1" //hat
						,	"Rst 5"
						,	"Gn1 2" //bd
						,	"Dn6 4" //hatsplash
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 6}
					}

				,	{"command": "notes", 
						"data": [
							"Gn1 4" //bd
						,	"Dn6 1" //hat
						,	"Rst 5"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Dn6 2" //hatsplish
						]
					}

				// B2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "notes", 
						"data": [
							"Gn1 4" //bd
						,	"Dn6 1" //hat
						,	"Rst 5"
						,	"Gn1 2" //bd
						,	"Dn6 4" //hatsplash
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 5}
					}

				,	{"command": "notes", 
						"data": [
							"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Rst 2"

						,	"Dn6 2" //hatsplish
						,	"Gn1 2" //bd
						,	"Dn6 2" //hatsplish
						,	"Gn1 2" //bd
						,	"Dn6 2" //hatsplish
						,	"Gn1 2" //bd
						,	"Dn6 2" //hatsplish
						,	"Gn1 2" //bd
						]
					}

				// C1, C2
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "notes", 
						"data": [
							"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare

						,	"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 2" //snare
						,	"Cn4 2" //snare
						,	"Cn4 2" //snare
						,	"En4 2" //snare
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 6}
					}

				,	{"command": "notes", 
						"data": [
							"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 2" //snare
						,	"Rst 2"
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare

						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 2" //snare
						,	"Cn4 2" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 2" //snare
						,	"Gn1 2" //bd
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						,	"Cn4 1" //snare
						,	"En4 1" //snare
						]
					}

				]

		}
	};
