"use strict";

/* --------------------------------------------------- */
/* SkyDragon Story track 09                            */
/* a Tea Party with Death and Cookies                  */
/* (Paola's theme)                                     */
/* (c) Sean Kelly, 2014                                */
/* --------------------------------------------------- */
DATA_CHIPTUNES["a Tea Party with Death and Cookies"] = {
		"chip": "oneofeach"
	,	"bpm": 260 // beats per minute; 130 in 8ths
	,	"priority": 1 // baseline nonzero for BGM
	,	"songdata" : {
			"st":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.25}
					}
				,	{"command": "sweep", // set linear frequency sweep applied to every note (start and end multiply base note frequency)
						"data": {"start": 1.0, "end": 1.0, "dur": 0}
					}
				,	{"command": "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.5}
					}
				//,	{"command": "tempo", // change tempo mid-tune
				//		"data": {"bpm": 120}
				//	}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": -10}
					}

				// ring 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 0.1" // delay
						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"Gn5 2"
						,	"Gn5 1"
						,	"En5 3"
						]
					}

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

						,	"Fn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Dn5 2"
						,	"Dn5 1"
						
						,	"Fn5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"En5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 3"
						]
					}

				// ring 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": [
							"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 2"
						,	"An5 1"

						,	"Gn5 2"
						,	"Gn5 1"
						,	"En5 3"
						]
					}

				// death 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": [
							"Fn5 3"
						,	"En5 3"

						,	"Fn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Dn5 2"
						,	"Dn5 1"
						
						,	"Fn5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"En5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 3"
						]
					}

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

				// spider 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": [
							"Dn5 2"
						,	"En5 1"
						,	"Fn5 2"
						,	"Gn5 1"

						,	"An5 3"
						,	"An5 3"
						
						,	"Gn5 1"
						,	"Bf5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"

						,	"Dn5 3"
						,	"An4 3"
						]
					}

				// spider 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": [
							"Cn5 2"
						,	"Dn5 1"
						,	"En5 2"
						,	"Fn5 1"

						,	"Gn5 3"
						,	"En5 2"
						,	"Gn5 1"
						
						,	"Fn5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"

						,	"En5 3"
						,	"Gn5 3"
						]
					}

				// mice funeral
				,	{"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": [
							"Cn6 2"
						,	"Cn6 1"
						,	"Bn5 2"
						,	"Bn5 1"

						,	"An5 3"
						,	"Gn5 3"
						
						,	"Cn6 2"
						,	"Cn6 1"
						,	"Bf5 2"
						,	"Bf5 1"

						,	"Af5 3"
						,	"Gn5 3"


						,	"Gn5 3"
						,	"Gn5 2"
						,	"Gn5 1"

						,	"Gn5 3"
						,	"Gn5 3"

						,	"Gn5 6"
						,	"Rst 5.9" // resync
						]
					}

				]
		,	"tri":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.625}
					}
				,	{"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.075}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.375}
					}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// ring 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 0.35" // delay
						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"Gn5 2"
						,	"Gn5 1"
						,	"En5 3"
						]
					}

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

						,	"Fn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Dn5 2"
						,	"Dn5 1"
						
						,	"Fn5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"En5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 3"
						]
					}

				// ring 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": [
							"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 3"

						,	"Gn5 3"
						,	"En5 2"
						,	"An5 1"

						,	"Gn5 2"
						,	"Gn5 1"
						,	"En5 3"
						]
					}

				// death 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": [
							"Fn5 3"
						,	"En5 3"

						,	"Fn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Dn5 2"
						,	"Dn5 1"
						
						,	"Fn5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"
						,	"Cn5 1"

						,	"En5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 3"
						]
					}

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

				// spider 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": [
							"Dn5 2"
						,	"En5 1"
						,	"Fn5 2"
						,	"Gn5 1"

						,	"An5 3"
						,	"An5 3"
						
						,	"Gn5 1"
						,	"Bf5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"

						,	"Dn5 3"
						,	"An4 3"
						]
					}

				// spider 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": [
							"Cn5 2"
						,	"Dn5 1"
						,	"En5 2"
						,	"Fn5 1"

						,	"Gn5 3"
						,	"En5 2"
						,	"Gn5 1"
						
						,	"Fn5 1"
						,	"An5 1"
						,	"Gn5 1"
						,	"Fn5 1"
						,	"En5 1"
						,	"Dn5 1"

						,	"En5 3"
						,	"Gn5 3"
						]
					}

				// mice funeral
				,	{"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": [
							"Cn6 2"
						,	"Cn6 1"
						,	"Bn5 2"
						,	"Bn5 1"

						,	"An5 3"
						,	"Gn5 3"
						
						,	"Cn6 2"
						,	"Cn6 1"
						,	"Bf5 2"
						,	"Bf5 1"

						,	"Af5 3"
						,	"Gn5 3"


						,	"Gn5 3"
						,	"Gn5 2"
						,	"Gn5 1"

						,	"Gn5 3"
						,	"Gn5 3"

						,	"Gn5 6"
						,	"Rst 5.65" // resync
						]
					}
				]
		,	"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.375}
					}
				,	{"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.0625}
					}
				,	{"command": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.5}
					}
				//,	{"command": "tempo", // change tempo mid-tune
				//		"data": {"bpm": 120}
				//	}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": -10}
					}

				// ring 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": [
							"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"
						]
					}

				// death 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": [
							"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Cn5 3"
						,	"An4 3"
						
						,	"Dn5 3"
						,	"Cn5 3"

						,	"An4 3"
						,	"Fn4 3"
						]
					}

				// ring 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": [
							"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"
						]
					}

				// death 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": [
							"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Dn5 2"
						,	"Fn4 1"
						,	"Fn4 3"

						,	"Cn5 3"
						,	"An4 3"
						
						,	"Dn5 3"
						,	"Cn5 3"

						,	"An4 3"
						,	"Fn4 3"
						]
					}

				// break
				,	{"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": [
							"An4 2"
						,	"Fn4 1"
						,	"Fn4 3"
						]
					}

				// spider 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": [
							"An4 3"
						,	"An4 3"

						,	"Dn5 2"
						,	"An4 1"
						,	"Dn5 2"
						,	"An4 1"

						,	"En5 3"
						,	"An4 3"

						,	"An4 2"
						,	"Dn5 1"
						,	"Dn5 3"
						]
					}

				// spider 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": [
							"Gn4 3"
						,	"Cn5 3"

						,	"Cn5 4"
						,	"Cn5 2"

						,	"Dn5 3"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"En5 1"
						,	"En5 3"
						]
					}

				// mice funeral
				,	{"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": [
							"Cn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Cn5 3"
						
						,	"Cn5 3"
						,	"Dn5 3"

						,	"Ef5 2"
						,	"Cn5 1"
						,	"Cn5 3"


						,	"Dn5 3"
						,	"Ef5 3"

						,	"Dn5 3"
						,	"Bf4 3"

						,	"Dn5 3"
						,	"Ef5 2"
						,	"Ef5 1"

						,	"Dn5 3"
						,	"Bf4 3"
						]
					}
				
				]
		,	"sin":	// name of a channel on the chip	
				[
					{"command": "env", // set linear ramp envelope applied to every note; dur is measured in seconds, 0 means length of current note
						"data": {"start": 1.0, "end": 0.0, "dur": 0.625}
					}
				,	{"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": "pan", // linearly-divided fraction of the audio going to the right channel, with the remainder going to the left
						"data": {"position": 0.625}
					}
				//,	{"command": "tempo", // change tempo mid-tune
				//		"data": {"bpm": 120}
				//	}
				,	{"command": "detune", // detune in cents to be applied to the oscillator (for "richer" sound when 2 similar frequencies overlap)
						"data": {"cents": 0}
					}

				// ring 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 0.25" // delay
						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"
						]
					}

				// death 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": [
							"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Cn5 3"
						,	"An4 3"
						
						,	"Dn5 3"
						,	"Cn5 3"

						,	"An4 3"
						,	"Fn4 3"
						]
					}

				// ring 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": [
							"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"Gn4 1"
						,	"Gn4 3"
						]
					}

				// death 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": [
							"Dn5 2"
						,	"An4 1"
						,	"An4 3"

						,	"Dn5 2"
						,	"Fn4 1"
						,	"Fn4 3"

						,	"Cn5 3"
						,	"An4 3"
						
						,	"Dn5 3"
						,	"Cn5 3"

						,	"An4 3"
						,	"Fn4 3"
						]
					}

				// break
				,	{"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": [
							"An4 2"
						,	"Fn4 1"
						,	"Fn4 3"
						]
					}

				// spider 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": [
							"An4 3"
						,	"An4 3"

						,	"Dn5 2"
						,	"An4 1"
						,	"Dn5 2"
						,	"An4 1"

						,	"En5 3"
						,	"An4 3"

						,	"An4 2"
						,	"Dn5 1"
						,	"Dn5 3"
						]
					}

				// spider 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": [
							"Gn4 3"
						,	"Cn5 3"

						,	"Cn5 4"
						,	"Cn5 2"

						,	"Dn5 3"
						,	"Gn4 3"

						,	"Cn5 2"
						,	"En5 1"
						,	"En5 3"
						]
					}

				// mice funeral
				,	{"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": [
							"Cn5 3"
						,	"Dn5 3"

						,	"En5 2"
						,	"Cn5 1"
						,	"Cn5 3"
						
						,	"Cn5 3"
						,	"Dn5 3"

						,	"Ef5 2"
						,	"Cn5 1"
						,	"Cn5 3"


						,	"Dn5 3"
						,	"Ef5 3"

						,	"Dn5 3"
						,	"Bf4 3"

						,	"Dn5 3"
						,	"Ef5 2"
						,	"Ef5 1"

						,	"Dn5 3"
						,	"Bf4 2.75" // resync
						]
					}
				
				]
		}
	};