REBOL [
	Title: "Mini Synthesizer"
	Author: "Ayrris Aunario"
	Email: aaunario@yahoo.com
	Purpose: {Multi-purpose music program with the following features:
			1) a 24-key (2-octave range includes middle C to B) keyboard/synthesizer with visual and audio output
			2) for most basic chords in any given key, outputs the sound of that chord, the formal musical notation, and the corresponding keyboard keys 
  			3) plays "Twinkle Twinkle..." 
	}	
	Date: 22-Sep-2005
	Version: 0.0.3
	File: %minisynth.r
	Library: [
		Level: 'intermediate
		Plugin: [size: 740x540]
		Platform: [win plugin]
		Type: [demo fun]
		Domain: [gui ui user-interface sound vid]
		Tested-under: none
		Support: none
		License: none
		See-also: none
	]
]

sound-port: open sound:// 

trebclefimg: make image! [48x128 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000010101000000010101
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000010101010101000000010101070707000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000050505010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101010101000000000000000000000000
000000000000000000000000000000000000050505000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000010101010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000010101000000
020202000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000060606000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000020202010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101010101000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101020202000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000020202000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000030303000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000030303
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000020202000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000030303010101000000000000000000000000010101
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000010101010101000000000000010101000000000000000000
000000010101010101000000000000000000000000010101000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000010101010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000030303000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000020202000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101060606000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000020202000000
010101020202000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000010101
000000000000010101010101000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
030303010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000010101000000000000000000000000000000000000000000
000000000000000000000000000000020202000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000010101000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000010101000000000000010101020202000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
010101040404000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000010101
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000010101000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000050505000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000020202000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000030303000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000020202000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101020202
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
030303010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101010101000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000001B1B1B000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000
} #{
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFBC93DFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF7412
0032E5FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF6500000000
23E8FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF660000000000006B
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF81
0000000000000008E2FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFCF090000
0000000000006AFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFF8360000000000
000000000AE4FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF970000000000000000
0000006AFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFE118
00000000000000000000
0020F5FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF5E000000
00000000000000000000
C0FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFDA050000000000
00000007000000006AFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF5D0000000000000969
96E9A24300001EFDFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFEF0A
000000000010CBFFFFFF
FFFD400003C2FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFA9010000
000010CEFFFFFFFFFFFF
D0000066FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF51000000000C
CDFFFFFFFFFFFFFFFC2B
003BFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFE3120000000072FFFF
FFFFFFFFFFFFFF63001B
E7FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFCD
000000000CEAFFFFFFFF
FFFFFFFFFF630000D1FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFB90000
000072FFFFFFFFFFFFFF
FFFFFFC60000D4FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF6400000010
E7FFFFFFFFFFFFFFFFFF
FFA10000D4FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF670000004EFFFF
FFFFFFFFFFFFFFFFFF5D
0000D4FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF68000001A5FFFFFFFF
FFFFFFFFFFFFFE3E0000
D4FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF6B
000008EEFFFFFFFFFFFF
FFFFFFFFE2020000D4FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF6230000
34FBFFFFFFFFFFFFFFFF
FFFF6C000000D4FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF30C000066FF
FFFFFFFFFFFFFFFFFFE3
0A000000D1FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF310000092FFFFFF
FFFFFFFFFFFFFF6A0000
001AE7FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F3100000D4FFFFFFFFFF
FFFFFFFFE00800000044
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFF310
0005D0FFFFFFFFFFFFFF
FFFF3B000000003EFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF30E0034
FEFFFFFFFFFFFFFFFF75
000000000034FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFE580038FFFF
FFFFFFFFFFFFE4000000
00000AB6FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF6C0036FFFFFFFF
FFFFFFCB190100000000
15FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF670036FFFFFFFFFFFF
FD310000000000001DF8
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF67
0036FFFFFFFFFFFD4A00
00000000000068FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF5F0037
FFFFFFFFFC4900000000
00000000C8FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFAA0036FFFF
FFFC4900000000000000
004FFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFD40035FFFFFC48
000000000000000002D0
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFC8003BFFDA49000000
0000000000004FFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFE5
191FAC0C000000000000
00000000CFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF3D00
00000000000000000000
0056FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF30000000
000000000000000013F3
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFE448010000000000
000000000000B2FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFD2
24000000000000000000
0000006EFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF9B020000
00000000000000000000
4CFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFB74000000000000
0000000000000024E2FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFB
45000000000000000000
0000000000BFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFC63D0000
00000000000000000000
00009CFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFA3080000000000
000000000000000043C3
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
79000000000000000000
000000000025F7FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFBF0500
00000000000000000000
000149E6FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFC00800000000
00000000000000000035
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFBE0800000000000000
00000000001A1811DDFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFBF08
00000000000000000000
000049F29700D2FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFE507000000
00000000000000000090
FCFF9900ACFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF741000000000000
0000000000009EFFFFFF
A90061FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
7C000000000000000000
000026C8FFFFFFFFF301
60FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFCD0000
00000000000000000028
E7FFFFFFFFFFF10313F7
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF2800000000
00000000000028E8FFFF
FFFFFFFFFD4A00F1FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF7500000000000000
00000029E8FFFFFFFFFF
FFFFFF6200A6FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFDF
04000000000000000000
28E8FFFFFFFFFFFFFFFF
FF8B00A4FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF670000
000000000000002AE9FF
FFFFFFFFFFFFFFFFFFD2
0062FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFDF0900000000
0000000029E9FFFFFFFF
FFFFFFFFFFFFFFCD0230
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF9100000000000000
0028E9FFFFFFFFFFFFFF
FFFFFFFFFFFF2824FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFF5
240000000000000000C1
FFFFFFFFFFFFFFFFFFFF
FFFFFFF733008661399A
9E9EC2F3FFFFFFFFFFFF
FFFFFFFFFFFFFFC20000
00000000000093FFFFFF
FFFFFFFFFFFFFFFFF391
63160400000000000000
001160C9FFFFFFFFFFFF
FFFFFFFFFB2700000000
00000032E7FFFFFFFFFF
FFFFFFFFFF8F1D000000
00000000000000000000
000033ADFFFFFFFFFFFF
FFFFFF14000000000000
10DBFFFFFFFFFFFFFFFF
FFFFAB00000000000000
00000000000000000000
000089FFFFFFFFFFFFFF
D80E00000000000088FF
FFFFFFFFFFFFFFFFFFAB
00000000000000000000
00000000000000000000
0089FFFFFFFFFFFFA900
000000000017F2FFFFFF
FFFFFFFFFFFFAC000000
00000000000000000000
00000000000000000000
87FFFFFFFFFF7C000000
00000089FFFFFFFFFFFF
FFFFFFAA000000000000
00000000000000000000
000000000000000000B5
FFFFFFFF380000000000
14F2FFFFFFFFFFFFFFFF
E7070000000000000000
00000000000000000000
0000000000000019EBFF
FFFF4000000000008AFF
FFFFFFFFFFFFFFFF4400
00000000000000000000
00000000000000000000
0000000000007CFFFFFF
400000000008DBFFFFFF
FFFFFFFFFFBC00000000
00000000000000000029
3D3D0600000000000000
0000000011EFFFFF4000
00000037FFFFFFFFFFFF
FFFFFF5D000000000000
00266FACD3A20054FFFF
DED38337000000000000
0000007AFFFF40000000
008CFFFFFFFFFFFFFFFF
F81600000000000395F9
FFFFFFE00932FFFFFFFF
FFFFAD18000000000000
0028F6FF3A00000008DE
FFFFFFFFFFFFFFFFAF02
0000000003B4FFFFFFFF
FFFF2828FCFFFFFFFFFF
FFEA5A00000000000000
DCFF5A0000000AF0FFFF
FFFFFFFFFFFF9D000000
0005B3FFFFFFFFFFFFFF
3002D1FFFFFFFFFFFFFF
FA1B00000000000097FF
AD00000009EBFFFFFFFF
FFFFFFFFA0000000005E
FFFFFFFFFFFFFFFF8700
D7FFFFFFFFFFFFFFFFBE
0000000000006CFFA600
000009EBFFFFFFFFFFFF
FFFFA000000001DBFFFF
FFFFFFFFFFFF95008EFF
FFFFFFFFFFFFFFFF4600
000000007CFFED130000
09EBFFFFFFFFFFFFFFFF
A000000036FFFFFFFFFF
FFFFFFFFC10066FFFFFF
FFFFFFFFFFFF91000000
000049FEFD1700000AF3
FFFFFFFFFFFFFFFFA000
00006BFFFFFFFFFFFFFF
FFFFF8024CFEFFFFFFFF
FFFFFFFFCE0700000000
10FAFF5D000005C1FFFF
FFFFFFFFFFFF9A000000
63FFFFFFFFFFFFFFFFFF
EF0008FAFFFFFFFFFFFF
FFFFF1040000000018FA
FFB800000092FFFFFFFF
FFFFFFFFDA08000067FF
FFFFFFFFFFFFFFFFFB42
04DEFFFFFFFFFFFFFFFF
FA420000000018FAFFE2
01000064FFFFFFFFFFFF
FFFFFF6800005AFFFFFF
FFFFFFFFFFFFFF62009B
FFFFFFFFFFFFFFFFFF63
0000000066FFFFFF5500
0018F3FFFFFFFFFFFFFF
FFE008000EF6FFFFFFFF
FFFFFFFFFFA900A9FFFF
FFFFFFFFFFFFFF5C0000
000077FFFFFFD7040000
B9FFFFFFFFFFFFFFFFFF
6800019DFFFFFFFFFFFF
FFFFFFCC006EFFFFFFFF
FFFFFFFFFF5C00000000
C6FFFFFFFF56000046FF
FFFFFFFFFFFFFFFFE725
0022FDFFFFFFFFFFFFFF
FFD90B2DFFFFFFFFFFFF
FFFFFF6400000024F8FF
FFFFFFD4010000B5FFFF
FFFFFFFFFFFFFFD00000
8AFFFFFFFFFFFFFFFFFF
2630FFFFFFFFFFFFFFFF
F63300000072FFFFFFFF
FFFF88000019F5FFFFFF
FFFFFFFFFFFF9F1C0095
FFFFFFFFFFFFFFFF250E
DFFFFFFFFFFFFFFFF203
00000EEAFFFFFFFFFFFF
FA4C00003DFFFFFFFFFF
FFFFFFFFFFE333008DFF
FFFFFFFFFFFF6500D4FF
FFFFFFFFFFFFC4050000
73FFFFFFFFFFFFFFFFEC
0D00008CFFFFFFFFFFFF
FFFFFFFFFF7B048BFFFF
FFFFFFFF9C00B1FFFFFF
FFFFFFFF46000012E7FF
FFFFFFFFFFFFFFFFCA0E
00008CFFFFFFFFFFFFFF
FFFFFFFFDDBAFFFFFFFF
FFFFA40065FFFFFFFFFF
FFD80F0000ACFFFFFFFF
FFFFFFFFFFFFFFC91600
007DF4FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F00165FFFFFFFFFFFF3C
000074FFFFFFFFFFFFFF
FFFFFFFFFFFFED4E0000
38DEFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFEF01
18F7FFFFFFFF5F00002C
FAFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFE6A00000A
98FBFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFC4401FC
FFFFFA5D00002DECFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFB62B000029
C2F9FFFFFFFFFFFFFFFF
FFFFFFFFFF5D00D5FFC4
27000065EBFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFEF830E000026
93D9FBFFFFFFFFFFFFFF
FFFFFF97004D4600000F
8AFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFD15400000006
1D6E79D1D6D6D6D6D69A
73620000000555D2FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF7D0800000000
00000000000000000000
00000544FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFDC8C332D2D2D2B
2B2B2B2B2B2C2D2D060C
CBF0FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF201FF7FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF6A00D0FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF9D00CDFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
920075FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFDC00
6BFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF30057FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF62606F6FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF5E00FDFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF6200D5FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFC1
009EFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFBD7234
343483CCFFFFFFFFFFFF
FFFFFFFFFFFFFFC6009C
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFD2420000000000
00007BFFFFFFFFFFFFFF
FFFFFFFFFFD3083EFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
E1140000000000000000
007CFFFFFFFFFFFFFFFF
FFFFFFFF242DFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFF94C00
00000000000000000000
92FFFFFFFFFFFFFFFFFF
FFFF2231FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFCE00000000
000000000000000015EE
FFFFFFFFFFFFFFFFFFFF
242CFDFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFE5C000000000000
000000000000009FFFFF
FFFFFFFFFFFFFFFF2F02
D4FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F60E0000000000000000
00000000009BFFFFFFFF
FFFFFFFFFFFF3100CFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFF614
00000000000000000000
0000009CFFFFFFFFFFFF
FFFFFFFF2C0CDEFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF6140000
00000000000000000000
0095FFFFFFFFFFFFFFFF
FFFF2531FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF61400000000
000000000000000005D5
FFFFFFFFFFFFFFFFFFE3
0C2EFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF60F000000000000
0000000000005EFFFFFF
FFFFFFFFFFFFFF9B0064
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F9230000000000000000
0000003BF0FFFFFFFFFF
FFFFFFFFFF1B05E3FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF9F
00000000000000000000
44F5FFFFFFFFFFFFFFFF
FFFF770066FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFA2000
0000000000001A94FFFF
FFFFFFFFFFFFFFFFFFC1
001FF3FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFC1090000
00006DB6F0FFFFFFFFFF
FFFFFFFFFFFFB80404C0
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFC008000000
7DFFFFFFFFFFFFFFFFFF
FFFFE8680004BFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFC64600000059
CEFFFFFFFFFFFFFFE78A
1E0006C1FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFBE4400000029
5050A6A6504A0700005E
D3FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFBF762C1A0000
0000000C2F84D3FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFEA93939393
93D5FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF
}]


