"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 03                            */
/* Take On Them!                                       */
/* (invaded backyard / village shrine theme)           */
/* (c) Sean Kelly, 2013                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["Take On Them!"] = {
		"chip": "oneofeach"
	,	"bpm": 360 // beats per minute; 180 quarters in 8ths
	,	"priority": 1 // baseline nonzero for BGM
	,	"songdata" : {
			"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.125, "dur": 0.25}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.08}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": -5}
					}

				// Section A.0

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

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}

				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}

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

				// Section A.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.25, "dur": 0.25}
					}

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						,	"Bf3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Bf2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Bf2 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						,	"Bf3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Ef3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Ef3 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Fn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Fn3 1"
						]
					}


				// Section A.2

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Bn3 1"
						,	"Bn3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Dn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bn3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Dn3 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"An3 1"
						,	"An3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"An2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"An3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"An2 1"
						]
					}


				// Section A.2.5

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Gs3 1"
						,	"Gs3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Gs2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Gs3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Gs2 1"
						]
					}


				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Bn3 1"
						,	"Bn3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Bn2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bn3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Bn2 1"
						]
					}


				// Section B.1, B.2

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

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						,	"Cn3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						,	"Bf3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Bf2 1"
						,	"Bf2 1"
						]
					}

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"An3 1"
						,	"An3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"An2 1"
						,	"An2 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Af3 1"
						,	"Af3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Af2 1"
						,	"Af2 1"
						]
					}

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}

				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						,	"Cn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Cn3 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Cn4 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Cn3 1"
						]
					}

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


				// Section C

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						,	"Bf3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Bf2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Bf3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Bf2 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -8, "times": 1}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Af3 1"
						,	"Af3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Af2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Af3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Af2 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -8, "times": 1}
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Gn3 1"
						,	"Gn3 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Gn2 3"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Gn3 1"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Gn2 1"
						]
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -8, "times": 3}
					}


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

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

				// Section A.0

				,	{"command": "notes", 
						"data": [
							"Rst 64"
						]
					}

				// Section A.1, A.2, A.2.5

				,	{"command": "notes", 
						"data": [
							"En4 8"
						,	"Dn4 8"
						,	"Ef4 8"
						,	"Fn4 8"
						,	"Af4 8"
						,	"Gn4 8"
						,	"En4 8"
						,	"Fn4 8"
						,	"Ef4 8"
						,	"Dn4 8"
						]
					}

				// Section B.1, B.2

				,	{"command": "notes", 
						"data": [
							"Gn4 4"
						,	"Fn4 4"
						,	"Cn4 4"
						,	"Fn4 4"
						,	"En4 16"

						,	"Ef4 4"
						,	"Dn4 4"
						,	"Cn4 4"
						,	"Gs3 4"
						,	"En4 16"
						]
					}

				// Section C

				,	{"command": "notes", 
						"data": [
							"Dn4 16"
						,	"Cn4 16"
						,	"Bn3 32"
						]
					}

				,	{"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}
					}
				]
		,	"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.5, "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.12}
					}
				//,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
				//		"data": {"cents": 0}
				//	}

				// Section A.0

				,	{"command": "notes", 
						"data": [
							"Rst 32"

						,	"Gn4 1"
						,	"Gn4 1"
						,	"Gn4 1"
						,	"Gn4 1"
						,	"Rst 1"
						,	"Gn4 1"
						,	"Rst 1"
						,	"An4 1"

						,	"Rst 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 1"
						,	"An4 1"
						,	"Rst 1"
						,	"An4 2"

						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Bf4 1"
						,	"Rst 1"
						,	"Bf4 1"
						,	"Rst 1"
						,	"Cn5 1"

						,	"Rst 1"
						,	"Cn5 1"
						,	"Rst 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Rst 1"
						]
					}

				// Section A.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.5, "dur": 0.25}
					}

				,	{"command": "notes", 
						"data": [
							"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"

						,	"Bf4 1"
						,	"Bf4 1"
						,	"Cn5 1"
						,	"Dn5 2"
						,	"Bf4 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": 0.5, "dur": 0.5}
					}

				,	{"command": "notes", 
						"data": [
							"Ef5 2"
						,	"Dn5 2"
						,	"Cn5 2"
						,	"Bf4 2"

						,	"Cn5 1"
						,	"Bf4 1"
						,	"Rst 1"
						,	"An4 3"
						,	"Fn4 2"
						]
					}

				// Section A.2

				,	{"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.25}
					}

				,	{"command": "notes", 
						"data": [
							"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"
						,	"Cn5 1"

						,	"Dn5 1"
						,	"Bn4 1"
						,	"Gn4 1"
						,	"Dn5 1"
						,	"Bn4 1"
						,	"Gn4 1"
						,	"Gn5 1"
						,	"Fn5 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.5, "dur": 0}
					}

				,	{"command": "notes", 
						"data": [
							"En5 3"
						,	"Cn5 3"
						,	"Gn4 2"

						,	"Fn5 1.5"
						,	"Fn5 0.5"
						,	"Gn5 0.5"
						,	"Rst 0.5"
						,	"Fn5 1.5"
						,	"Fn5 0.5"
						,	"Gn5 0.5"
						,	"Rst 0.5"
						,	"Fn5 2"
						]
					}

				// Section A.2.5

				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 1.0, "end": 0.5, "dur": 0.5}
					}

				,	{"command": "notes", 
						"data": [
							"Cn5 2"
						,	"Af4 2"
						,	"Cn5 2"
						,	"Ef5 2"
						]
					}

				,	{"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.25}
					}

				,	{"command": "notes", 
						"data": [
							"Dn5 1"
						,	"Gn4 1"
						,	"Cn5 1"
						,	"Dn5 1"
						,	"Gn5 1"
						,	"Dn5 1"
						,	"Bn4 1"
						,	"Fn5 1"
						]
					}

				// Section B.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.5, "dur": 0.5}
					}

				,	{"command": "pan", "data": {"position": 0.6875}}
				,	{"command": "notes", 
						"data": [
							"En5 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.625}}
				,	{"command": "notes", 
						"data": [
							"Dn5 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.5625}}
				,	{"command": "notes", 
						"data": [
							"Cn5 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.5}}
				,	{"command": "notes", 
						"data": [
							"Bf4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.4375}}
				,	{"command": "notes", 
						"data": [
							"An4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.375}}
				,	{"command": "notes", 
						"data": [
							"Gn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.3125}}
				,	{"command": "notes", 
						"data": [
							"Fn4 2"
						]
					}
				,	{"command": "pan", "data": {"position": 0.5}}
				,	{"command": "notes", 
						"data": [
							"Af4 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.8, "end": 1.0, "dur": 0}
					}

				,	{"command": "notes", 
						"data": [
							"Cn5 16"
						]
					}

				// Section B.2

				,	{"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.25}
					}

				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Gn4 0.68"
						,	"Cn5 0.66"
						,	"Ef5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Gn4 0.68"
						,	"Cn5 0.66"
						,	"Ef5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Fn4 0.68"
						,	"Bf4 0.66"
						,	"Dn5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Fn4 0.68"
						,	"Bf4 0.66"
						,	"Dn5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Fn4 0.68"
						,	"An4 0.66"
						,	"Cn5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Fn4 0.68"
						,	"An4 0.66"
						,	"Cn5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.25}}
				,	{"command": "notes", 
						"data": [
							"Ef4 0.68"
						,	"Af4 0.66"
						,	"Cn5 0.66"
						]
					}
				,	{"command": "pan", "data": {"position": 0.75}}
				,	{"command": "notes", 
						"data": [
							"Ef4 0.68"
						,	"Af4 0.66"
						,	"Cn5 0.66"
						]
					}

				,	{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 0.9, "end": 1.0, "dur": 0}
					}
				,	{"command": "pan", "data": {"position": 0.5}}
				,	{"command": "notes", 
						"data": [
							"Cn5 8"
						]
					}

				// Section C (plus 8 beats of B.2)

				,	{"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}
					}
				,	{"command": "notes", 
						"data": [
							"Gn4 24" // serendipity, this
						]
					}
				,	{"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": 0.75, "dur": 0}
					}
				,	{"command": "notes", 
						"data": [
							"Gn4 24" // serendipity, this
						]
					}
				,	{"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": 0.75, "dur": 0}
					}
				,	{"command": "notes", 
						"data": [
							"Gn4 16" // extra 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.25}
					}

				,	{"command": "notes", 
						"data": [
							"Bn3 1"
						,	"Cn4 1"
						,	"Dn4 1"
						,	"En4 1"
						,	"Fn4 1"
						,	"Gn4 1"
						,	"An4 1"
						,	"Bn4 1"
						]
					}

				,	{"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": -60, "times": 1}
					}
				]
		,	"tri":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.25}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 0.5, "dur": 0.25}
					}
				,	{"command": "vol", // set overall volume of channel; 0.1 is a sane "loud" level
						"data": {"level": 0.25}
					}
				//,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
				//		"data": {"cents": 0}
				//	}
				,	{"command": "pan", 
						"data": {"position": 0.4375}
					}

				// Experienced chiptunists will know the triangle channel has a long and glorious history of playing percussion.
				// This is the first track in the OST where I tried it in chiptune.js.  Very nice.

				// Section A.0

				,	{"command": "notes", 
						"data": [
							"Gn2 8" // Gn2 - low tom

						,	"Gn2 5"
						,	"Gn2 3"

						,	"Gn2 8"

						,	"Gn2 8"


						,	"Gn2 3"
						,	"Gn2 4"
						,	"Gn2 2"

						,	"Gn2 3"
						,	"Gn2 1"
						,	"Gn2 3"

						,	"Gn2 3"
						,	"Gn2 4"
						,	"Gn2 2"

						,	"Gn2 3"
						,	"Gn2 1"
						,	"Gn2 3"
						]
					}

				// Section A.1, A.2

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

				,	{"command": "notes", 
						"data": [
							"Gn2 4" // Gn2 - low tom
						,	"Gn2 1"
						,	"Gn2 3"

						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 2"
						,	"Gn2 3"

						,	"Gn2 4" // Gn2 - low tom
						,	"Gn2 1"
						,	"Gn2 3"

						,	"Gn2 1"
						,	"Gn2 2"
						,	"Cs3 2" // Cs3 - mid tom
						,	"Cs3 1"
						,	"Gn2 1"
						,	"Gn2 1"
						]
					}

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

				// Section A.2.5

				,	{"command": "notes", 
						"data": [
							"Gn2 4" // Gn2 - low tom
						,	"Gn2 1"
						,	"Gn2 3"

						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 2"
						,	"Gn2 3"
						]
					}


				// Section B.1

				,	{"command": "notes", 
						"data": [
							"Cs3 1" // Cs3 - mid tom
						,	"Cs3 3"

						,	"Cs3 1"
						,	"Cs3 3"

						,	"Gn2 1" // Gn2 - low tom
						,	"Gn2 3" 

						,	"Gn2 1" 
						,	"Gn2 5"

						,	"Cs3 3" // Cs3 - mid tom
						,	"Gn2 3" // Gn2 - low tom

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

				// Section B.2

				,	{"command": "notes", 
						"data": [
							"Cs3 1" // Cs3 - mid tom
						,	"Cs3 3"

						,	"Cs3 1"
						,	"Cs3 3"

						,	"Gn2 1" // Gn2 - low tom
						,	"Gn2 3" 

						,	"Gn2 1" 
						,	"Gn2 5"

						,	"Cs3 5" // Cs3 - mid tom
						,	"Gn2 5" // Gn2 - low tom

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

				// Section C

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

				,	{"command": "notes", 
						"data": [
							"Gn2 2" // Gn2 - low tom
						,	"Gn2 2"
						,	"Gn2 2"
						,	"Gn2 2"
						]
					}

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

				,	{"command": "notes", 
						"data": [
							"Gn2 4" // Gn2 - low tom
						,	"Gn2 4"

						,	"Gn2 1"
						,	"Gn2 2"
						,	"Gn2 2"
						,	"Gn2 3"
						]
					}

				,	{"command": "jump", // reset the loop counter
						"data": {"reset": true}
					}
				,	{"command": "jump", // go forwards/backwards delta commands if loop counter < times; increase loop counter
						"data": {"delta": -11, "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": 1.0, "dur": 0}
				//	}
				,	{"command": "vol", // set overall volume of channel
						"data": {"level": 0.07}
					}
				,	{"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}
				//	}

				// Section A.0

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

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 2" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 2" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Cn4 1" //snare
						,	"Cn4 1" //snare


						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 2" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 2" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 1"
						]
					}

				// Section A.1, A.2
				/* December 14-15, 2014:
				*writes* ... *listens* ... Bleh.  Too Gundam. *scraps*
				*writes* ... *listens* ... Gah..  Now it's too Kirby! *scraps*
				*writes* ... *listens* ... ehhh... bit too Castlevania...
				*overhauls keys, completely wrecking chord progressions* ... *listens* ... *listens* ...
				*tweaks* ... *listens* ... . . . Awkward, but getting closer.  Really.  Just needs more... more...
				Bubblegum!  Yes!  That's it!
				*writes drumline*
				*listens* ... Still a bit gummy in the center, but I suppose that's to be expected.
				*/


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

				,	{"command": "notes", 
						"data": [
							"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 3"
						,	"Dn6 2" //hat

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 3"
						,	"Dn6 2" //hat

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 3"
						,	"Dn6 2" //hat

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 5"
						]
					}

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

				// Section A.2.5

				,	{"command": "notes", 
						"data": [
							"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 3"
						,	"Dn6 2" //hat

						,	"Rst 2"
						,	"Cn4 1" //snare
						,	"Rst 3"
						,	"Dn6 2" //hat

						]
					}

				// Section B.1

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

						,	"Rst 2"
						,	"Dn6 2" //hat
						,	"Rst 2"
						,	"Dn6 2" //hat

						,	"Dn6 1" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Cn4 1" //snare
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Cn4 1" //snare

						,	"Rst 8"

						]
					}

				// Section B.2

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

						,	"Rst 2"
						,	"Dn6 2" //hat
						,	"Rst 2"
						,	"Dn6 2" //hat

						,	"Dn6 1" //hat
						,	"Cn4 0.5" //snare
						,	"Cn4 0.5" //snare
						,	"Rst 1"
						,	"Dn6 1" //hat
						,	"Cn4 0.5" //snare
						,	"Cn4 0.5" //snare
						,	"Cn4 0.5" //snare
						,	"Cn4 0.5" //snare
						,	"Dn6 2" //hat

						,	"Dn6 1" //hat
						,	"Dn6 1" //hat
						,	"Cn4 0.5" //snare
						,	"Cn4 0.5" //snare
						,	"Dn6 2" //hat
						,	"Rst 3"

						]
					}

				// Section C

				,	{"command": "notes", 
						"data": [
							"Rst 48"

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

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

				]
		}
	};

