"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 12                            */
/* Og Sananab!                                         */
/* (monkey village)                                    */
/* (c) Sean Kelly, 2016                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["Og Sananab!"] = {
		"chip": "oneofeach"
	,	"bpm": 560 // beats per minute; 140 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": 0.25, "end": 1.0, "dur": 0}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.025}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 5}
					}

				// Intro

				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"

						,	"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						]
					}

				// A
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						]
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -4, "times": 3}
					}


				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 2"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						]
					}
				,	{"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": [
							"Rst 2"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -4, "times": 3}
					}

				// B

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": [
							"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						]
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.75}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Rst 2"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -4, "times": 5}
					}


				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						]
					}
				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 1"
						,	"Cs5 1"
						,	"Rst 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}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						]
					}
				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Gs4 1"
						,	"Rst 1"
						,	"Rst 2"
						]
					}

				,	{"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": -29, "times": 1}
					}

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

				// Intro

				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En2 2"
						,	"En2 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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En2 2"
						,	"En2 2"
						]
					}
				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En2 4"
						,	"En2 4"
						,	"En2 4"
						]
					}

				// A
				,	{"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": [
							"An2 4"
						,	"En2 2"
						,	"En2 2"
						,	"An2 4"
						,	"En2 2"
						,	"En2 2"

						,	"An2 2"
						,	"An2 2"
						,	"En2 2"
						,	"An2 4"
						,	"En2 2"
						,	"En2 2"
						,	"En2 2"


						,	"An2 4"
						,	"En2 2"
						,	"En2 2"
						,	"An2 4"
						,	"En2 2"
						,	"En2 2"

						,	"An2 2"
						,	"An2 2"
						,	"En2 2"
						,	"An2 2"
						,	"An3 4"
						,	"En2 4"
						]
					}

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

				// B

				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En2 4"
						,	"Rst 4"
						,	"En2 4"

						,	"Rst 4"
						,	"En2 4"
						,	"Rst 4"
						,	"En2 4"

						,	"Dn2 8"
						,	"Dn2 8"

						,	"An2 4"
						,	"An2 4"
						,	"An2 4"
						,	"An2 4"


						,	"Rst 4"
						,	"En2 4"
						,	"Rst 4"
						,	"En2 4"

						,	"Rst 4"
						,	"En2 4"
						,	"Rst 4"
						,	"En2 4"

						,	"Dn2 4"
						,	"Dn2 4"
						,	"Dn2 4"
						,	"Dn2 4"

						,	"Bn2 4"
						,	"Bn1 4"
						,	"Bn2 4"
						,	"Bn1 4"

						,	"Bn2 4"
						,	"Bn2 4"
						,	"En2 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": -5, "times": 1}
					}

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

				// Intro

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

						,	"En4 1"
						,	"En4 2"
						,	"Gn4 1"
						,	"Gf4 2"
						,	"Fn4 2"
						,	"En4 2"
						,	"En5 2"
						,	"En4 4"
						]
					}

				// A
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.25, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.075}
					}
				// I picked up this phrase from a whale on NPR.
				// No joke.
				// I did have to adapt it a little bit, but
				// I never imagined it would turn out to be about monkeys...
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"En4 4"
						,	"Fn4 4"
						,	"Gf4 4"
						,	"Fn4 4"

						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 4"
						,	"An4 4"

						,	"En4 4"
						,	"En4 2"
						,	"Fn4 2"
						,	"Gf4 2"
						,	"Fn4 2"
						,	"En4 4"

						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 4"
						,	"En4 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": [
							"Fn4 4"
						,	"Gf4 4"
						,	"Fn4 4"
						,	"Df5 2"
						,	"Dn5 2"

						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 4"
						,	"An4 4"
						,	"En4 4"

						,	"En4 2"
						,	"Fn4 2"
						,	"Gf4 2"
						,	"Fn4 2"
						,	"En4 4"
						,	"Df5 2"
						,	"Dn5 2"

						,	"Df5 2"
						,	"Dn5 2"
						,	"Df5 4"
						,	"An4 8"
						]
					}

				// B

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.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": [
							"Gf4 8"
						,	"Fn4 8"
						,	"En4 8"
						,	"Ef4 8"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.125}
					}
				,	{"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": [
							"Dn4 2"
						,	"Gf4 1"
						,	"Dn4 1"
						,	"Gf4 2"
						,	"Cn5 2"
						,	"Ef5 1"
						,	"Cn5 1"
						,	"Gn4 2"
						,	"Dn4 2"
						,	"Bn3 2"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"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": [
							"En4 3"
						,	"Rst 1"
						,	"Fn4 3"
						,	"Rst 1"
						,	"Gf4 3"
						,	"Rst 1"
						,	"Cs4 3"
						,	"Rst 1"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.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": [
							"Gf4 8"
						,	"Fn4 8"
						,	"En4 8"
						,	"Ef4 8"

						,	"Dn4 3"
						,	"Ef4 3"
						,	"En4 2"
						]
					}
				,	{"command": "vol", // set overall volume of channel
						"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": [		
							"Fn4 3"
						,	"Gf4 3"
						,	"Gn4 2"						
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.25, "dur": 0}
					}
				,	{"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": [
							"Af4 4"
						,	"Rst 2"						
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.75, "end": 1.0, "dur": 0}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from DEF_CHIPTUNE_PITCHES) and L is the length in beats or fractions (can be multiple characters as long as parseFloat will take it)
						"data": [
							"Gn4 2"
						,	"Af4 2"
						,	"Rst 4"						
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.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": [
							"Gn4 2"						
						]
					}

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

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.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": [
							"Af4 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": -30, "times": 1}
					}

				]
		,	"sin":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "end": 1.0, "dur": 0.0}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 0.9, "end": 1.0, "dur": 0.1}
					}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.1}
					}

				// Intro

				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En5 2"
						,	"En5 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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En5 2"
						,	"En5 2"
						]
					}

				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"
						,	"Rst 6"
						]
					}

				// A
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.075}
					}
				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "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": 0.9, "end": 1.0, "dur": 0.1}
					}
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -4, "times": 2}
					}

				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 2"
						,	"Cs5 2"
						,	"Rst 6"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 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": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 2"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -4, "times": 2}
					}

				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				,	{"command": "notes", // strings of the form "NnO L" where NnO is the Note-modifier-Octave note to play (from 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"
						,	"Cs5 2"
						,	"Cs5 2"
						,	"Cs5 2"
						,	"Rst 6"
						]
					}

				// B
				,	{"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": "env", // set linear ramp envelope applied to every 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 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 2"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 2"

						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 2"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 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": [
							"Rst 2"
						,	"Af4 1"
						,	"Dn4 1"
						,	"Rst 2"
						,	"Af4 1"
						,	"Dn4 1"
						,	"Rst 2"
						,	"Af4 1"
						,	"Dn4 1"
						,	"Rst 2"
						,	"Af4 1"
						,	"Dn4 1"

						,	"Rst 2"
						,	"Gf4 1"
						,	"En4 1"
						,	"Rst 2"
						,	"Gf4 1"
						,	"En4 1"
						,	"Rst 2"
						,	"Gf4 1"
						,	"En4 1"
						,	"Rst 2"
						,	"Gf4 1"
						,	"En4 1"
						]
					}

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

						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 2"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 1"
						,	"Af4 1"
						,	"An4 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": [
							"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						,	"Rst 2"
						,	"An4 1"
						,	"Af4 1"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 0.5, "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": 0.9, "end": 1.0, "dur": 0.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 2"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"
						,	"En5 2"

						,	"En5 2"
						,	"Rst 6"
						,	"En5 2"
						,	"En5 2"
						]
					}

				,	{"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": -30, "times": 1}
					}

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

				// Intro

				,	{"command": "notes", 
						"data": [
							"Rst 4"
						,	"Cn5 2" //snare
						,	"Gn1 2" //bd
						,	"Rst 4"
						,	"Cn5 2" //snare
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						]
					}

				// A
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.05}
					}
				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Rst 2" 
						,	"Gn6 2" //hat*
						,	"Rst 1"
						,	"Gn1 1" //bd*
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 3"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -1, "times": 1}
					}

				// B
				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						]
					}

				,	{"command": "notes", 
						"data": [
							"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"

						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						]
					}

				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Rst 2"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn1 2" //bd
						]
					}

				,	{"command": "notes", 
						"data": [
							"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd

						,	"Gn1 2" //bd
						,	"Rst 4"
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn1 2" //bd
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"

						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Gn6 1" //hat
						,	"Gn1 2" //bd
						,	"Gn6 1" //hat
						,	"Rst 1"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						,	"Gn5 .25" //clap
						,	"Gs5 1.25"
						,	"Rst .5"
						]
					}

				,	{"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": -8, "times": 1}
					}

				]
		}
	};