flat: make image! [12x38 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000
} #{
7F7F7FFFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFD0907F7F90E0FFFF
0000003F000000000000
A0FF0000000000000000
000000B0000000001F3F
00000000003F0000002F
F0FF4F00000000000000
00C0FFFFB00000000000
000000FFFFFFA0000000
0000000000FFFFFF5F00
0000004F000000FFFFE0
0000000000C0000000FF
FF4F000000005FFF0000
00FF90000000002FFFFF
000000D00F0000002FF0
FFFF0000001F0000005F
F0FFFFFF000000000000
5FFFFFFFFFFF00000000
0090FFFFFFFFFFFF0000
0000A0FFFFFFFFFFFFFF
000000A0FFFFFFFFFFFF
FFFF0000A0FFFFFFFFFF
FFFFFFFF7FB0FFFFFFFF
FFFFFFFFFFFF
}]
sharp: make image! [14x43 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000
} #{
FFFFFFFFFFFFFFF0C0C0
D0FFFFFFFFFFFFFFFFFF
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
1F5F3FA0FFFF7F00005F
904F00000000007FFFE0
4F000000000000000000
007F1F00000000000000
00000000007F00000000
0000000000000000007F
00000000000000000000
0000007F000000000000
0000000000001FB00000
00000000000000002FE0
FFFF00000000003FB0B0
00003FFFFFFF3F5F3F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00002F907FC0FFFF7F00
007FC05F00000000007F
FFFF5F00000000000000
0000007F5F0F00000000
000000000000007F0000
00000000000000000000
007F0000000000000000
00000000007F00000000
0000000000000000007F
00000000000000000000
1F90D0FF000000000000
3F5F00003FFFFFFF0000
1F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFD03F3F
6FFFFFFFFFFF7F00007F
FFFFFFFFFFFFFFFFFFFF
C07F7FC0FFFFFFFFFFFF
FFFF
}]

