"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 25b                           */
/* Seeking the Darkness Within - II - Determination    */
/* (Underdark mid)                                     */
/* (c) Sean Kelly, 2020                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["Seeking the Darkness II"] = {
		"chip": "oneofeach"
	,	"bpm": 480 // beats per minute; 120 in 16ths
	,	"priority": 1 // baseline nonzero for BGM
	,	"songdata" : {
			"st":	// name of a channel on the chip	
				[
					{"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 - need this redundancy for queueing
						"data": {"bpm": 480}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// 1
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0625}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.75, "end": 1.0, "dur": 0.25}
					}
				,	{"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 4"
						,	"Ef3 4"
						,	"Ef3 4"
						,	"Ef3 2"
						,	"En3 2"

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

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

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

				// 2
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.0}
					}
				,	{"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": 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 2"
						,	"Bf2 2"
						,	"Rst 10"
						,	"Af2 2"

						,	"Bf2 2"
						,	"Bf2 2"
						,	"Rst 8"
						]
					}
				,	{"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.5, "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 4"
						]
					}
				,	{"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 2"
						,	"Bf2 2"
						,	"Rst 10"
						,	"Af2 2"

						,	"Bf2 2"
						,	"Bf2 2"
						,	"Rst 8"
						]
					}
				,	{"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.5, "dur": 0.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": [
							"Bf2 4"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.5, "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 32"
						]
					}

				// 3
				,	{"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; 0.1 is a sane "loud" level
						"data": {"level": 0.0625}
					}
				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Ef3 3"
						,	"Fn3 3"
						,	"Gf3 3"
						,	"Fn3 3"
						,	"Ef3 2"
						,	"Df3 2"

						,	"Bn2 16"

						,	"Bf2 16"

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

						,	"Df3 16"

						,	"Df3 16"

						,	"Bf2 3"
						,	"Af3 3"
						,	"Df3 2"
						,	"Bf3 4"
						,	"Dn3 4"
						]
					}
				
				//,	{"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": 3}
				//	}

				
				]
		,	"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 - need this redundancy for queueing
						"data": {"bpm": 480}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": -2}
					}

				// 1
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0625}
					}
				,	{"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"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						]
					}
				,	{"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": [
							"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"

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

				// 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}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.0625}
					}
				,	{"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": "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 2"
						,	"Ef2 2"
						,	"Rst 10"
						,	"Df2 2"

						,	"Ef2 2"
						,	"Ef2 2"
						,	"Rst 8"
						]
					}
				,	{"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.5, "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": [
							"En2 4"
						]
					}
				,	{"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": "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 2"
						,	"Ef2 2"
						,	"Rst 10"
						,	"Df2 2"

						,	"Ef2 2"
						,	"Ef2 2"
						,	"Rst 8"
						]
					}
				,	{"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": "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; 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": [
							"En2 20"

						,	"En2 2"
						,	"En2 2"
						,	"En2 2"
						,	"En2 2"

						,	"En2 2"
						,	"En2 2"
						,	"En2 2"
						,	"En2 2"
						]
					}

				// 3
				,	{"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.5, "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.0375}
					}
				,	{"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": [
							"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"

						,	"Gf3 1"
						,	"Gf3 2"
						,	"Gf3 1"
						,	"Gf3 2"
						,	"Gf3 1"
						,	"Gf3 2"
						,	"Gf3 1"
						,	"Gf3 2"
						,	"Gf3 1"
						,	"Gf3 2"
						,	"Gf3 1"

						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 2"

						,	"Ef4 2"
						,	"Ef4 2"
						,	"Ef4 2"
						,	"Ef4 2"

						,	"Bf4 2"
						,	"Bf4 2"
						,	"Bf4 2"
						,	"Bf4 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": [
							"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"
						,	"Bf3 1"
						,	"Ef4 1"
						,	"Ef3 1"

						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"
						,	"Bn3 2"
						,	"Bn3 1"

						,	"Df4 2"
						,	"Df4 1"
						,	"Df4 2"
						,	"Df4 1"
						,	"Df4 2"
						,	"Df4 1"
						,	"Df4 2"
						,	"Df4 1"
						,	"Df4 2"
						,	"Df4 2"

						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 2"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 2"
						,	"Rst 4"
						]
					}
				
				//,	{"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": 3}
				//	}

				
				]
		,	"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": 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": "tempo", // change tempo mid-tune - need this redundancy for queueing
						"data": {"bpm": 480}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 2}
					}

				// 1
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "vol", // set overall volume of channel; 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": [
							"Rst 64"
						]
					}
				
				,	{"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"

						,	"Ef4 16"

						,	"Af4 12"
						,	"Bn3 4"

						,	"Bf3 3"
						,	"Gf4 3"
						,	"Af3 2"
						,	"Fn4 4"
						,	"Dn4 4"
						]
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf4 16"

						,	"Ef4 16"

						,	"Af4 12"
						,	"Bn3 4"

						,	"Bf3 3"
						,	"Gf4 3"
						,	"Af3 2"
						,	"Fn4 4"
						,	"Dn4 4"
						]
					}

				// 2
				,	{"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": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.75, "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": [
							"Rst 4"
						,	"Bf4 12"

						,	"Rst 4"
						,	"Bf4 12"

						,	"Rst 4"
						,	"Bf4 12"
						
						,	"Rst 4"
						,	"Bf4 12"
						]
					}
				,	{"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": "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 32"
						]
					}

				// 3
				,	{"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; 0.1 is a sane "loud" level
						"data": {"level": 0.125}
					}
				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf5 3"
						,	"Ef5 3"
						,	"Af5 3"
						,	"Bn4 3"
						,	"Bf4 2"
						,	"Fn5 2"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.5, "end": 1.25, "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": [
							"Ef5 12"
						]
					}
				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Ef5 2"
						,	"Fn5 1"
						,	"Gf5 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.5, "end": 1.25, "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": [
							"Af5 12"
						]
					}
				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gf5 2"
						,	"Af5 2"

						,	"Bf5 4"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.5, "end": 1.25, "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": [
							"Fn5 12"
						]
					}


				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Bf5 3"
						,	"Ef5 3"
						,	"Af5 3"
						,	"Bn4 3"
						,	"Bf4 2"
						,	"Fn5 2"
						]
					}
				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.5, "end": 1.25, "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": [
							"En5 12"
						]
					}
				,	{"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.75, "dur": 0.25}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En5 2"
						,	"Gf5 1"
						,	"Af5 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.5, "end": 1.25, "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": [
							"Bf5 12"
						,	"Ef6 4"

						,	"Ef6 8"
						,	"Gn6 8"
						]
					}

				]

		,	"sin":	// name of a channel on the chip	
				[
				{"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.75}
					}
				,	{"command": "tempo", // change tempo mid-tune - need this redundancy for queueing
						"data": {"bpm": 480}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				
				// 1
				,	{"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}
					}
				,	{"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 64"
						,	"Rst 64"
						]
					}
				,	{"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 16"

						,	"Bf4 16"

						,	"Df5 16"

						,	"Bn4 8"
						,	"Bf4 8"
						]
					}

				// 2
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.1}
					}
				,	{"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": "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": [
							"Ef4 4"

						,	"Bf4 2"
						,	"Bn4 1"
						,	"Df5 1"
						,	"Ef5 8"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 3}
					}
				,	{"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.25, "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": [
							"Ef5 32"
						]
					}

				// 3
				,	{"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": 1.0, "dur": 0.0}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.625, "travel": -0.25, "dur": 0.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": [
							"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"

						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"

						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"

						,	"Bf1 2"
						,	"Rst 2"
						,	"Bf1 2"
						,	"Rst 2"
						,	"Bf1 2"
						,	"Rst 2"
						,	"Bf1 2"
						,	"Rst 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": [
							"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"
						,	"Ef2 2"
						,	"Rst 2"

						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"
						,	"Gf2 2"
						,	"Rst 2"

						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"
						,	"Af2 2"
						,	"Rst 2"

						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						,	"Df2 2"
						,	"Rst 2"
						]
					}
				
				]
		}
	};