showingchords?: false
chordnotes: copy []
chords: ["Major" "Minor" "Seventh" "Minor Seventh" "Major Seventh"]
chordkeyinds: [[5 8] [4 8] [5 8 11] [4 8 11] [5 8 12]]  
rootind: 1
selchordind: 1
roots: ["C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab" "A" "Bb" "B" "C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab" "A" "Bb" "B"]
oct-roots: copy/part roots 12
snotes: copy []
play?: false
afreq: 440
st-ratio: 2 ** (1 / 12)
tone-length: .5 
inc: 10
keys: [C1 Cs1 D1 Eb1 E1 F1 Fs1 G1 Ab1 A1 Bb1 Bb C2 Cs2 D2 Eb2 E2 F2 Fs2 G2 Ab2 A2 Bb2 B2]  
keyboardkeys: "q2w3er5t6y7ucfvgbnjmk,l."
 
sample: make sound [ 
	rate: 44100 / 2
	channels: 1 
	bits: 8
	volume: 0.5 
	data: #{} 
]

make-pitch: func [pitchfreq time samprate numchan /local numsamps numcycles pitchdata] [ 
	pitchdata: copy #{}
	numsamps: numchan * samprate / pitchfreq	
	repeat sampcount (round/floor samprate * time)[
			x: sampcount * 360 / numsamps
			append pitchdata to-char val: 128 + round 127 * sine x
	]

	pitchdata
] 

wholenoteplot: [pen black]

repeat i 15[
	append wholenoteplot compose [ 
		circle 15x7 (11 - round 0.4 * i) (7 - to-integer 0.1 * i) 
	]
]

acc_face: make face [
	offset:  
	size: 
	edge: none
	effect: [merge]
	show?: false
] 

snface: make face [
	offset: 
	size: 30x14 
	edge: none 
	color: none
	effect: [draw wholenoteplot]
]

key: make face [
	size: 
	edge: make edge [
		color: 0.0.0
		size: 1x1
	]
	staffnote: 
	accidental: none
	white?: 
	indplace: 
	offset: 
	color: 
	tone: 
	make-sound: func [p][
		clear sample/data
		sample/data: make-pitch p tone-length (sample/rate) (sample/channels)
		insert sound-port sample
	]
		
	playnote: does [
		color: yellow
		staffnote/show?: true
		if white? = 0 [accidental/show?: true]
		show output-panel
		make-sound tone 
		wait sound-port
		reset
		show output-panel
 	]

	reset: does [
		color: white * white?
		staffnote/show?: false
		if white? = 0 [accidental/show?: false]
	]
	feel: make feel[
		engage: func [face action event][
			if action = 'down [
				face/playnote
			]
		]
	]	
]

trebleclef: make face[
	size: trebclefimg/size
	offset: 5x50
	color: none
 	edge: none 
	image: trebclefimg
	effect: [merge]	
]

staff: make face [
	size: 300x200
	offset: 400x1
	color: beige
	edge: make edge [
		color: black
		size: 2x2
	]
	plotline: copy []
	
	repeat i 9[
		append plotline 'line 
		either ((abs (i - 5)) > 2) [c: 1][c: 0]
		repeat j 2[
			repeat k 2[
				y: 14 * i + 28 + j - 1
				b: mod (k + j) 2
				append plotline as-pair (-1 ** b * c * 140 + (300 * b)) y 
			]
		]
	]
	

	effect: [draw plotline]
	pane: snotes
]


initkeys: has [xpos ind w? tempimg pntemp black_keys prevnoteflat?][
	black_keys: copy []
	temp: copy []
	xpos: 0
	w?: 1
	prevnoteflat?: false
	snypos: 141

	foreach k keys [
		ind: index? find keys k
		either (length? to-string k) > 2 [
			w?: 0
			either find pick roots ind to-char "#" [
				snydec: 0
				tempimg: sharp
				prevnoteflat?: false
			][
				snydec: 7
				tempimg: flat
				prevnoteflat?: true
			]	
		][
			either prevnoteflat? [snydec: 0][snydec: 7]
			prevnoteflat?: false
			w?: 1
		]
		snypos: snypos - snydec
		set k make key [	
			size: 20x100 + (w? * 10x100)
			offset: as-pair (xpos) (1) 
			color: white * w?
			if w? = 0 [
				append snotes accidental: make acc_face [
					size: tempimg/size 
					offset: either prevnoteflat? [
						as-pair 120 (snypos + 21 - tempimg/size/y)
					][
						as-pair 100 (snypos - to-integer 0.5 * (tempimg/size/y - 14))		
					]   
					image: tempimg 
				]
			]
			white?: w?
			append snotes staffnote: make snface [offset: as-pair 135 snypos show?: false]
			indplace: ind
			tone: st-ratio ** (ind - 10) * afreq
		]
		
		
		either any [(mod ind 12) = 0  (mod ind 12) = 5][
			xpos: 5 * w? + inc * 2 + xpos 	
		][
			xpos: 5 * w? + inc + xpos  
		]
		either w? = 0 [append black_keys k][append temp k]
	]
	append snotes trebleclef
	foreach b black_keys [append temp b]
	temp
]

keyboard: make face [
	size: 500x200
	offset: 0x0
	edge: none
	pane: initkeys			
]

output-panel: make face [
	size: 700x200 
	offset: 0x0
	edge: none
	pane: [keyboard staff]
]

picknotes: has [key tempblockpitch pitchsampcount tempdata pitches tempind keyinds][
	showingchords: true
	clear chordnotes
	pitches: copy []
	keyinds: copy []

	append/only pitches make-pitch (get in (get pick keys rootind) 'tone) (2 * tone-length) (sample/rate) (sample/channels)
	append chordnotes pick roots rootind 
	append keyinds rootind
	key: get pick keys rootind
	do in key 'playnote
	foreach ind (pick chordkeyinds selchordind) [ 
		append keyinds tempind: rootind - 1 + ind 
		key: get pick keys tempind
		do in key 'playnote
		append/only pitches make-pitch (get in key 'tone) (2 * tone-length) (sample/rate) (sample/channels)
		append chordnotes pick roots tempind
	]
	
	clear sample/data
	
	repeat i (length? pitches/1) [
		tempdata: 0
		repeat j (length? pitches)[
				tempdata: tempdata + (pick (pick pitches j) i)	
		]
		append sample/data to-char tempdata / (length? pitches)
	]  
	
	foreach k keyinds [
		key: get pick keys k
		set in key 'color yellow	   
		set in (get in key 'staffnote) 'show? true
		if (get in key 'white?) = 0 [set in (get in key 'accidental) 'show? true]
	]
	show output-panel
	insert sound-port sample
	wait sound-port
	foreach k keyinds [
		key: get pick keys k
		do in key 'reset
	]
	showingchords?: false
]
	
input-panel: make face [
	size: 700x300
	offset: 0x200
	edge: make edge [
		color: 0.0.0
		size: 1x1
	]
	pane: layout [
			across
			choice data oct-roots [if not showingchords? [rootind: index? find roots value picknotes t/text: form chordnotes show window] ]
			choice data chords [if not showingchords? [selchordind: index? find chords value picknotes t/text: form chordnotes show window]] with [offset: 10x10]
			h3 "Notes of the chord:"
			t: field form chordnotes  
			return
			below
			pad 180
			across		
			button "Play Sample" [play?: true play-song]
			button "Stop Sample" [play?: false]
	]
]


song: [	1 1 2	
		8 1 2
		10 1 2
		8 2 1
		6 1 2
		5 1 2
		3 1 2
		1 2 1
		8 1 2
		6 1 2
		5 1 2
		3 2 1
		8 1 2
		6 1 2
		5 1 2
		3 2 1
		1 1 2	
		8 1 2
		10 1 2
		8 2 1
		6 1 2
		5 1 2
		3 1 2
		1 2 1]	 
play-song: does [
	foreach [no le times] song [
		if not play? [break]
		tone-length: le * .5
		k: get pick keys no
		loop times [
			k/playnote
			wait 0.05
		]
	]
]		
		


		
	
view/new window: layout [
	window-box: box 700x500 feel [
		engage: func [face action event /local ind][
			if action = 'key [
				if find keyboardkeys to-char event/key [
					ind: index? find keyboardkeys to-char event/key
					do in (get pick keys ind) 'playnote
					show face
				]
			]
		]
	]
	with [
		pane: [input-panel output-panel]	
	]
]
	
focus window-box
do-events
close sound-port