{"action":"created","issue":{"url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/79","labels_url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/79/comments","events_url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/79/events","html_url":"https://github.com/mantaraya36/CsoundQt/issues/79","id":110885074,"number":79,"title":"[Bug] OSCsend unreliable with QuteCsound [sf#79]","user":{"login":"mantaraya36","id":437703,"avatar_url":"https://avatars.githubusercontent.com/u/437703?v=3","gravatar_id":"","url":"https://api.github.com/users/mantaraya36","html_url":"https://github.com/mantaraya36","followers_url":"https://api.github.com/users/mantaraya36/followers","following_url":"https://api.github.com/users/mantaraya36/following{/other_user}","gists_url":"https://api.github.com/users/mantaraya36/gists{/gist_id}","starred_url":"https://api.github.com/users/mantaraya36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantaraya36/subscriptions","organizations_url":"https://api.github.com/users/mantaraya36/orgs","repos_url":"https://api.github.com/users/mantaraya36/repos","events_url":"https://api.github.com/users/mantaraya36/events{/privacy}","received_events_url":"https://api.github.com/users/mantaraya36/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-11T21:56:17Z","updated_at":"2015-10-11T22:06:26Z","closed_at":"2015-10-11T22:06:24Z","body":"**Reported by loucohen on 2010-10-17 13:28 UTC**\nI'm using QCS to respond to a wiimote controller via OSCulator. My csd reads OSC messages with no difficulty. However, when I send OSC messages to the wiimote \\(using OSCsend\\) they work sometimes but not consistently. The same code, during the same run may work at first and then fail to send messages. \r\n\r\nWhen I run the same csd under terminal it works fine. When I run it with MacCsound it also works as expected. Therefore I have to conclude that the problem is with QuteCsound.\r\n\r\nI tried uploading my entire project yesterday but apparently my project is too big. I'm uploading the csd only this time. If you need the entire project \\(data and sound files included\\) let me know and I will post it on my site for you.\r\n\r\n-best,\r\nLou\r\n"},"comment":{"url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/comments/147250431","html_url":"https://github.com/mantaraya36/CsoundQt/issues/79#issuecomment-147250431","issue_url":"https://api.github.com/repos/mantaraya36/CsoundQt/issues/79","id":147250431,"user":{"login":"mantaraya36","id":437703,"avatar_url":"https://avatars.githubusercontent.com/u/437703?v=3","gravatar_id":"","url":"https://api.github.com/users/mantaraya36","html_url":"https://github.com/mantaraya36","followers_url":"https://api.github.com/users/mantaraya36/followers","following_url":"https://api.github.com/users/mantaraya36/following{/other_user}","gists_url":"https://api.github.com/users/mantaraya36/gists{/gist_id}","starred_url":"https://api.github.com/users/mantaraya36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantaraya36/subscriptions","organizations_url":"https://api.github.com/users/mantaraya36/orgs","repos_url":"https://api.github.com/users/mantaraya36/repos","events_url":"https://api.github.com/users/mantaraya36/events{/privacy}","received_events_url":"https://api.github.com/users/mantaraya36/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T22:06:26Z","updated_at":"2015-10-11T22:06:26Z","body":"**Commented by loucohen on 2010-10-17 13:28 UTC**\n\nAttached file wiimoteplayer_17.csd:\n\n    <CsoundSynthesizer>\n    <CsOptions>\n    -o/Volumes/A_G5Int1TB/Documents1/Lou's compositions/symphonyII_2010/rawsound.aif\n    </CsOptions>\n    <CsInstruments>\n    \n    /***************************************************\n    \n    Improviser using wiimote as controller.\n    \n    v03: 7/4/10: reorganized code so that an instrument will play a single sound \n    \tand send it on to a final instrument\n    \tthat mixes multiple sounds together.\n    v03: 7/12/10: introduced pitch containment by finding nearest pitch in a \n    \tstored temperament table - done for some instruments\n    v04: 7/30/10: rearranged patches; refined master volume control; \n    \tadded feature to restrict sensitivity\n    v06: 8/19/10: added fast master volume control change (instr 51); \n    \tadded equal temperament table\n    v07: 8/25/10: added new type of sound (instr 71); \n    \tadded autosequencing function (instr 500) invoked by button in widget panel;\n    \tslowed down reading of accel data from wiimote, results in more user control\n    v08: 8/30/10: added sound which modifies hz and amplitude of partials; \n    \talso removed control of reverb time to free up \"UP/DOWN\" buttons\n    v09: 8/31/10: added support for nunchuk; refined pitch mapping for samples; modified instr 16\n    \tto play two samples out of phase (previously phase = 0 for both)\n    v10: 9/3/10: added taking input and reporting nunchk values and using nunchk to\n    \taugment existing patches.\n    v11: 9/8/10: added ability for NUNCHUK to start a copy of the current patch (in most cases)\n    \tand to take roll and pitch signals from NUNCHUK for the copy - hence two independent voices.\n    \tAlso added response of \"-\" button following \"mute\" (due to \"home\" button.) In this case, \n    \tis restored NOT to saved value but to a very low value. \n    v14: 9/20/10: divided patches into groups. First patch # of each group is stored in a zak k-array.\n    \tThe NUNCHUK C-button advances current patch to the start of the next patch group, using the zak k-array\n    \tas a guide.\n    v15: 10/5/10: began to standardize on this interface: \n    \t\t* within some patches, the wiimote B-button spawns a new note with fixed hz, based on wiimote ROLL\n    \t\t* once the note has started, its amplitude is controlled by wiimote PITCH\n    \t\t* NUNCHUK joystick Y controls amplitude LFO\n    \t\t* NUNCHUK joystick X controls pitchbend\n    \t\t* NUNCHUK roll and pitch can control various things, such as amplitude of some of the started notes, or\n    \t\t  distortion of all notes\n    v16: 10/12/10: applied ideas of v15 to patches using instr 10\n    \tRewrote OSC message access in order to empty the incoming buffer of messages each time we ask for a message.\n    \tSee opcode \"getosc\"\n    ***************************************************/\n    sr\t\t=      \t44100\t;samples per second for sound\n    kr = 441; 100\n    nchnls\t=\t1\n    0dbfs\t=\t1\n    giport\t\t\tOSCinit\t9000;set up for listening to wiimote\n    gkpitchval\t\tinit\t0\n    gkrollval\t\tinit 0\n    gkyawval\t\t\tinit 0\n    gkaccelval\t\tinit 0\n    gkncpitchval\t\tinit\t0\n    gkncrollval\t\tinit\t0\n    gkncyawval\t\tinit\t0\n    gkncaccelval\t\tinit\t0\n    gkncjoyX\t\t\tinit\t0\n    gkncjoyY\t\t\tinit\t0\n    gkhighfreq\t\tinit\t2000\n    gklowfreq\t\tinit\t0.5\n    gk1freq\t\t\tinit\t200\n    gk2freq\t\t\tinit\t200\n    gk3freq\t\t\tinit\t200\n    gkpitchvalmaxdef\t\tinit\t1\n    gkpitchvalmindef\t\tinit\t0\t\n    gkpitchvalmax\t\t\tinit\t1\n    gkpitchvalmin\t\t\tinit\t0\t\n    gkrollvalmaxdef\t\tinit\t1\n    gkrollvalmindef\t\tinit\t0\t\n    gkrollvalmax\t\t\tinit\t1\n    gkrollvalmin\t\t\tinit\t0\n    gkyawvalmaxdef\t\tinit\t1\n    gkyawvalmindef\t\tinit\t0\t\n    gkyawvalmax\t\t\tinit\t1\n    gkyawvalmin\t\t\tinit\t0\t\n    gksamplehzlow\tinit\t0.0035\t;useful limit for low hz, playing back a sample\n    gksamplehzhi\tinit\t15\t;useful limit for low hz, playing back a sample\n    gkhighamp\t\tinit\t1\n    gklowamp\t\t\tinit 0.001\n    gkbuttonBmax\tinit\t17\n    gkbuttonBval\tinit\t0\n    gkrevtime\t\tinit\t0.1\n    gkpatch\t\t\tinit\t0\n    gkhighestpatch\tinit\t27\n    gkpatchsave\t\tinit 19\n    gkmaster\t\t\tinit\t0\n    gkpitchtable\tinit\t299\t;identifies current table to use for restricting pitches to a given temperament\n    gkpitchtabledefault\tinit\t299\t;if table number out of range, use no table\n    gkpitchtablemin\t\tinit\t300\n    gkpitchtablemax\t\tinit\t305\n    ;count of consecutive presses of UP button - gets reset if user presses DOWN\n    gkUPcount\t\tinit\t0\t;\n    ;count of consecutive presses of DOWN button - gets reset if user presses UP\n    gkDOWNcount\t\tinit\t0\t;count of consecutive presses of DOWN button\n    ;count of consecutive presses of UP and DOWN button - never reset\n    gkUPDOWNcount\tinit\t0\t;count uses UP/DOWN arrows on a continuum\n    gkpartialhzvary\tinit\t1\t;flipflop used by instr 85\n    /*\n    Note regarding wiimote LEDs:\n    The four LEDs represent a binary number, read left to right (low order to high order), \n    \tinstead of the usual right to left (lowest order digit on the right.) Thus, sending 5 to the wiimote\n    \tresults in the lights looking like 1010 instead of the expected 0101. So we will use the following table\n    \tto force the lights to resemble conventional binary numbers:\n    \t0000\t0\n    \t0001\t8\n    \t0010\t4\n    \t0011\t12\n    \t0100\t2\n    \t0101\t10\n    \t0110\t6\n    \t0111\t14\n    \t1000\t1\n    \t1001\t9\n    \t1010\t5\n    \t1011\t13\n    \t1100\t3\n    \t1101\t11\n    \t1110\t7\n    \t1111\t15\n    */\n    \tgiLED0000\tinit\t0\n    \tgiLED0001\tinit\t8\n    \tgiLED0010\tinit\t4\n    \tgiLED0011\tinit\t12\n    \tgiLED0100\tinit\t2\n    \tgiLED0101\tinit\t10\n    \tgiLED0110\tinit\t6\n    \tgiLED0111\tinit\t14\n    \tgiLED1000\tinit\t1\n    \tgiLED1001\tinit\t9\n    \tgiLED1010\tinit\t5\n    \tgiLED1011\tinit\t13\n    \tgiLED1100\tinit\t3\n    \tgiLED1101\tinit\t11\n    \tgiLED1110\tinit\t7\n    \tgiLED1111\tinit\t15\n    \tgiLEDcurrent\tinit\t0\n    \t\t\t\t\tzakinit\t16, 32\t;define array of a-rate and k-rate variables\n    ;--------------------------------------------------------------------------\n    opcode\t\t\t\tfindentry,\tk,kk\t;finds nearest table entry to the input value\n    ktestvalue, ktable\txin\t;get input value, table number\n    \tif(ktable<gkpitchtablemin || gkpitchtablemax<ktable)then\n    \t\tkreturn\t= ktestvalue\n    \t\tkfound\t=\t1\n    \t\tkgoto returnvalue\n    \tendif\n    kentrycount\ttablekt 0, ktable\n    ;printk2 kentrycount,5\n    kindex\t= 2\n    kfound\t= 0\n    kreturn\t= ktestvalue\n    loop:\n    \tif(kfound == 1) then\n    \t\tkgoto returnvalue\n    \tendif\n    \tif(kindex>kentrycount+1) then\n    \t\tkfound = 1\n    \tendif\n    \t\tkcurrent\ttablekt\tkindex, ktable\n    /*if(kindex<20)then\n    \tprintk 1, kindex\n    \tprintk 1, kcurrent,5\n    endif\n    */\n    \t\tknext\t\ttablekt\tkindex+1, ktable\n    \tif(kcurrent<=ktestvalue && ktestvalue<knext) then\n    \t\tkreturn = kcurrent\n    \t\tkfound = 1\n    \tendif\n    \tif( ( ( (kcurrent<=ktestvalue) && (ktestvalue<knext) ) ? 1:0) == 0 ) then\n    \t\tkindex = kindex+1\n    \t\tkgoto loop\n    \tendif\n    returnvalue:\n    ;\tprintk 1,kreturn,10\n    \txout\tkreturn \n    ;printk 1,99999\n    ;printk 1,kindex\n    ;printk 1,kreturn\n    endop\n    \n    ;---------------------------------------------------------------------------\n    ;casts a note number (in a linear scale) to Hz (or any geometric scale)\n    ;syntax:\n    ;kpitch\t\t\t\tnotenumbertopitch\t\tknotenumber\n    ;input values from 1 to 120 map to an output range of 14 - 16000 approximately\n    ;special useful values: \tnote 144 \tmaps to 66976\n    ;\t\t\t\t\t\tnote 131.5 \tmaps to 32534.7\n    ; \t\t\t\t\t\tnote 132 \tmaps to 33488\n    ;\t\t\t\t\t\tnote 120 \tmaps to 16744\n    ;\t\t\t\t\t\tnote 1 \t\tmaps to 17.32\n    ;\t\t\t\t\t\tnote 0 \t\tmaps to 16.35\n    ;\t\t\t\t\t\tnote -1 \t\tmaps to 15.43\n    ;\t\t\t\t\t\tnote -48.3763165715204 maps to 1.0\n    ;\t\t\t\t\t\tnote -49 \tmaps to 0.96 (first whole number mapping to less than 1)\n    ;\t\t\t\t\t\tnote -100 \tmaps to 0.05\n    ; \n    opcode\t\t\t\tnotenumbertopitch,\tk,k\t;casts a note number (in a linear scale) to Hz (or any geometric scale)\n    kNoteNumber\t\t\txin\n    ktoneCoefficient\t\t=\t\t16.35159784\t\t;base freq of note 0 (a=440 is note 57)\n    krootOfTwo\t\t\t=\t\t1.059463094\t\t;twelth root of 2\n    kpitch\t\t\t\t=\t\tktoneCoefficient * (krootOfTwo ^ kNoteNumber)\n    \t\t\t\t\txout\t\tkpitch\n    \t\t\t\t\tendop\n    ;----------------------------------------------------------------------------\n    ;casts pitch in Hz (or any geometric scale) onto a note number scale where it can be handled with linear calculations.\n    ;See inverse function, notenumbertopitch for useful guidepost values.\n    ;syntax:\n    ;knotenumber\t\t\tpitchtonotenumber\t\tkpitch\n    opcode\t\t\t\tpitchtonotenumber, k,k ;casts geometric scale (such as Hz) onto note=number scale for linear calcs.\n    kpitch\t\t\t\txin\n    klogtoneCoefficient\t=\t\t2.79432562\t\t;base freq of note 0 (a=440 is note 57)\n    klogrootOfTwo\t\t=\t\t0.05776226471\t\t;log of twelth root of 2\n    kNoteNumber\t\t\t=\t\t(log(kpitch) - klogtoneCoefficient) /(klogrootOfTwo)\n    \t\t\t\t\txout\t\tkNoteNumber\n    \t\t\t\t\tendop\n    ;----------------------------------------------------------------------------\n    ;traces a straight line from ky0 to ky1 at time kt,\n    ; over a period from kt0 to kt1\n    ;syntax: \n    ;ky\t\t\t\t\tlinearinterpolate\t\tky1, ky0, kt1, kt0, kt\n    opcode\t\t\t\tlinearinterpolate, k, kkkkk\t;traces a straight line from ky0 to ky1 at time kt, over a period from kt0 to kt1\n    \tky1, ky0, kt1, kt0, kt xin\n    \tkslope\t\t\t\t=\t\t(ky1 - ky0)/(kt1-kt0)\n    \tkintercept\t\t\t=\t\tky0 - (kslope * kt0)\n    \tky\t\t\t\t\t\t=\t\t(kslope * kt) + kintercept\n    \txout\t\t\t\t\t\t\tky\n    endop\n    ;----------------------------------------------------------------------\n    ;maps a value x in a specified linear range (linrangehigh, linrangelow) \n    ; to a value y in a specified exponential range (exprangehigh, exprangelow)\n    ;syntax:\n    ;y\t\t\t\t\texpinterpolate\t exprangehigh, exprangelow, linrangehigh, linrangelow, x\n    opcode\t\t\t\texpinterpolate,\tk,kkkkk ;maps value from linear range to exponential range\n    \tkexprangehigh, kexprangelow, klinrangehigh, klinrangelow, kx xin\n    \tkfinal\t\t\t\tpitchtonotenumber\tkexprangehigh\n    \tkstart\t\t\t\tpitchtonotenumber\tkexprangelow\n    \tkmapped\t\t\t\tlinearinterpolate\tkfinal, kstart, klinrangehigh, klinrangelow, kx\n    \tky\t\t\t\t\tnotenumbertopitch\tkmapped\n    \txout\t\t\t\tky\n    endop\n    \n    opcode\t\t\tcountupdown,\tkk,kkk\n    \tkcurrentcount, kcountlimit, kdirection\txin\n    \tkcurrentcount = kcurrentcount + kdirection \t;kdirection should be -1 or +1\n    \tif(kcurrentcount>kcountlimit)then\n    \t\tkcurrentcount\t=\tkcountlimit-1\n    \t\tkdirection\t\t=\t-kdirection\n    \tendif\n    \tif(kcurrentcount<1)then\n    \t\tkcurrentcount\t=\t2\n    \t\tkdirection\t\t=\t-kdirection\n    \tendif\n    \txout\tkcurrentcount, kdirection\n    endop\n    \n    opcode\t\t\trangecrawl, kkkk,kkkkkk\n    /*\n     knewhi, knewlo, kdivisionindex, kdirection\t\t\\\n    \t\t\t\t\trangecrawl\tkhidef, klodef, kcurrent, kdivisionindex, kdivisions, kdirection\n    */\n    \tkhidef, klodef, kcurrent, kdivisionindex, kdivisions, kdirection\txin\n    \tkinc\t\t=\t(khidef - klodef)/kdivisions\t;size of a single division\n    \tkrange\t=\tkdivisionindex * kinc* 0.5\t;current range = [single division] TIMES [index]\n    \tknewhi\t\t=\tkcurrent + (khidef-kcurrent)/kdivisionindex\n    \tknewlo\t\t=\tkcurrent - (kcurrent-klodef)/kdivisionindex\n    \t/*\n    \tprintk 1,7777\n    \tprintk 1,kinc\n    \tprintk 1,krange\n    \tprintk 1, khidef\n    \tprintk 1, klodef\n    \tprintk 1, kcurrent\n    \tprintk 1,kdivisionindex\n    \tprintk 1, kdivisions\n    \tprintk 1, kdirection\n    \t*/\n    \tkdivisionindex, kdirection\tcountupdown\t\tkdivisionindex, kdivisions, kdirection\n    \t/*\n    \tprintk 1,6666\n    \tprintk 1, knewhi\n    \tprintk 1, knewlo\n    \tprintk 1,kdivisionindex\n    \tprintk 1,kdirection\n    \t*/\n    ;\tklimitbreaks\t=\t0\n    \tif(knewhi>khidef)then\n    \t\tknewhi\t=\tkhidef\n    \tendif\n    \tif(knewlo<klodef)then\n    \t\tknewlo\t=\tklodef\n    \tendif\n    \txout\tknewhi, knewlo, kdivisionindex, kdirection\n    endop\n    \t\n    /*oddeven rounds input value to nearest integer (using csound's \"round\"), then \n    \treturns 0 if integer is even, 1 if odd. zero is considered even\t\n    */\n    opcode\toddeven, k,k\n    \tkin\txin\n    \tkdata\t=\tround(kin)\t;make sure we have an integer\n    \tkout\t=\tkdata % 2\t;modulus operator\n    \txout\tkout\n    endop\n    ;----------------------------------------------------------------------\n    opcode\tflip01,\tk,k\t;flips input value from 0 to 1 or vice versa\n    \tkflip\txin\n    \tif(kflip==0)then\n    \t\tkout\t=\t1\n    \tendif\n    \tif(kflip==1)then\n    \t\tkout\t=\t0\n    \tendif\n    \tif(kflip!=0 && kflip!=1)then\n    \t\tkout\t=\t0\t;make sure to return legal value if input not legal\n    \tendif\n    \txout kout\n    endop\n    ;----------------------------------------------------------------------\n    opcode\t\t\trandom3, k,0\t;returns a random -1, 0, or +1\n    \tkrand\t\trandom\t0,1\n    \tif(krand<(1/3))then\n    \t\tkout\t=\t-1\n    \tendif\n    \tif((1/3)<=krand && krand<(2/3))then\n    \t\tkout\t=\t0\n    \tendif\n    \tif((2/3)<=krand)then\n    \t\tkout\t=\t1\n    \tendif\n    \txout\tkout\n    endop\n    ;searches zak k-array for a patch number greater then input patch number\n    opcode\t\t\tpatchgroupsearch, kk,kk\t;find patch group starting with patch higher than current patch\n    \tkcurrentpatch, kindexmax\txin\n    \tkzakIndex\t\t=\t0\n    \tsearchloop:\n    \tknextpatch\t\tzkr\tkzakIndex\n    \tif(knextpatch>kcurrentpatch)then\n    \t\tkgoto\tloopover\n    \tendif\n    \tif(knextpatch<=kcurrentpatch)then\n    \t\tkzakIndex\t=\tkzakIndex + 1\n    \t\tif(kzakIndex <= kindexmax)then\n    \t\t\tkgoto\tsearchloop\n    \t\tendif\n    \t\tif(kzakIndex > kindexmax)then\n    \t\t\tknextpatch = 1\t;can't find needed patch group, reset to first patch\n    \t\t\tkgoto\t\tloopover\n    \t\tendif\n    \tendif\n    \tloopover:\n    \txout\tknextpatch,kzakIndex\n    endop\n    ;----------------------------------------------------------------------\n    opcode\t\tgetosc, k,Sk\t;reads OSC message, emptying input buffer\n    Smsg,kvalue\t\txin\n    \t\tkcount\t=\t0\n    \t\tgetmore:\n    \t\tkk \t\tOSClisten giport, Smsg, \"f\",   kvalue\n    \t\tif(kk>0)then\n    \t\t\tkcount\t=\tkcount + 1\n    \t\t\tkgoto getmore\n    \t\tendif\n    \t\txout\tkvalue\n    endop\n    ;----------------------------------------------------------------------\n    opcode\t\tmaprange,\tk,kkkkkk\t;maps input value (0-1) to one of the 5 additional input values\n    \tkinput, kr0,kr1,kr2,kr3,kr4\t\txin\n    \tif(kinput<=0.2)then\n    \t\tkoutput\t=\tkr0\n    \tendif\n    \tif(0.2<kinput && kinput<=0.4)then\n    \t\tkoutput\t=\tkr1\n    \tendif\n    \tif(0.4<kinput && kinput<=0.6)then\n    \t\tkoutput\t=\tkr2\n    \tendif\n    \tif(0.6<kinput && kinput<=0.8)then\n    \t\tkoutput\t=\tkr3\n    \tendif\n    \tif(0.8<kinput)then\n    \t\tkoutput\t=\tkr4\n    \tendif\n    \txout\tkoutput\n    endop\n    \n    ;----------------------------------------------------------------------\n    \n    /*\n    Listen to OSC messages being sent from OSCulator, which is reading a wiimote.\n    Buttons are read by only looking at button values infrequently.\n    Acceleration values (pitch, roll, yaw) are read every k-cycle (by instr 2.)\n    */\n    instr 1 ;readbuttons\t;listen for OSC messages relating to wiimote buttons\n    \t;OSCsend 0, \"\", 8000, \"/wii/led/enable\", \"i\", 15\t;light up LEDs to show which patch group we are in\n    \t;OSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 5\t ;light up LEDs to show patch group\n    \tlistentowiimote:\n    \tgkwiimoteON\tinit\t-1 \n    \tgkpingONOFF init 1\n    \tgkinstr11ONOFF init 1\n    \tgkBONGONOFF init 1\n    \tgkLouder\tinit 0\n    \tgkbuttonPlus init 0\n    \tgkbuttonMinus init 0\n    \tgkbuttonRight init 0\n    \tgkbuttonLeft init 0\n    \tgkbuttonUp init 0\n    \tgkbuttonDown init 0\n    \tgkbuttonHome init 0\n    \tgkbutton1 init 0\n    \tgkbutton2 init 0\n    \tgkbuttonB init 0\n    \tgkbuttonA init 0\n    \t\n    \tgkbuttonUP \t\t\tinit 0\n    \tgkbuttonRIGHT \t\tinit 0\n    \tgkbuttonLEFT \t\tinit 0\n    \tgkncbuttonC\t\t\tinit\t0\n    \tgkncbuttonZ\t\t\tinit 0\n    \tgkwiiwaitcount\t\tinit 0\n    \tgkstartduplicatepatch\tinit\t0\n    \tgkwiiwaitcount\t\t=\tgkwiiwaitcount + 1\n    \t;don't look at buttons too often. (If look every k-cycle,\n    \t; the button will be interpreted as pressed repeatedly.)\n    \tgkwiibuttonwaitlimit\tinit\t100\n    \tif(gkwiiwaitcount>gkwiibuttonwaitlimit) then\n    \t\tkmaster\tinvalue \"master\"\n    \t\t;HOME button mutes or unmutes\n    \n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Home\", \"f\", gkbuttonHome\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Plus\", \"f\", gkbuttonPlus\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Minus\", \"f\", gkbuttonMinus\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Right\", \"f\", gkbuttonRight\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Left\", \"f\", gkbuttonLeft\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Up\", \"f\", gkbuttonUp\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/Down\", \"f\", gkbuttonDown\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/1\", \"f\", gkbutton1\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/2\", \"f\", gkbutton2\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/A\", \"f\", gkbuttonA\n    \t\tkk\t\tOSClisten giport, \"/wii/1/button/B\", \"f\", gkbuttonB\n    \t\tkk\t\tOSClisten giport, \"/wii/1/nunchuk/button/C\", \"f\", gkncbuttonC\n    \t\tkk\t\tOSClisten giport, \"/wii/1/nunchuk/button/Z\", \"f\", gkncbuttonZ\n    \t\toutvalue \t\t\t\"buttonHomeval\",gkbuttonHome\n    \t\toutvalue \t\t\t\"button+val\",gkbuttonPlus\n    \t\toutvalue \t\t\t\"button-val\",gkbuttonMinus\n    \t\toutvalue \t\t\t\"buttonRightval\",gkbuttonRight\n    \t\toutvalue \t\t\t\"buttonLeftval\",gkbuttonLeft\n    \t\toutvalue \t\t\t\"buttonUpval\",gkbuttonUp\n    \t\toutvalue \t\t\t\"buttonDownval\",gkbuttonDown\n    \t\toutvalue \t\t\t\"button1val\",gkbutton1\n    \t\toutvalue \t\t\t\"button2val\",gkbutton2\n    \t\toutvalue \t\t\t\"buttonAval\",gkbuttonA\n    \t\toutvalue \t\t\t\"buttonBval\",gkbuttonB\n    \t\toutvalue \t\t\t\"buttonCval\",gkncbuttonC\n    \t\toutvalue \t\t\t\"buttonZval\",gkncbuttonZ\n    \t\thomebutton:\n    \t\tif(gkbuttonHome= = 1)then\n    \t\t\ttestknob:\n    \t\t\tk51active\tactive\t51\n    \t\t\tif(k51active<=0)kgoto turnknob\n    \t\t\tif(k51active>0)then\n    \t\t\t\tturnoff2 51\t, 0, 0\t;abort any current process to turn the knob\n    \t\t\t\tkgoto testknob\n    \t\t\tendif\n    \t\t\tturnknob:\n    \t\t\tevent \"i\", 51, 0, 0.25, 0\t;turn the knob\n    ;\t\t\tgkmastersave\t=\tgkmaster\n    ;\t\t\tgkmaster\t\t\t=\t0\n    \t\tendif\n    \t\tplusbutton:\n    \t\tif(gkbuttonPlus == 1) then\n    \t\t\t;if we're currently playing sound, just boost the sound\n    \t\t\tif(gkmaster>0)then\n    \t\t\t\tgkmaster\t\t=\tgkmaster * 1.2\n    \t\t\t\tgkmastersave\t=\tgkmaster\n    \t\t\tendif\n    \t\t\t;if we're muted, and even the saved value is muted, set sound to low but positive value\n    \t\t\tif(gkmaster<=0.001 && gkmastersave<=0.001)then\n    \t\t\t\tgkmastersave = 0.002\n    \t\t\tendif\n    \t\t\t;if we're muted but previously not muted, restore sound to previous value\n    \t\t\tif(gkmaster<=0.001 && gkmastersave>0.001) then\n    \t\t\t\tturnoff2 51, 0, 0\t;abort any current process to turn the knob\n    \t\t\t\tevent \"i\", 51, 0, 10, gkmastersave\n    \t\t\tendif\n    \t\tendif\n    \t\tminusbutton:\n    \t\tif(gkbuttonMinus == 1) then\n    \t\t\t;if we're currently playing sound, just reducee the sound\n    \t\t\tif(gkmaster>0)then\n    \t\t\t\tgkmaster\t\t\t=\tgkmaster * 0.8\n    \t\t\t\tgkmastersave\t=\tgkmaster\n    \t\t\tendif\n    \t\t\t;if we're muted, and even the saved value is muted, set sound to low but positive value\n    \t\t\tif(gkmaster<=0.001 && gkmastersave<=0.001)then\n    \t\t\t\tgkmastersave = 0.002\n    \t\t\tendif\n    \t\t\t;if we're muted but previously not muted, set sound to a low value\n    \t\t\tif(gkmaster<=0.001 && gkmastersave>0.001) then\n    \t\t\t\tturnoff2 51, 0, 0\t;abort any current process to turn the knob\n    \t\t\t\tevent \"i\", 51, 0, 10, 0.002\n    \t\t\tendif\n    \t\tendif\n    \t\tUpbutton:\n    \t\t;counts consecutive presses of UP (in gkUPcount)\n    \t\tif(gkbuttonUp == 1) then\n    \t\t\tgkUPDOWNcount\t=\tgkUPDOWNcount + 1\n    \t\t\tif(gkDOWNcount>0)then\n    \t\t\t\tgkDOWNcount\t\t=0\t;reset DOWN direction counter\n    \t\t\t\tgkUPcount\t\t=0\t; and UP counter\n    \t\t\tendif\n    \t\t\tif(gkDOWNcount==0)then\n    \t\t\t\tgkUPcount\t=\tgkUPcount + 1\n    \t\t\tendif\n    \t\tendif\n    \t\tDownbutton:\n    \t\t;counts consecutive presses of DOWN (in gkDOWNcount)\n    \t\tif(gkbuttonDown= = 1) then\n    \t\t\tgkUPDOWNcount\t=\tgkUPDOWNcount - 1\n    \t\t\tif(gkUPcount>0)then\n    \t\t\t\tgkDOWNcount\t\t=0\t;reset DOWN direction counter\n    \t\t\t\tgkUPcount\t\t=0\t; and UP counter\n    \t\t\tendif\n    \t\t\tif(gkUPcount==0)then\n    \t\t\t\tgkDOWNcount\t=\tgkDOWNcount + 1\n    \t\t\tendif\n    \t\tendif\n    \t\tRightbutton:\n    \t\tif(gkbuttonRight= = 1) then\n    \t\t\tgkpatch\t=\tgkpatch + 1\n    \t\t\tgkstartduplicatepatch\t=\t0\n    \t\t\tif(gkpatch>gkhighestpatch) then\n    \t\t\t\tgkpatch = 0\n    \t\t\tendif\n    \t\tendif\n    \t\tLeftbutton:\n    \t\tif(gkbuttonLeft= = 1) then\n    \t\t\tgkpatch\t=\tgkpatch - 1\n    \t\t\tgkstartduplicatepatch\t=\t0\n    \t\t\tif(gkpatch<0) then\n    \t\t\t\tgkpatch = gkhighestpatch\n    \t\t\tendif\n    \t\tendif\n    \t\t;change to first patch in the next group of patches\n    \t\tkzakIndex\t\tinit 0\n    \t\tgkzakIndexMax\tinit\t0\n    \t\tCbutton:\n    \t\tif(gkncbuttonC==1)then\n    \t\t\tgkpatch,gkpatchIndex\tpatchgroupsearch\tgkpatch, gkzakIndexMax\n    \t\t\tgkstartduplicatepatch\t=\t0\n    \t\tendif\n    \t\tif(gkbutton2 == 1) then\n    \t\t\tkactive\tactive 501\n    \t\t\tif(kactive == 0)then\n    \t\t\t\tevent \"i\",501,0,3\n    \t\t\tendif\n    \t\tendif\n    \t\tif(gkbutton1 == 1) then\n    \t\t\tgkpitchtable\t= gkpitchtable + 1\n    \t\t\tif(gkpitchtable>gkpitchtablemax)then\n    \t\t\t\tgkpitchtable\t= gkpitchtabledefault-1 ;illegal table number, makes pitch unconstrained\n    \t\t\tendif\n    \t\tendif\n    \t\tBbutton: ;button B pressed increments a counter -- useful for setting modes in any patch\n    \t\tif(gkbuttonB==1)then\n    \t\t\tgkbuttonBval\t=\tgkbuttonBval + 1\n    \t\t\tif(gkbuttonBval>gkbuttonBmax)then\n    \t\t\t\tgkbuttonBval = 0\n    \t\t\tendif\n    \t\t\tgkpartialhzvary\t=\t-gkpartialhzvary\t;flip this flipflop\n    \t\tendif\n    \t\tNUNCHUKZButton: ;NUNCHUK button Z pressed - set global variables to trigger duplicating existing patch\n    \t\tif(gkncbuttonZ==1)then\n    \t\t\tgkstartduplicatepatch\t=\t gkstartduplicatepatch + 1\n    \t\t\t;printk2 gkstartduplicatepatch\n    \t\tendif\n    \t\tAbutton: ;button A pressed\n    \t\tgkbuttonApressed\tinit\t1\t;flip flop used by some instruments\n    \t\tif(gkbuttonA == 1) then\n    \t\t\tgkbuttonApressed\t=\t-gkbuttonApressed\t\t;flipflop (-1 or +1), used by some instruments\n    \t\t\toutvalue \"buttonAval\", gkbuttonApressed\n    \t\tendif\n    \t\n    \t\toutvalue\t\"temptable\", gkpitchtable\n    \t\toutvalue\t\"master\", gkmaster\n    \t\toutvalue\t\"pitchval\", gkpitchval\n    \t\toutvalue\t\"rollval\", gkrollval\n    \t\toutvalue\t\"yawval\", gkyawval\n    \t\toutvalue\t\"ncpitchval\", gkncpitchval\n    \t\toutvalue\t\"ncrollval\", gkncrollval\n    \t\toutvalue\t\"ncyawval\", gkncyawval\n    \t\toutvalue\t\"gkmasterdisplay\", gkmaster\n    \t\toutvalue\t\"gkmastersavedisplay\", gkmastersave\n    \t\toutvalue\t\"upcount\", gkUPcount\n    \t\toutvalue\t\"downcount\", gkDOWNcount\n    \t\toutvalue\t\"updowncount\", gkUPDOWNcount\n    \t\tgkwiiwaitcount\t= 0\n    \tendif\n    \n    endin\n    \n    ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n    /*\n    Continually update wiimote LEDs\n    */\n    instr 2\t;Continually update wiimote LEDs\n    \tktrig\t=\t1\n    \tif(ktrig==1)then\n    \t\t;OSCsend 0, \"\", 8000, \"/wii/led/enable\", \"i\", 15\t;light up LEDs to show patch group\n    \t\tktrig\t=\t0\n    \tendif\t\t\n    \tgkaccelwaitcountmax\tinit\t5\n    \tgkaccelwaitcountmax\tinvalue \"sensitivity\"\n    \tgkaccelwaitcount\t\tinit\t0\n    \t;gkaccelwaitcount\t\t=\t\tgkaccelwaitcount + 1 ;don't increment here, it's already incremented in instr 3\n    \tgkpatchGroupID\t\t\tinit\t0\n    ;\tprintk\t0.5,gkaccelwaitcount\n    ;\tprintk\t0.5,gkaccelwaitcountmax\n    \tkwaitcount init 0\n    \tkwaitcount\t=\tkwaitcount + 1\n    \t/*\n    \t\tgiLED0000\tinit\t0\n    \tgiLED0001\tinit\t8\n    \tgiLED0010\tinit\t4\n    \tgiLED0011\tinit\t12\n    \tgiLED0100\tinit\t2\n    \tgiLED0101\tinit\t10\n    \tgiLED0110\tinit\t6\n    \tgiLED0111\tinit\t14\n    \tgiLED1000\tinit\t1\n    \tgiLED1001\tinit\t9\n    \tgiLED1010\tinit\t5\n    \tgiLED1011\tinit\t13\n    \tgiLED1100\tinit\t3\n    \tgiLED1101\tinit\t11\n    \tgiLED1110\tinit\t7\n    \tgiLED1111\tinit\t15\n    \t*/\n    \tktrig init 0\n    \tkpatchIDsave\tinit\t0\n    \tif(kpatchIDsave != gkpatchGroupID)then\n    \t\tktrig=1\n    \tendif\n    \t;if(ktrig ==1)then\n    \t\tkpatchIDsave\t=\tgkpatchGroupID\n    \t\tktrig\t\t\t\t=\t0\n    \t\tprintk2\tgkpatchGroupID,1\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tprintk 1,0,5\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; 0\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0001)then\n    \t\t\tprintk 1,8,5\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 8; 8\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0010)then\n    \t\t\tprintk 1,4,5\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 4; 4\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0011)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 2; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0100)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t\tif(gkpatchGroupID==giLED0000)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", 0; gkpatchGroupID\t ;light up LEDs to show patch group\n    \t\tendif\n    \t;endif\n    endin\n    ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n    /*\n    Read accel values from OSCulator (which reads wiimote).\n    */\n    instr 3\t;readaccels\t;read OSC messages from wiimote relating to pitch, roll and yaw\n    \tgkaccelwaitcountmax\tinvalue \"sensitivity\"\n    \tgkaccelwaitcount\t\t=\t\tgkaccelwaitcount + 1\n    \t;Don't read wiimote too frequently -- response is too rapid\n    \tif(gkaccelwaitcount>=gkaccelwaitcountmax)then\n    \t\tgkaccelwaitcount\t=\t0\n    \t\tkmsgcount\t=\t0\n    \t\tgetmore:\n    \t\tgkpitchval\t\tgetosc\t\"/wii/1/accel/pry/0\",\tgkpitchval\n    \t\tgkrollval\t\tgetosc\t\"/wii/1/accel/pry/1\",\tgkrollval\n    \t\tgkrollval\t\tgetosc\t\"/wii/1/accel/pry/1\",\tgkrollval\n    \t\tgkyawval\t\t\tgetosc\t\"/wii/1/accel/pry/2\",\tgkyawval\n    \t\tgkaccelval\t\tgetosc\t\"/wii/1/accel/pry/3\",\tgkaccelval\n    \t\tgkncpitchval\tgetosc\t\"/wii/1/nunchuk/accel/pry/0\",\tgkncpitchval\n    \t\tgkncrollval\t\tgetosc\t\"/wii/1/nunchuk/accel/pry/1\",\tgkncrollval\n    \t\tgkncyawval\t\tgetosc\t\"/wii/1/nunchuk/accel/pry/2\",\tgkncyawval\n    \t\tgkncaccelval\tgetosc\t\"/wii/1/nunchuk/accel/pry/3\",\tgkncaccelval\n    \t\tgkncjoyX\t\t\tgetosc\t\"/wii/1/nunchuk/joy/0\",\tgkncjoyX\n    \t\tgkncjoyY\t\t\tgetosc\t\"/wii/1/nunchuk/joy/1\",\tgkncjoyY\n    ;\t\tkk1 \t\tOSClisten giport, \"/wii/1/accel/pry/0\", \"f\",   gkpitchval\n    ;\t\tgkrollval\tgetosc\t\"/wii/1/accel/pry/1\", gkrollval\n    ;\t\t;kk2 \t\tOSClisten giport, \"/wii/1/accel/pry/1\", \"f\",   gkrollval\n    ;\t\tkk3 \t\tOSClisten giport, \"/wii/1/accel/pry/2\", \"f\",   gkyawval\n    ;\t\tkk4 \t\tOSClisten giport, \"/wii/1/accel/pry/3\", \"f\",   gkaccelval\n    ;\t\tkk5 \t\tOSClisten giport, \"/wii/1/nunchuk/accel/pry/0\", \"f\",   gkncpitchval\n    ;\t\tkk6 \t\tOSClisten giport, \"/wii/1/nunchuk/accel/pry/1\", \"f\",   gkncrollval\n    ;\t\tkk7 \t\tOSClisten giport, \"/wii/1/nunchuk/accel/pry/2\", \"f\",   gkncyawval\n    ;\t\tkk8 \t\tOSClisten giport, \"/wii/1/nunchuk/accel/pry/3\", \"f\",   gkncaccelval\n    ;\t\tkk9 \t\tOSClisten giport, \"/wii/1/nunchuk/joy/0\", \"f\",   gkncjoyX\n    ;\t\tkk10 \t\tOSClisten giport, \"/wii/1/nunchuk/joy/1\", \"f\",   gkncjoyY\n    ;\t\tif(kk2>0)then\n    ;\t\t\tprintk 1,kk2\n    ;\t\t\tprintk 1,kmsgcount\n    ;\t\t\tprintk 1,gkrollval\n    ;\t\t\tkmsgcount\t=\tkmsgcount + 1\n    ;\t\t\tkgoto getmore\n    ;\t\tendif\n    ;\t\tprintk 1,kk2,5\n    ;\t\tprintk 1,kmsgcount,5\n    ;\t\tprintk 1,gkrollval,5\n    \t\tgkpitchval\tlinearinterpolate\t\tgkpitchvalmax,gkpitchvalmin,1,0,gkpitchval\n    \t\tgkrollval\tlinearinterpolate\t\tgkrollvalmax,gkrollvalmin,1,0,gkrollval\n    \t\tgkyawval\t\tlinearinterpolate\t\tgkyawvalmax,gkyawvalmin,1,0,gkyawval\n    \t\toutvalue\t\"accelval\", gkaccelval\n    \t\toutvalue\t\"ncaccelval\", gkncaccelval\n    \t\toutvalue\t\"ncjoyxval\", gkncjoyX\n    \t\toutvalue\t\"ncjoyyval\", gkncjoyY\n    \tendif\n    endin\n    ;----------------------------------------------\n    /* fires off instances of instr 10, controlled by wiimote button B and NUNCHUK button Z\n    Notes play until button B or Z is released.\n    These are useful where drone is not desired.\n    p3 duration (assumed very long)\n    p4\ttable number for hz assigned to roll (if -1 or 0, roll is assigned to a constant value of 1)\n    p5\ttable number for hz assigned to yaw (if -1 or 0, yaw is assigned to a constant value of 1)\n    p6\ttable number for hz assigned to pitch (if -1 or 0, pitch is assigned to a constant \n    \tvalue of 1)Notes are given fixed parameters based on current positions of wiimote and NUNCHUK:\n    p7\trise time in seconds\n    p8 decay time in seconds\n    wiimote PITCH determines initial amplitude\n    wiimote ROLL determines hz\n    */\n    instr 9\t;fires instr 10 when B button or Z button is pressed and held; turns notes off when button released\n    /*NOTE: the current design has this effect:\n    If you don't touch the joystickX, notes have short rise and decay time, and play as long as the \n    B button or the Z button remains depressed.\n    If you pull the joystickX to the right, notes have a gradual rise time and a very long decay time, \n    so that you can play many long notes at once by pressing either trigger (B or Z) multiple times.\n    */\n    \tkbuttonB\tinit\t0\n    \tkbuttonZ init\t0\n    \tktrig\tinit 0\n    \tkrisetime\tinit\t0.01\n    \tkdecaytime\tinit\t0.01\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",9\n    \tendif\n    \t;kwiiORnunchk\tinit\t0\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\tkwaitcount + 1\t;increments every k-cycle\n    \tif(kwaitcount>gkwiibuttonwaitlimit/10)then\n    \t\t;kdur\t\texpinterpolate\t\t120, 0.1, 1, 0, gkncrollval\n    \t\tkdecaytime\t\tmaprange\tgkncjoyX, 0.01, 0.01, 0.01, 30, 60\t;duration controlled by NUNCHUK y-joystick\n    \t\tif(kdecaytime>0.01)then\n    \t\t\tkrisetime = 2\n    \t\tendif\n    \t\tif(kdecaytime<=0.01)then\n    \t\t\tkrisetime\t=\tkdecaytime\n    \t\tendif\n    \t\toutvalue\t\"ncjoyxcompute\",kdecaytime\n    \t\tkhzraw\texpinterpolate\t\t4000,40,1,0,gkrollval\n    \t\tkhz\t\tfindentry\tkhzraw, gkpitchtable\n    \t\tkamp\t\texpinterpolate\t\t1.0, 0.01,1,0,gkpitchval\n    \t\tif(gkbuttonB == 1 && kbuttonB == 0)then\n    \t\t\tkbuttonB\t= 1\n    \t\t\t;note plays indefinitely until B button released\n    \t\t\tevent \"i\", 10.1, 0, 8888, p4, p5, p6, 0, 0, krisetime, kdecaytime\n    \t\tendif\n    \t\tif(gkncbuttonZ == 1 && kbuttonZ == 0)then\n    \t\t\tevent \"i\", 10.2, 0, 8888, p4, p5, p6, 0, 1, krisetime, kdecaytime\n    \t\t\tkbuttonZ\t=\t1\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \t\tif(gkbuttonB == 0 && kbuttonB == 1)then\n    \t\t\tturnoff2\t10.1, 4, 1\t;turn off oldest instance of instr 10, with release\n    \t\t\tkbuttonB\t=\t0\n    \t\tendif\n    \t\tif(gkncbuttonZ == 0 && kbuttonZ == 1)then\n    \t\t\tturnoff2\t10.2, 4, 1\t;turn off oldest instance of instr 10, with release\n    \t\t\tkbuttonZ\t=\t0\n    \t\tendif\n    \tendif\t\n    endin\n    ;----------------------------------------------\n    /*\n    For instr 10--\n    p4\ttable number for hz assigned to roll (if -1 or 0, roll is assigned to a constant value of 1)\n    \tif p4 table number = -2, use vco2 to generate signal.\n    p5\ttable number for hz assigned to yaw (if -1 or 0, yaw is assigned to a constant value of 1)\n    p6\ttable number for hz assigned to pitch (if -1 or 0, pitch is assigned to a constant value of 1)\n    p7\toutput channel (not used yet)\n    p8 0_>take accels from wiimote; 1->take accels from NUNCHUK\n    p9\trise time in seconds\n    p10 decay time in seconds\n    */\n    instr 10 \t;assign pitch, yaw and roll to frequencies of independent a-rate signals\n    ;print p3, p4, p5, p6, p7, p8, p9, p10\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",10\n    \t\t;get initial hz value from the current position of either the wiimote or the NUNCHUK\n    \t\tif(p8==0)then\n    \t\t\tkroll\t\t=\t\tgkrollval\t;take roll value from wiimote\n    \t\tendif\n    \t\tif(p8==1)then\n    \t\t\tkroll\t\t\t=\t\tgkncrollval\t;take roll value from nunchuk\n    \t\tendif\n    \t\tkctrhz\texpinterpolate\t\t800,50,1,0,kroll\t\t;scale roll value to central hz range\n    \t\tktrig\t\t=\t1\n    \tendif\n    \toutvalue \"rolldisplay\", p4\n    \toutvalue \"yawdisplay\", p5\n    \toutvalue \"pitchdisplay\", p6\n    \tif(p8==0)then\n    \t\tkpitch\t=\t\tgkpitchval\t;take pitch value from wiimote\n    \t\tkroll\t\t=\t\tgkrollval\t;take roll value from wiimote\n    \t\tkyaw\t\t=\t\tgkyawval\t;take yaw value from wiimote\n    \tendif\n    \tif(p8==1)then\n    \t\tkpitch\t\t=\t\tgkncpitchval\t;take pitch value from nunchuk\n    \t\tkroll\t\t\t=\t\tgkncrollval\t;take roll value from nunchuk\n    \t\tkyaw\t\t\t=\t\tgkncyawval\t;take yaw value from nunchuk\n    \tendif\n    \tif(gkbuttonApressed>0)then\n    \t\tgk1freq\texpinterpolate\t\t1.25,0.75,1,0,kroll\t\t;scale roll value to hz range\n    \t\tgk1freq\t=\t\t\t\t\t\tgk1freq * kctrhz\t\t\t;roll value used for pitch bend here\n    \tendif\n    \tif(gkbuttonApressed<=0)then\n    \t\tgk1freq\texpinterpolate\t\t1.03,0.97,1,0,kroll\t;scale roll value to hz range\n    \t\tgk1freq\t=\t\t\t\t\t\tgk1freq * kctrhz\t\t\t;roll value used for pitch bend here\n    \tendif\t\n    \tgk2freq\texpinterpolate\t\t40,1,1,0,kpitch\t\t;scale pitch value to LFO range\n    \tgk3freq\texpinterpolate\t\t40,1,1,0,kyaw\t\t\t;scale yaw value to LFO range\n    \tamod\t\tinit\t0\n    \tif(p4==0 || p4==-1) then\n    \t\ta1\t=\t1\n    \tendif\n    \tif(p5<=0) then\n    \t\ta3\t=\t1\n    \tendif\n    \tif(p6<=0) then\n    \t\ta2\t\t=\t1\n    \t\tkamp\t=\tkpitch;if no table specified, map pitch to amplitude\n    \t\tif(kamp<0.1)then\n    \t\t\tkamp = 0\n    \t\tendif\n    \tendif\n    \tif(p4>0) then\n    \t\tkfreq\tfindentry\tgk1freq, gkpitchtable\t;freq determined by wiimote or nunchuk\n    \t\ta1\toscili\t1, kfreq, p4\t;signal based on roll of wiimote or roll of nunchuk\n    \t\tif(p8==0)then\n    \t\t\toutvalue \"roll\", gk1freq\t;send hz value to wiimote display\n    \t\tendif\n    \t\tif(p8==1)then\n    \t\t\toutvalue\t\"ncroll\", gk1freq\n    \t\tendif\n    \tendif\n    \tif(p4==-2)then\n    \t\tkfreq\tfindentry\tgk1freq, gkpitchtable\t;freq determined by wiimote or nunchuk\n    \t\ta1\tvco2\t1,  kfreq, 2, 0.1\t;band-limited square wave, narrow pulsewidth\n    \tendif\n    \tif(p6>0) then\n    \t\tgk2freq\tfindentry\tgk2freq, gkpitchtable\n    \t\ta2\toscili\t1, gk2freq, p6\t\t\t;signal based on pitch of wiimote or nunchuk, see above\n    \t\t;force very slow frequencies to silence\n    \t\tif(gk2freq<1.5)then\n    \t\t\ta1\t=\t0\n    \t\t\tgk2freq = 0\n    \t\tendif\n    \t\tif(p8==0)then\n    \t\t\toutvalue \"pitch\",gk2freq\n    \t\tendif\n    \t\tif(p8==1)then\n    \t\t\toutvalue\t\"ncpitch\",gk2freq\n    \t\tendif\n    \tendif\n    \tif(p5>0) then\n    \t\tgk3freq\tfindentry\tgk3freq, gkpitchtable \n    \t\ta3\toscili\t1, gk3freq, p5\t;signal based on yaw of wwimote or nunchuk, see above\n    \t\tif(p8==0)then\n    \t\t\toutvalue \"yaw\", gk3freq\n    \t\tendif\n    \t\tif(p8==1)then\n    \t\t\toutvalue\t\"ncyaw\", gk3freq\n    \t\tendif\n    \tendif\n    \tkenv\t\t\tlinenr\t1, p9, p10, 0.01\t;provides for release: extend instrument for 1 seconds, while decaying\n    \t;kenv\t\t\tlinen\t1,0.01*p3,p3,0.3*p3\n    \tklfofreq\t\tlinearinterpolate\t\t8, 0, 1, 0.5, gkncjoyY;\tgkUPDOWNcount\n    \tklfofreq\t\tlimit\tklfofreq,0,8\n    \tklfo\t\t\toscili\t1,klfofreq,1,0.25\t;generate LFO hz -- will be zero if nunchuk joy Y is at rest\n    \tamod\t\t\t=\tkenv * klfo * kamp * a1 * a2 * a3 \t;modulate all signals by each other\n    \tzawm\t\t\tamod, p7\t;store result in a zak a-rate container\n    endin\n    ;----------------------------------------------\n    /* fires off instances of instr 12, controlled by wiimote button B and NUNCHUK button Z\n    Notes play until button B or Z is released.\n    These are useful where drone is not desired.\n    p3 duration (assumed very long)\n    p4\ttable number of sample to be played\n    p5\tnot used\n    */\n    instr 11\t;fires instr 12 when B button or Z button is pressed and held; turns notes off when button released\n    /*NOTE: the current design has this effect:\n    If you don't touch the joystickX, notes have short rise and decay time, and play as long as the \n    B button or the Z button remains depressed.\n    If you pull the joystickX to the right, notes have a gradual rise time and a very long decay time, \n    so that you can play many long notes at once by pressing either trigger (B or Z) multiple times.\n    */\n    print p3,p4,p5,p6,p7\n    \tkbuttonB\tinit\t0\n    \tkbuttonZ init\t0\n    \tktrig\tinit 0\n    \tkrisetime\tinit\t0.01\n    \tkdecaytime\tinit\t0.01\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",11\n    \tendif\n    \t;kwiiORnunchk\tinit\t0\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\tkwaitcount + 1\t;increments every k-cycle\n    \tif(kwaitcount>gkwiibuttonwaitlimit/10)then\n    \t\t;kdur\t\texpinterpolate\t\t120, 0.1, 1, 0, gkncrollval\n    \t\tkdecaytime\t\tmaprange\tgkncjoyX, 0.01, 0.01, 0.01, 30, 60\t;duration controlled by NUNCHUK y-joystick\n    \t\tif(kdecaytime>0.01)then\n    \t\t\tkrisetime = 2\n    \t\tendif\n    \t\tif(kdecaytime<=0.01)then\n    \t\t\tkrisetime\t=\tkdecaytime\n    \t\tendif\n    \t\toutvalue\t\"ncjoyxcompute\",kdecaytime\n    \t\tkhzraw\texpinterpolate\t\t4000,40,1,0,gkrollval\n    \t\tkhz\t\tfindentry\tkhzraw, gkpitchtable\n    \t\tkamp\t\texpinterpolate\t\t1.0, 0.01,1,0,gkpitchval\n    \t\tif(gkbuttonB == 1 && kbuttonB == 0)then\n    \t\t\tkbuttonB\t= 1\n    \t\t\t;note plays indefinitely until B button released\n    \t\t\tevent \"i\", 12.1, 0, 8888, p4, -1, -1, 0, 0, krisetime, kdecaytime\n    \t\tendif\n    \t\tif(gkncbuttonZ == 1 && kbuttonZ == 0)then\n    \t\t\tevent \"i\", 12.2, 0, 8888, p4, -1, -1, 1, 1, krisetime, kdecaytime\n    \t\t\tkbuttonZ\t=\t1\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \t\tif(gkbuttonB == 0 && kbuttonB == 1)then\n    \t\t\tturnoff2\t12.1, 4, 1\t;turn off oldest instance of instr 10, with release\n    \t\t\tkbuttonB\t=\t0\n    \t\tendif\n    \t\tif(gkncbuttonZ == 0 && kbuttonZ == 1)then\n    \t\t\tturnoff2\t12.2, 4, 1\t;turn off oldest instance of instr 10, with release\n    \t\t\tkbuttonZ\t=\t0\n    \t\tendif\n    \tendif\t\n    endin\n    ;----------------------------------------------\n    instr 12\t\t\t;Plays a sample\n    ; p3 = duration\n    ; p4 = table number\n    ; p5 = -1 (get hz from gkrollval); >0 (use p5 as hz)\n    ; p6 = -1 (get amplitude from gkpitchval); >0 (use p6 as amplitude)\n    ;\t\tevent\t\"i\", 12, 0, ktimeinterval* kdurationfactor, p4 ,khz ,kenv*kstartamp\n    ; p7 = 0: get accels from wiimote; =1: get accels from NUNCHUK\n    ;\t\t\t\tevent \"i\", 12, 0, 8888, 69, -1, -1, 0\t;play marimba sample; start patch, listen to wiimote accels\n    ; p8 not used\n    ; p9 = risetime\n    ; p10 = decay time\n    print p3,p4,p5,p6,p7,p8,p9,p10\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",12\n    \tendif\n    ;\tkenv\tinit 1;kenv\n    \tkenv\t\tlinenr\t1, p9, p10, 0.01\t;envelope allows for release after instrument turned off\n    \tif(p7==0)then\n    \t\tkrollval\t\t=\tgkrollval\n    \t\tkpitchval\t=\tgkpitchval\n    \t\tkyawval\t\t=\tgkyawval\n    \tendif\n    \tif(p7==1)then\n    \t\tkrollval\t\t=\tgkncrollval\n    \t\tkpitchval\t=\tgkncpitchval\n    \t\tkyawval\t\t=\tgkncyawval\n    \tendif\n    \tif(p5==-1) then\n    ;\t\tkoscpitch\t\texpinterpolate\tgksamplehzhi,gksamplehzlow,1,0,krollval\n    \t\tif(gkbuttonApressed==1)then\n    \t\t\tkoscpitch\t\texpinterpolate\t\t12,\t\t0.1,\t1,\t0,\tkrollval\n    \t\tendif\n    \t\tif(gkbuttonApressed<=0)then\n    \t\t\tkoscpitch\t\texpinterpolate\t\t3,\t\t0.75,\t1,\t0,\tkrollval\n    \t\tendif\t\t\t\n    \tendif\n    \tif(p5!=-1) then\n    \t\tkoscpitch\t\t=\tp5\n    \tendif\n    \tkoscpitch\tfindentry\tkoscpitch, gkpitchtable\n    \tif(p6==-1)then\n    \t\t\tkoscamp\t\t\t=\t\t\tkpitchval\n    \t\t\tif(koscamp<0.1)then\n    \t\t\t\tkoscamp\t=\t0\n    \t\t\tendif\n    \tendif\n    \tif(p6!=-1)then\n    \t\tkoscamp\t\t\t\t=\t\t\tp6\t\n    \tendif\n    \tif(p7==0)then\n    \t\toutvalue\t\t\t\"pitch\", koscamp\n    \t\toutvalue\t\t\t\"roll\", koscpitch\n    \tendif\n    \tif(p7==1)then\n    \t\toutvalue\t\t\t\"ncpitch\", koscamp\n    \t\toutvalue\t\t\t\"ncroll\", koscpitch\n    \tendif\n    \t;***********************\n    \t;following code implements LFO and pitchbend, using NUNCHUK joystick\n    \tkjoyY\t\t=\t\t\tgkncjoyY\t;use joystick UP for LFO hz\n    \tif(kjoyY<0.5)then\n    \t\tkjoyY\t=\t0.5\n    \tendif\n    \tklfohz\tlinearinterpolate\t\t10, 0, 1, 0.5, kjoyY\n    \tkvibr\t\toscili\t1, klfohz, 1, 0.25\t\t;simple sine wave vibrato\n    \tkbend\t\tlinearinterpolate\t\t1.3, 0.7, 1, 0, gkncjoyX\n    \t;************************\n    \t\n    \taosc\tposcil\t\tkenv*koscamp*kvibr, koscpitch*kbend, p4\n    \tzawm\taosc, 0\n    endin\n    \n    ;----------------------------------------------\n    instr 16\t\t\t;Plays and combines two samples\n    ; p3 = duration\n    ; p4 = table number of 1st sample\n    ; p5 = -1 (get hz from gkrollval); >0 (use p5 as hz)\n    ; p6 = -1 (get amplitude from gkpitchval); >0 (use p6 as amplitude)\n    ; p7 = table number of 2nd sample\n    ; p8 = 0: take signals from wiimote; 1: take signals from NUNCHUK\n    ;\t\tevent\t\"i\", 12, 0, ktimeinterval* kdurationfactor, p4 ,khz ,kenv*kstartamp\n    ;print p8\n    gksamplehzlow\tinit\t0.0035\n    gksamplehzhi\tinit\t15\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",16\n    \tendif\n    \tkenv\t=\t1;shouldn't have any amplitude envelope\n    \tif(p8==0)then\n    \t\tkroll\t\t=\tgkrollval\n    \t\tkpitch\t=\tgkpitchval\n    \tendif\n    \tif(p8==1)then\n    \t\tkroll\t\t=\tgkncrollval\n    \t\tkpitch\t=\tgkncpitchval\n    \tendif\n    \tif(p5==-1) then\n    \t\tkoscpitch\t\texpinterpolate\tgksamplehzhi,gksamplehzlow,1,0,kroll\n    \tendif\n    \tif(p5!=-1) then\n    \t\tkoscpitch\t\t=\tp5\n    \tendif\n    \tkoscpitch\tfindentry\tkoscpitch, gkpitchtable\n    \tif(p6==-1)then\n    \t\t\tkoscamp\t\t\t=\t\t\tkpitch\n    \t\t\tif(koscamp<0.1)then\n    \t\t\t\tkoscamp\t=\t0\n    \t\t\tendif\n    \tendif\n    \tif(p6!=-1)then\n    \t\tkoscamp\t\t\t\t=\t\t\tp6\t\n    \tendif\n    \tif(p8==0)then\n    \t\toutvalue\t\t\t\"pitch\", koscamp\n    \t\toutvalue\t\t\t\"roll\", koscpitch\n    \tendif\n    \tif(p8==1)then\n    \t\toutvalue\t\t\t\"ncpitch\", koscamp\n    \t\toutvalue\t\t\t\"ncroll\", koscpitch\n    \tendif\n    \taosc1\tposcil\t\tkenv*koscamp, koscpitch, p4\n    \taosc2\tposcil\t\tkenv*koscamp, koscpitch, p7, 0.50\n    \tzawm\taosc1+aosc2, 0\n    endin\n    \n    /*\n    Mix active zak a-rate signals and output them.\n    [mono temporarily]\n    */\n    /*\n    Assign pitch, yaw and roll to frequencies of independent a-rate signals\n    p3\tduration\n    p4\ttable number for hz assigned to roll, gets translated to hz\n    p5\ttable number for hz assigned to yaw (if -1, yaw is assigned to a constant value of 1), translated to amplitude modulation\n    p6\ttable number for hz assigned to pitch (if -1, pitch is assigned to a constant value of 1) (unused)\n    p7\tindex to zak a-rate signal for storing the result \n    Pitches and amplitudes come from dynamically varying wwimote signals, already scaled by instr 3\n    */\n    /*\n    instr 20 \t;assign pitch to hz, roll and amplitude modulation \n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",20\n    \tendif\n    \toutvalue \"rolldisplay\", p4\n    \toutvalue \"yawdisplay\", p5\n    \toutvalue \"pitchdisplay\", p6\n    \tamod\t\tinit\t0\n    \tif(p5<0) then\n    \t\tkampl\t= 1\n    \tendif\n    \tkmodfreq\texpinterpolate\t8,0.1,1,0,gkpitchval\n    \tkmodfreq\tfindentry\tkmodfreq, gkpitchtable\n    \tif(p5>0) then\n    \t\tkampl\t\toscili\t1, kmodfreq, p5\t;vibrato based on roll of wiimote\n    \tendif\n    \tkunused = p6\n    \tif(p4<=0) then\n    \t\tp4 = 1\n    \tendif\n    \tkhz\t\texpinterpolate\t800,50,1,0,gkrollval\n    \tkhz2\t\t=\t(3/2)*khz\n    \tif(p4>0) then\n    \t\tkhz\tfindentry\tkhz, gkpitchtable\n    \t\tkhz2\tfindentry\tkhz2, gkpitchtable\n    \t\ta1\toscili\tgk1amp, khz, p4\t;signal based on pitch of wiimote\n    \t\ta2\toscili\tgk1amp, khz2, p4\t;signal based on pitch of wiimote\n    \tendif\n    \tamod\t\t\t=\tkampl * (a1 + a2) / 2 \t;modulate all signals by each other\n    \tzaw\tamod, p7\t;store result in a zak a-rate container\n    endin\n    */\n    ;----------------------------------------------\n    /* fires off instances of instr 10, alternately controlled by wiimote and NUNCHUK\n    Fires off notes when B-button (trigger) is pressed\n    p3 duration\n    p4 table number\n    p5 loop start\n    p6 loop end\n    p7 pitch multiplier\n    wiimote PITCH determines initial amplitude\n    wiimote ROLL determines hz\n    */\n    instr 24\t;fires notes of instr 25 (looped samples) when B or Z button is pressed\n    \tktrig\tinit 0\n    \tkrisetime\tinit\t0.01\n    \tkdecaytime\tinit\t0.01\n    \tkbuttonB\t\tinit\t0\n    \tkbuttonZ\t\tinit\t0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",24\n    \tendif\n    \tkwiiORnunchk\tinit\t0\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\tkwaitcount + 1\t;increments every k-cycle\n    \tif(kwaitcount>gkwiibuttonwaitlimit)then\n    \t\t;kdur\t\texpinterpolate\t\t120, 0.1, 1, 0, gkncrollval\n    \t\tkdecaytime\t\tmaprange\t\tgkncjoyX, 0.01, 0.01, 0.01, 30, 60\t;duration controlled by NUNCHUK x-joystick\n    \t\tif(kdecaytime>0.01)then\n    \t\t\tkrisetime\t=\t 2\n    \t\tendif\n    \t\tif(kdecaytime<=0.01)then\n    \t\t\tkrisetime\t=\tkdecaytime\n    \t\tendif\n    \t\toutvalue\t\"ncjoyxcompute\",kdecaytime\n    \t\tkhzraw\texpinterpolate\t\t4000,40,1,0,gkrollval\n    \t\tkhz\t\tfindentry\tkhzraw, gkpitchtable\n    \t\tkamp\t\texpinterpolate\t\t1.0, 0.01,1,0,gkpitchval\n    \t\tif(gkbuttonB == 1 && kbuttonB == 0)then\n    \t\t\tevent \"i\", 25.1, 0, 8888, p4, p5, p6, p7, 0, krisetime, kdecaytime\n    \t\t\tkbuttonB\t=\t1\n    \t\tendif\n    \t\tif(gkncbuttonZ == 1 && kbuttonZ == 0)then\n    \t\t\tevent \"i\", 25.2, 0, 8888, p4, p5, p6, p7, 1, krisetime, kdecaytime\n    \t\t\tkbuttonZ\t=\t1\n    \t\tendif\n    \t\tif(gkbuttonB == 0 && kbuttonB ==1)then\n    \t\t\tturnoff2\t25.1, 4, 1\t;turnoff instrument started by B button, with release\n    \t\t\tkbuttonB\t=\t0\n    \t\tendif\n    \t\tif(gkncbuttonZ == 0 && kbuttonZ == 1)then\n    \t\t\tturnoff2 25.2, 4, 1\n    \t\t\tkbuttonZ\t=\t0\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \tendif\t\n    endin\n    /*\n    Plays a looped sample\n    p3 duration\n    p4 table number\n    p5 loop start\n    p6 loop end\n    p7 pitch multiplier\n    p8 =0: take accels from wiimote. =1: take accels from NUNCHUK\n    p9\trise time in seconds\n    p10\tdecay time in seconds\n    frequency comes from wiimote or NUNCHUK roll\n    amplitude comes from wiimote or NUNCHUK pitch \n    DEPRECATED: pitchbend comes from nunchuk joystick left-right\n    amplitude LFO freq comes from nunchuk joystick up (not down)\n    */\n    instr 25 ;plays a looped sample\n    ;print p4, p5, p6, p7\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue\t\t\"instrument\",25\n    \t\toutvalue\t\t\"pitchdisplay\", p4 ;indicate what table we're using\n    \t\toutvalue\t\t\"yawdisplay\", 0\n    \t\toutvalue\t\t\"rolldisplay\", 0\n    \t\t;get initial hz from roll value (after this, roll will be for pitchbend\n    \t\tif(p8==0)then\n    \t\t\tkctrlhz\t\t\texpinterpolate\t500,40,1,0,gkrollval\n    \t\t\tkctrlhz\t\t\t=\tkctrlhz * p7\n    \t\tendif\n    \t\tif(p8!=0)then\n    \t\t\tkctrlhz\t\t\texpinterpolate\t500,40,1,0,gkncrollval\n    \t\t\tkctrlhz\t\t\t=\tkctrlhz * p7\n    \t\tendif\n    \t\tktrig\t= 1\n    \tendif\n    \tif(p8==0)then\n    \t\tkrollval\t\t=\tgkrollval\n    \t\tkpitchval\t=\tgkpitchval\n    \tendif\n    \tif(p8==1)then\n    \t\tkrollval\t\t=\tgkncrollval\n    \t\tkpitchval\t=\tgkncpitchval\n    \tendif\n    \tif(gkbuttonApressed>0)then\n    \t\tkbendhz\t\t\texpinterpolate\t\t1.15,0.85,1,0,krollval\n    \tendif\n    \tif(gkbuttonApressed<=0)then\n    \t\tkbendhz\t\t\texpinterpolate\t\t1.1,0.9,1,0,krollval\n    \tendif\n    \tkhz\t\t\t=\tkctrlhz * kbendhz\n    \tkhz\t\t\tfindentry\tkhz, gkpitchtable\t;constrain pitch to current temperament table\n    \tkampl\t\t=\t\t\tkpitchval\n    \tif(p8==0)then\n    \t\toutvalue\t\t\"pitch\", kampl\n    \t\toutvalue\t\t\"roll\", khz\n    \tendif\n    \tif(p8==1)then\n    \t\toutvalue\t\t\"ncpitch\", kampl\n    \t\toutvalue\t\t\"ncroll\", khz\n    \tendif\t\n    \tkoscamp\t\t\t=\t\t\tkpitchval\n    \tif(koscamp<0.1)then\n    \t\tkoscamp\t=\t0\n    \tendif\n    \tkncjoyY\t\t=\tgkncjoyY\n    \tklfofreq\t\tlinearinterpolate\t\t8, 0, 1, 0.5, kncjoyY; gkUPDOWNcount\n    \tklfofreq\t\tlimit\tklfofreq, 0,8\n    \tklfo\t\t\toscili\t1,klfofreq,1,0.25\t;generate LFO to be used when B button is pressed\n    \t;khzbendraw\t=\tgkncjoyX\n    \t;khzbend\t\tlinearinterpolate\t\t1.25, 0.75, 1, 0, khzbendraw\n    \tkenv\t\t\tlinenr\t\t1,p9, p10, 0.01\t;provides for ramp-down AFTER instrument has received \"turnoff2\"\n    \tar\t\t\t\tlposcil\tkenv * klfo* koscamp, khz, p5, p6, p4\n    \tzawm\t\t\tar,0\n    endin\n    \n    \n    /*when B button is pressed, play a bunch of notes\n    Length of cascade determined by NUNCHK roll\n    p4 table number to play\n    */\n    instr 30\t;invokes notes when B button pressed\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",30\n    \tendif\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\t\tkwaitcount + 1\n    \tif(kwaitcount > gkwiibuttonwaitlimit)then\n    \t\tif(gkbuttonB==1) then\n    \t\t\tkactive active 40\n    \t\t\tif ( (kactive<=100) ) then\n    \t\t\t\tkduration\tlinearinterpolate\t\t10,1,1,0,gkncrollval\n    \t\t\t\tkeventcount\tlinearinterpolate\t\t100,1,1,0,gkncrollval\n    \t\t\t\t;cascade duration = kduration; sample=p4, no. notes to play = keventcount; \n    \t\t\t\t;0=take pitch & amplitude from wiimote\n    \t\t\t\tevent \"i\", 40, 0, kduration, p4, keventcount, 0\n    \t\t\tendif\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \tendif\n    endin\n    instr 39\t;invokes instr 40 when B button pressed\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",39\n    \tendif\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\t\tkwaitcount + 1\n    \tif(kwaitcount > gkwiibuttonwaitlimit)then\n    \t\tif(gkbuttonB==1) then\n    \t\t\tkactive active 40\n    \t\t\tif ( (kactive<=100) ) then\n    \t\t\t\tkduration\t\tmaprange\tgkncjoyX, 0.01, 0.01, 0.01, 30, 60\t;duration controlled by NUNCHUK y-joystick\n    \t\t\t\t;kduration\tlinearinterpolate\t\t10,0.1,1,0,gkncrollval\n    \t\t\t\tkeventcount\tlinearinterpolate\t\t100,1,1,0,gkncrollval\n    \t\t\t\t;cascade duration = kduration; sample=p4, no. notes to play = keventcount; \n    \t\t\t\t;0=take pitch & amplitude from wiimote\n    \t\t\t\tevent \"i\", 40, 0, kduration, p4, -1, 0 ;invoke notes repeatedly (until patch is vacated)\n    \t\t\tendif\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \tendif\n    endin\n    ;p4 table number to use\n    ;p5 continuous or finite: >0 (number of notes to play), finite;  -1, continuous\n    ;p6 0:take signals from wiimote; 1:take signals from NUNCHUK\n    instr 40 ;invokes instr 12 multiple times\n    ;print p3, p4, p5, p6\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",40\n    \tendif\n    \tkcount\t\t\tinit p5\n    \tkcurrenttime\tinit\t0\n    \tknexttime\t\tinit 0\n    \tktimeinterval\tinit 0.4\n    \tkcurrenttime\t=\tkcurrenttime + 1/kr\t;keep track of time since instrument started\n    \tkstartamp\t\tlinearinterpolate 2.5,0,10,0,p3\t;longer sequences start louder\n    \tkstartamp\t\tlimit\tkstartamp, 0, 5\n    \tkenv\t\t\t=\t1\n    \tif(p5>0) then\n    \t\t;if playing finite no. notes, draw a descending curve for diminuendo\n    \t\tkenv expon 5, p3, 0.001\n    \t\t;for finite no. notes, overall amplitude controlled by wiimote pitch\n    \t\tkampoverride\tlinearinterpolate\t\t1,0,1,0.1,gkpitchval\n    \t\tkenv\t\t\t\t=\tkenv * kampoverride\n    \tendif\n    \tif(p6==0)then\n    \t\t;take signals from wiimote\n    \t\tkroll\t\t=\tgkrollval\n    \t\tkpitch\t=\tgkpitchval\n    \tendif\n    \tif(p6==1)then\n    \t;take signals from NUNCHUK\n    \t\tkroll\t\t=\tgkncrollval\n    \t\tkpitch\t=\tgkncpitchval\n    \tendif\n    \tif(kcurrenttime > knexttime) then\n    \t;it's time to play another note\n    \t\tkhz\t\t\t\tlinearinterpolate 2,0.1,1,0,kroll\n    \t\t;khz\t\t\t\tfindentry\tkhz, gkpitchtable\t;constrain pitch to current temperament table\n    \t\tif(p6==0)then\n    \t\t\toutvalue \t\t\"roll\",khz\n    \t\t\toutvalue\t\t\t\"pitch\", ktimeinterval\n    \t\t\t;printk 1,ktimeinterval\n    \t\tendif\n    \t\tif(p6==1)then\n    \t\t\toutvalue \t\t\"ncroll\",khz\n    \t\t\toutvalue \t\t\"ncpitch\", ktimeinterval\n    \t\t\t;printk 1,ktimeinterval,5\n    \t\tendif\n    \t\t;randomize duration of note to be played\n    \t\tkdurationfactor\trandom 3.0,1\n    \t\t;if time between notes is fairly long, don't play note at all (equivalent to mute)\n    \t\tif( (ktimeinterval) < 2.5 )then\n    \t\t\tevent\t\"i\", 12, 0, ktimeinterval* kdurationfactor, p4 ,khz ,kenv*kstartamp\n    \t\tendif\n    \t\tkcount\t\t\t=\tkcount-1 ;if kcount starts as -1, kcount will never be 0 (play indefinitely)\n    \t\t;ktimeinterval\trandom 0.07, 0.14\t\t;for continuous sequences\n    \t\tif(p5<0)then\n    \t\t\t;if continuous play, how many seconds until the next note? -- for finite sequences\n    \t\t\tktimeinterval\tlinearinterpolate 1/30, 2, 1, 0, kpitch\n    \t\t\t;ktimeinterval\trandom\tktimeinterval/2, ktimeinterval*3\n    \t\tendif\n    \t\tif(p5>0)then\n    \t\t\t;for finite play, time interval is duration of this instrument divided by number of notes (p5)\n    \t\t\tktimeinterval\t=\tp3/p5\n    \t\t\tkrandomfactor\t\trandom\t0.75, 1.25\n    \t\t\tktimeinterval\t=\tktimeinterval * krandomfactor\n    \t\tendif\n    \t\tknexttime\t\t=\tkcurrenttime + ktimeinterval\n    \tendif\n    endin\n    \n    /*\n    p3 duration of note\n    p4 table number (must be playable by oscil family of opcodes)\n    p5 hz\n    p6 kmasterenv (amplitude envelope) - expected to vary from one call to the next\n    p7 0: use oscili; 1: use vco2\n    p8 rise time in seconds\n    p9 decay time in seconds\n    */\n    instr 45\t;plays one note\n    ;the following modulates each note:\n    ;\twiimote pitch alters amplitude\n    ;\tnunchuk left/right joystick provides pitchbend\n    ;\tnunchuk up joystick provides vibrato\n    ;\tnunchuk pitch varies pulse width when vco2 is used\n    ;print p3,p4,p5,p6\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",45\n    \tendif\n    \tkenv\t\tlinenr\t\t1, p8, p9, 0.01\n    \t;***********************\n    \t;following code implements LFO and pitchbend, using NUNCHUK joystick\n    \tkjoyY\t\t=\t\t\tgkncjoyY\t;use joystick UP for LFO hz\n    \tif(kjoyY<0.5)then\n    \t\tkjoyY\t=\t0.5\n    \tendif\n    \tklfohz\tlinearinterpolate\t\t10, 0, 1, 0.5, kjoyY\n    \tkvibr\t\toscili\t1, klfohz, 1, 0.25\t\t;simple sine wave vibrato\n    \tkbend\t\tlinearinterpolate\t\t1.3, 0.7, 1, 0, gkncjoyX\n    \t;************************\n    \tkamp\t\texpinterpolate\t\t6,0.1,1,0,gkpitchval\n    \tkpulsewidth\t\tlinearinterpolate\t\t0.99, 0.5, 1, 0, gkncpitchval\n    \tif(kamp<0.2)then\n    \t\tkamp\t=\t0\n    \tendif\n    \toutvalue \"roll\", p5\n    \tif(p7==0)then\n    \t\tar\toscili\tp6 * kenv * kamp * kvibr, p5*kbend, p4\n    \tendif\n    \tif(p7==1)then\n    \t\tar\tvco2\tp6 * kenv * kamp * kvibr,  p5*kbend, 2, kpulsewidth\t;play band-limited square wave\n    \tendif\n    \tzawm\tar,0\n    endin\n    \n    /*\n    Fires off notes when B-button (trigger) is pressed\n    p3 duration (assumed very long)\n    p4 table number\n    Notes are given fixed parameters based on current positions of wiimote and NUNCHUK:\n    wiimote PITCH determines initial amplitude\n    wiimote ROLL determines hz\n    */\n    instr 46\t;fires instr 45 notes when B button is pressed\n    \tkbuttonB\t\tinit\t0\n    \tkrisetime\tinit\t0.1\n    \tkdecaytime\tinit\t0.1\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrumentinvoker\",46\n    \tendif\n    \tkdecaytime\t\tmaprange\tgkncjoyX, 0.01, 0.01, 0.01, 30, 60\t;duration controlled by NUNCHUK y-joystick\n    \tif(kdecaytime>0.01)then\n    \t\tkrisetime\t=\t2\n    \tendif\n    \tif(kdecaytime<=0.01)then\n    \t\tkdecaytime\t=\tkrisetime\n    \tendif\n    \tkwaitcount\tinit\t0\n    \tkwaitcount\t=\tkwaitcount + 1\t;increments every k-cycle\n    \tif(kwaitcount>gkwiibuttonwaitlimit)then\n    \t\tkdur\t\texpinterpolate\t\t120, 0.1, 1, 0, gkncrollval\n    \t\tkhzraw\texpinterpolate\t\t4000,40,1,0,gkrollval\n    \t\tkhz\t\tfindentry\tkhzraw, gkpitchtable\n    \t\tkamp\t\texpinterpolate\t\t1.0, 0.01,1,0,gkpitchval\n    \t\tif(gkbuttonB == 1 && kbuttonB == 0)then\n    \t\t\tevent \"i\", 45, 0, kdur, p4, khz, kamp, 1, krisetime, kdecaytime\n    \t\t\tkbuttonB\t\t=\t1\n    \t\tendif\n    \t\tif(gkbuttonB == 0 && kbuttonB ==1)then\n    \t\t\tturnoff2 45, 4, 1\n    \t\t\tkbuttonB\t=\t0\n    \t\tendif\n    \t\tkwaitcount\t=\t0\n    \tendif\t\n    endin\n    ;-------------------------------------------\n    instr 50\t\t\t;gradually turn master fader to the P4 value\n    ;P4\tdesired value for master fader\n    \tktrig\t\tinit\t0\n    \tif(ktrig==0)then\n    \t\tgkmstersave\t=\tgkmaster\n    \t\tktrig\t=\t1\n    \tendif\n    \tkspeedinc\t\tinit\t.09\n    \tkfaderdesired\t= p4\n    \tkfadercurrent\tinvalue \"master\"\n    \tif(kfadercurrent<=0)then\n    \t\tkfadercurrent = 0.01\n    \tendif\n    \tif(abs(kfadercurrent-kfaderdesired)<=kspeedinc) then\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfaderdesired\n    \t\tturnoff\n    \tendif\n    \tif(kfadercurrent < kfaderdesired) then\n    \t\tkfadercurrent = kfadercurrent  * (1 + kspeedinc)\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfadercurrent\n    \tendif\n    \tif(kfadercurrent > kfaderdesired) then\n    \t\t;printk 1,7777\n    \t\tkfadercurrent = kfadercurrent * (1 - 2*kspeedinc)\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfadercurrent\n    \tendif\n    endin\n    \n    ;-------------------------------------------\n    instr 51\t\t\t;quickly turn master fader to the P4 value\n    ;P4\tdesired value for master fader\n    \tktrig\t\tinit\t0\n    \tkfadercurrent\tinvalue \"master\"\n    \tif(ktrig==0)then\n    \t\tgkmstersave\t=\tgkmaster\n    \t\t;compute kspeedinc, the desired increment of change every k-period\n    \t\tkspeedinc\t=\tabs(kfadercurrent - p4)/3\t;/10 \n    \t\tktrig\t=\t1\n    \tendif\n    \tkfaderdesired\t= p4\n    \t;if we are muted, pressing the Minus button sets the master fader to a low audible value \n    \tif(kfadercurrent<=0)then\n    \t\tkfadercurrent = 0.01\n    \tendif\n    \t;if the fader is already very close to the desired value, set it directly to desired value and quit\n    \tif(abs(kfadercurrent-kfaderdesired)<=kspeedinc) then\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfaderdesired\n    \t\tturnoff\n    \tendif\n    \t;if master fader is lower than the desired value, add kspeedinc to the current value\n    \tif(kfadercurrent < kfaderdesired) then\n    \t\tkfadercurrent = kfadercurrent  + kspeedinc;\t* (1 + kspeedinc)\n    \t\tkfadercurrent\tlimit kfadercurrent, 0, 1\t;guard against going outside legal limits\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfadercurrent\n    \tendif\n    \t;if master fader is greater than desired value, decrement master value by kspeedinc (times 2)\n    \tif(kfadercurrent > kfaderdesired) then\n    \t\t;printk 1,7777\n    \t\tkfadercurrent = kfadercurrent - 2*kspeedinc;\t* (1 - 2*kspeedinc)\n    \t\tkfadercurrent\tlimit kfadercurrent, 0, 1\n    \t\t;gkmastersave\t=\tgkmaster\n    \t\tgkmaster\t=\tkfadercurrent\n    \tendif\n    \toutvalue \"master\",gkmaster\n    \t;printk2\tkfadercurrent \n    endin\n    \n    /*\n    p4 table associated with pitch\n    p5 table associated with roll\n    p6 unused\n    ;k1 is mapped to roll\n    ;k2 is mapped to pitch\n    ;k3 is mapped to yaw\n    */\n    instr 60\t;play two signals simultaneously, mixed in various ways\n    \tktrig\tinit 0\n    \tif(ktrig==0)then\n    \t\toutvalue \"instrument\",60\n    \tendif\n    \tktrig init 0\n    \tif(ktrig == 0) then\n    \t\toutvalue \"pitchdisplay\",p4 ;show what table is associated with pitch\n    \t\toutvalue\t\"rolldisplay\", p5\n    \t\tkrnd1\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd2\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd3\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd4\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd5\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd6\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd7\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd8\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd9\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd10\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd11\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd12\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd13\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tkrnd14\t\t=\tround(rnd(1))\t;get random 0 or 1\n    \t\tktrig = 1\n    \tendif\n    \tktemp\t=\tp6\t;unused\n    \tk1freq\t\tfindentry gk1freq, gkpitchtable\t;roll\n    \tk2freq\t\tfindentry gk2freq, gkpitchtable\t;pitch\n    \tirandomfactor\tinit\t\t0.1\n    \tk1freqrandom\trandom\tk1freq*(1-irandomfactor), k1freq*(1+irandomfactor)\t;make high freq signal unsteady\n    \tk2freqrandom\trandom\tk2freq*0.33, k2freq*1.5\t;make low freq signal unsteady\n    \tif(k2freqrandom<=2)then\n    \t\tk2freqrandom = 0\n    \tendif\n    \tif(k2freqrandom>12)then\n    \t\tk2freqrandom = 30\n    \tendif\n    \toutvalue\t\t\"roll\",k1freqrandom\n    \toutvalue\t\t\"pitch\",k2freqrandom\n    \tkrollhz\t\t=\tk1freq\n    \tkrollhzrand\t=\tk1freqrandom\n    \tkpitchhz\t\t=\tk2freq\n    \tkpitchhzrand\t=\tk2freqrandom\n    \tk1\t\t\t\t=\t(krollhz + krollhzrand)/2\n    \tk2\t\t\t\t=\tkrollhz - krollhzrand\n    \tk3\t\t\t\t=\t(kpitchhz + kpitchhzrand)/2\n    \tk4\t\t\t\t=\tkpitchhz - kpitchhzrand\n    \tk5\t\t\t\t=\tk1*k2\n    \tk6\t\t\t\t=\tk1*k3\n    \tk7\t\t\t\t=\tk1*k4\n    \tk8\t\t\t\t=\tk2*k3\n    \tk9\t\t\t\t=\tk2*k4\n    \tk10\t\t\t=\tk3*k4\n    \tk11\t\t\t=\tkrollhz\n    \tk12\t\t\t=\tkrollhzrand\n    \tk13\t\t\t=\tkpitchhz\n    \tk14\t\t\t=\tkpitchhzrand\n    \t\n    \tarollhz\t\toscili\t1, krollhz, p4\t\t\t\t;roll\n    \tarollhzrand\toscili\t1, krollhzrand, p4\t\t\t\t;roll\n    \tapitchhz\t\toscili\t1, kpitchhz, p4\t\t\t\t;roll\n    \tapitchhzrand\toscili\t1, kpitchhzrand, p4\t\t\t\t;roll\n    \ta1\toscili\t1, k1, p4\t\t\t\t;roll\n    \ta2\toscili\t1, k2, p4\t\t\t\t;roll\n    \ta3\toscili\t1, k3, p4\t\t\t\t;roll\n    \ta4\toscili\t1, k4, p5\t\t\t\t;roll\n    \ta5\toscili\t1, k5, p4\t\t\t\t;roll\n    \ta6\toscili\t1, k6, p5\t\t\t\t;roll\n    \ta7\toscili\t1, k7, p4\t\t\t\t;roll\n    \ta8\toscili\t1, k8, p5\t\t\t\t;roll\n    \ta9\toscili\t1, k9, p4\t\t\t\t;roll\n    \ta10\toscili\t1, k10, p5\t\t\t\t;roll\n    \ta11\toscili\t1, k11, p4\t\t\t\t;roll\n    \ta12\toscili\t1, k12, p5\t\t\t\t;roll\n    \ta13\toscili\t1, k13, p4\t\t\t\t;roll\n    \ta14\toscili\t1, k14, p5\t\t\t\t;roll\n    \n    \tif(gkbuttonBval==0)then\n    \t\tzaw\tarollhz - a1   , 0\n    \tendif\n    \tif(gkbuttonBval==1)then\n    \t\tzaw\tarollhzrand, 0\n    \tendif\n    \tif(gkbuttonBval==2)then\n    \t\tzaw\tapitchhz, 0\n    \tendif\n    \tif(gkbuttonBval==3)then\n    \t\tzaw\tapitchhzrand, 0\n    \tendif\n    \tif(gkbuttonBval==4)then\n    \t\tzaw\ta1, 0\n    \tendif\n    \tif(gkbuttonBval==5)then\n    \t\tzaw\ta2, 0\n    \tendif\n    \tif(gkbuttonBval==6)then\n    \t\tzaw\ta3, 0\n    \tendif\n    \tif(gkbuttonBval==7)then\n    \t\tzaw\ta4, 0\n    \tendif\n    \tif(gkbuttonBval==8)then\n    \t\tzaw\ta5, 0\n    \tendif\n    \tif(gkbuttonBval==9)then\n    \t\tzaw\ta6, 0\n    \tendif\n    \tif(gkbuttonBval==10)then\n    \t\tzaw\ta7, 0\n    \tendif\n    \tif(gkbuttonBval==11)then\n    \t\tzaw\ta8, 0\n    \tendif\n    \tif(gkbuttonBval==12)then\n    \t\tzaw\ta9, 0\n    \tendif\n    \tif(gkbuttonBval==13)then\n    \t\tzaw\ta10, 0\n    \tendif\n    \tif(gkbuttonBval==14)then\n    \t\tzaw\ta1*a2, 0\n    \tendif\n    \tif(gkbuttonBval==15)then\n    \t\tzaw\ta3*a4, 0\n    \tendif\n    \tif(gkbuttonBval==16)then\n    \t\tzaw\ta5*a6, 0\n    \tendif\n    \tif(gkbuttonBval==17)then\n    \t\tzaw\ta7*a8, 0\n    \tendif\n    /*\n    \tkrms1 rms\ta1\n    \tkrms2\trms\ta2\n    \tkrms3\trms\ta3\n    \tkrms4\trms\ta4\n    \tkrms5\trms\ta5\n    \tkrms6\trms\ta6\n    \tprintk 2,krms1\n    \tprintk 2,krms2,2\n    \tprintk 2,krms3,3\n    \tprintk 2,krms4,4\n    \tprintk 2,krms5,5\n    \tprintk 2,krms6,6\n    */\n    endin\n    \n    instr 70\n    \tkinterval\t\tinit\t\t10\n    \tktrig\t\t\t\tinit\t\t0\n    \tkduration\t\tinit\t\t10\n    \t;if(ktrig==0) then\n    \t\tevent \"i\", 10, 0, \t\t\t\tkduration, \t\t\t0.1,\t100, 20, 1\n    \t\tevent \"i\", 10, kduration,\t\tkduration,\t\t\t 0.1, \t200, 15, 6\n    \t\tevent \"i\", 10, 2*kduration,\tkduration, \t\t\t0.1, 400, 5, 25\n    \t\t\t\tktrig\t\t\t=\t\t1\n    \t;endif\n    \tturnoff\n    endin\n    \n    /* instr 71 plays a note:\n    ;p3\tduration\n    ;p4\tamplitude\n    ;p5\tstarting pitch (Hz)\n    ;p6\tlowest possible Hz for LFO mixed signal (affecting amplitude envelope)\n    ;p7\thighest possible Hz for LFO mixed signal (affecting amplitude envelope)\n    ;p8\tmaster envelope rise (fraction of p3 - 0.0001 to 0.45)\n    ;p9\tmaster envelope decay (fraction of p3 - 0.0001 to 0.45)\n    */\n    instr 71\t;plays complex wave form, involving multiple LFOs\n    \tseed\t0\n    \tktrig\t\t\tinit\t\t0\n    \tif(ktrig == 0) then\n    \t\toutvalue \"instrument\",71\n    \t\tkrisefoo\t\t=\t\tp8\t;unload p8 here, not used in this version\n    \t\tkdecayfoo\t=\t\tp9\t;unload p9, not used in this version\n    \t\tiAmp\t\t\tinit\tp4\n    \t\tiBaseCps\t\t=\t\tp5\n    \t\tkBaseCps\t\t=\t\tiBaseCps\n    \t\tkmasterenv\tinit\t1\n    \t\tktrig \t\t= \t\t1\n    \t\tkenv1\t\t\t=\t\t(p7-p6)/2\n    \t\tkenv2\t\t\t=\t\t(p7-p6)/2\n    \t\tkenv3\t\t\t=\t\t(p7-p6)/2\n    \t\tkenv4\t\t\t=\t\t(p7-p6)/2\n    \tendif\n    ;master volume controlled by wiimote pitch\n    \tkmasterenv\t= gkpitchval;\texpinterpolate\t\t1,0.1,1,0,gkpitchval;\t=\tgkpitchval\t\t\t;linen\t\t1, p8*p3, p3, p9*p3 \n    \tif(kmasterenv<=0.10)then\n    \t\tkmasterenv = 0\n    \tendif\n    \t;printk 1,kmasterenv\n    \t;koddeven\t\toddeven\tgkbuttonBval\n    \t;use roll to adjust LFO if gkbuttonBval is even\n    \t;if(koddeven==0)then\n    \t\tkBaseCps\t\tlinearinterpolate\t\tp5*2, p5/2, 1, 0 \t, gkncrollval\n    \t\toutvalue\t\t\"ncroll\", kBaseCps\n    \t\tkenv1aHz\t\texpinterpolate\t\tp7,p6,1,0,gkrollval\n    \t\tif(kenv1aHz<0.5)then\n    \t\t\tkenv1aHz=0\t;force to no LFO if already very slow\n    \t\tendif\n    \t\tkenv1\t\t\toscil\t\t1, kenv1aHz, 1\n    \t\tkenv2aHz\t\texpinterpolate\t\tp7*1.5,p6,1,0,gkrollval\n    \t\tif(kenv2aHz<0.5)then\n    \t\t\tkenv2aHz=0\t;force to no LFO if already very slow\n    \t\tendif\n    \t\tkenv2\t\t\toscil\t\t1, kenv2aHz, 1\n    \t\tkenv3aHz\t\texpinterpolate\t\tp7,p6*1.5,1,0,gkrollval\n    \t\tif(kenv3aHz<0.5)then\n    \t\t\tkenv3aHz=0\t;force to no LFO if already very slow\n    \t\tendif\n    \t\tkenv3\t\t\toscil\t\t1, kenv3aHz, 1\n    \t\tkenv4aHz\t\texpinterpolate\t\tp7*1.5,p6*1.5,1,0,gkrollval\n    \t\tif(kenv4aHz<0.5)then\n    \t\t\tkenv4aHz=0\t;force to no LFO if already very slow\n    \t\tendif\n    \t\tkenv4\t\t\toscil\t\t1, kenv4aHz, 1\n    \t;endif\n    \t;use roll to adjust pitch if gkbuttonBval is odd\n    \t;\tif(koddeven == 1) then\n    ;\t\tkBaseCps\t\tlinearinterpolate\t\tp5*2, p5/2, 1, 0 \t, gkrollval\n    \t\tkenv1\t\t\toscil\t\t1, kenv1aHz, 1\n    \t\tkenv2\t\t\toscil\t\t1, kenv2aHz, 1\n    \t\tkenv3\t\t\toscil\t\t1, kenv3aHz, 1\n    \t\tkenv4\t\t\toscil\t\t1, kenv4aHz, 1\n    ;\tendif\n    \n    \taSig1 oscili kmasterenv* kenv1 *iAmp, kBaseCps, 1\n    \taSig2 oscili kmasterenv* kenv2 *iAmp, kBaseCps, 2\n    \taSig3 oscili kmasterenv* kenv3 *iAmp, kBaseCps, 3\n    \taSig4 oscili kmasterenv* kenv4 *iAmp, kBaseCps, 4\n    \tzawm (aSig1 + aSig2 + aSig3 + aSig4)/3, 0, 1\n    endin\n    \n    instr 80\t;plays a note\n    \tktrig\t\tinit\t1\n    \tgifreqfn\tinit\t12\n    \tgiampfn\tinit\t13\n    \tif(ktrig==1)then\n    \t\tkindex\t=\t0\n    \t\tidiminisher\t=\t0.05\n    \t\tkupperamp\tinit\t1\n    \t\tklowerfreq\tinit\t1\n    \t\tloopstart:\n    \t\t\t;set of random partials (multiples of fundamental)\n    \t\t\tktemp\t\t\trandom\tklowerfreq,klowerfreq*2\n    \t\t\tklowerfreq\t=\t\t\tklowerfreq*(1+idiminisher)\n    ;\t\t\ttablew\t\tktemp,\tkindex, gifreqfn\t;set of random amplitudes for partials\n    \t\t\ttablew\t\tkindex+1,\tkindex, gifreqfn\t;partials 1,2,3,...\n    ;\t\t\ttablew\t\t2*kindex+1,\tkindex, gifreqfn\t;partials 1,3,5,...\n    ;\t\t\ttablew\t\t2*kindex,\tkindex, gifreqfn\t;partials 1,2,4,6,,...\n    \t\t\tktemp\t\t\trandom\t0,kupperamp\t;get a random number\n    \t\t\tkupperamp\t=\t\t\tkupperamp * (1-idiminisher)\n    \t\t\ttablew\t\t\tktemp,\tkindex, giampfn\t;stored in 2nd set of 16 locations\n    \t\t\t;printk2 kindex\n    \t\t\t;kfoo\t\t\ttab\t\tkindex, gifreqfn\n    \t\t\t;printk2\tkfoo,5\n    \t\t\t;kfoo\t\t\ttab\t\tkindex, giampfn\n    \t\t\t;printk2\tkfoo, 10\n    \t\t\tkindex\t=\tkindex + 1\n    \t\t\tif(kindex<=15) kgoto loopstart\n    \t\tloopover:\n    \t\tevent\t\"i\", 85, 0, 8888\n    \t\tevent\t\"i\", 85, 0, 8888\t;start two voices for more randomness\n    \t\tktrig = 0\n    \tendif\n    \tendofinstr:\n    endin\n    \n    /*\n    instr 81\t;flop flag to vary partial hz\n    \tktrig\tinit 0\n    \tif (ktrig==0)then\n    \t\tgkpartialhzvary\t=\t-gkpartialhzvary\n    \t\tktrig\t\t\t\t\t=\t1\n    \tendif\n    endin\n    */\n    ;p4\tfreq of fundamental (not used)\n    ;p5 number of high-order partials to be tweaked (not used)\n    instr 85\t\t;plays sound and varies hz and amplitude of partials (uses adsynt)\n    ;print p4, p5\n    \tktrig\t\t\t\t\tinit\t0\n    \tif(ktrig==0)then\n    \t\toutvalue\t\t\t\t\"instrument\", 85\n    \t\tktrig\t=\t1\n    \tendif\n    \tkdelaycnt\t\t\tinit\t0\n    \tkdelayamt\t\t\tlinearinterpolate\t\t0,300,20,0,gkUPcount ;the higher the count, the shorter the delay\n    \tkdelayamt\t\t\trandom\tkdelayamt*(1-(1/2)), kdelayamt*(1+(1/2))\n    \tkdelaytotal\t\t\tinit 0\n    \t\t/*\n    \t\tkkcount\t\t\t\tinit 0\n    \t\tkkcount\t\t\t\t=\tkkcount+1\n    \t\tkdelaytotal\t=\tkdelaytotal+kdelayamt\n    \t\tkdelayaverage\t\t=\tkdelaytotal/kkcount\n    \t\tprintk 1,kdelayamt\n    \t\tprintk 1,kdelayaverage, 5\n    \t\t*/\n    \tknumberpartials\tinit\t12\n    \tkstartpartial\t=\t16-knumberpartials\n    \t;kperturbationraw\t=\t\t\tgkUPcount\n    \t;printk 4,gkUPcount\n    \t;ktemp\t\t\t\t\t=\t\t\tkperturbationraw\n    \tkperturbation\t\tlinearinterpolate\t 1,0,15,0,gkUPcount\n    \tkperturbation\t\tlimit\tkperturbation, 0,1\n    \t;printk 4,kperturbation,4 \n    \tkendpartial\t\tinit\t15\n    \tkamp\t\tinit\t0.1\n    \tkfreq01\tlinearinterpolate\t\t300,30, 1, 0, gkrollval\n    \tkcps\t\t=\t\t\tkfreq01\n    \toutvalue \"roll\",kcps\n    \tkcps\t\tfindentry\tkcps, gkpitchtable\t;constrain pitch to current temperament table\n    \tiwfn\t\tinit\t3\t\t;square wave\n    \ticnt\t\tinit\t15\n    \tiphs\t\tinit\t0\n    \tkenv\t\tlinen\t\t1, 0.1, p3, 0.1\n    \tkindex\t=\tkstartpartial\n    \tif(kdelaycnt<kdelayamt)kgoto loopend\n    \tkdelaycnt\t=\t0\n    \tloopstart:\n    \t\t;gkpartialhzvary\tinit\t1\t;1=don't vary partial hz; -1=vary partial hz\n    \t\tif(gkpartialhzvary==-1)then\n    \t\t\tkfrqincr\t\trandom3\t;\t-kperturbation, kperturbation\n    \t\t\tkfrqtmp\ttab\t\tkindex, gifreqfn\n    \t\t\tkfrqtmp\t=\t\t\tkfrqtmp + kfrqincr*(kperturbation)\n    \t\t\tkfrqtmp\tlimit\t\tkfrqtmp,1,16\n    \t\t\ttablew\tkfrqtmp, kindex, gifreqfn\n    \t\tendif\n    \t\tkincr\t\t\t\trandom3\n    \t\tkamptmp\ttab\t\tkindex, giampfn\n    ;printk 4,kamptmp,7\n    \t\tkamptmp\t=\t\t\tkamptmp + kincr*(kperturbation)\n    \t\tkamptmp\tlimit\t\tkamptmp,0,2\n    ;printk 4,kamptmp,10\n    \t\ttablew\tkamptmp, kindex, giampfn\n    ;printk 2,kindex\n    ;printk 2,kamptmp,5\n    \t\tkindex\t=\t\t\tkindex+1\n    \t\tif(kindex<=kendpartial)kgoto loopstart\n    \tloopend:\n    \tkdelaycnt\t=\tkdelaycnt + 1\n    \t;printk\t1,klineup\n    \t;note scaling ensures the wiimote held in a generally down\n    \t; position achieves mute\n    \tkslider\tlinearinterpolate\t\t1,0,1,0,gkpitchval\t;master volume\n    \tif(kslider<0.1)then\n    \t\tkslider=0\n    \tendif\n    \tares\t\tadsynt kslider*kamp, kcps, iwfn, gifreqfn, giampfn, icnt, iphs\n    \tares2\t\tadsynt kslider*kamp, kcps, 1, gifreqfn, giampfn, icnt, iphs\n    \tzaw\t\t(ares+ares2)*kenv/2, 0\n    endin\n    \n    instr 90\t;plays simple waveforms using pitch AND roll to derive hz \n    \tktrig\t\tinit 1\n    \tif(ktrig==1) then\n    \t\toutvalue\t\"instrument\",90\n    \t\toutvalue \"rolldisplay\",1\t;display waveform for roll\n    \t\toutvalue\t\"pitchdisplay\",1\t;display waveform for pitch\n    \t\tktrig=0\n    \tendif\n    \tkpitch\tlinearinterpolate\t\t10,1,1,0, gkpitchval\n    \tkroll\t\tlinearinterpolate\t\t200,40,1,0, gkrollval\n    \tkamp\t\t=\t\t\t\t\t\t\tgkncpitchval\n    \tklfohz\texpinterpolate\t\t12,0.5,0,1,gkncrollval\n    \tif(klfohz<0.75)then\n    \t\tklfohz=0\n    \tendif\n    \tif(kamp<0.07)then\n    \t\tkamp\t=\t0\n    \tendif\n    \toutvalue\t\"roll\",kroll\n    \toutvalue\t\"pitch\",kpitch\n    \toutvalue\t\"ncroll\", klfohz\n    \toutvalue\t\"ncpitch\", kamp\n    \tklfo\toscili\t1,klfohz,1\n    \tafm1\toscili\tklfo*kamp, kpitch*kroll, 11\n    \tzaw\tafm1, 0\n    endin\n    \n    instr 91\t;plays simple waveforms using FM\n    \tktrig\t\tinit 1\n    \tif(ktrig==1) then\n    \t\toutvalue\t\"instrument\",91\n    \t\toutvalue \"rolldisplay\",1\t;display waveform for roll\n    \t\toutvalue\t\"pitchdisplay\",1\t;display waveform for pitch\n    \t\tktrig=0\n    \tendif\n    \t;***********************\n    \t;following code implements LFO and pitchbend, using NUNCHUK joystick\n    \tkjoyY\t\t=\t\t\tgkncjoyY\t;use joystick UP for LFO hz\n    \tif(kjoyY<0.5)then\n    \t\tkjoyY\t=\t0.5\n    \tendif\n    \tklfohz\tlinearinterpolate\t\t10, 0, 1, 0.5, kjoyY\n    \tkvibr\t\toscili\t1, klfohz, 1, 0.25\t\t;simple sine wave vibrato\n    \tkbend\t\tlinearinterpolate\t\t1.3, 0.7, 1, 0, gkncjoyX\n    \t;************************\n    \t\tkcar\t\tlinearinterpolate\t\t10,\t0.1,\t1,\t0, gkpitchval\n    \tkcar\t\tfindentry\tkcar, gkpitchtable\n    \tkcps\t\tlinearinterpolate\t\t200,\t20,\t1,\t0, gkrollval\n    \tkcps\t\tfindentry\tkcps, gkpitchtable\n    \tkmod\t\tlinearinterpolate\t\t10,\t0.0,\t\t1,\t0, gkncpitchval\n    \tkmod\t\tfindentry\tkmod, gkpitchtable\n    \tkndx\t\tlinearinterpolate\t\t10,\t0.1,\t\t1,\t0, gkncrollval\n    \tkndx\t\tfindentry\tkndx, gkpitchtable\n    \tkamp\t\t=\t0.1\n    \tif\t(kcar<1)then\n    \t\tkamp\t=\t0\n    \tendif\n    \toutvalue\t\"roll\",kcps\n    \toutvalue\t\"pitch\",kcar\n    \toutvalue\t\"ncroll\",kndx\n    \toutvalue\t\"ncpitch\",kmod\n    \toutvalue \"ncjoyxval\",gkncjoyX\n    \toutvalue\t\"ncjoyyval\",gkncjoyY\n    \tafm1 foscil kamp*kvibr, kcps*kbend, kcar, kmod, kndx, 1\t;ifn [, iphs]\n    \tzaw\tafm1, 0\n    endin\n    \n    instr 100\t;playsounds\t;Mix active zak a-rate signals and output them.\n    \ta0\tzar\t0\n    \t;a1\tzar\t1\n    \t;a2\tzar\t2\n    \tgkrevtime\tinvalue \"reverbtime\"\n    \tkrevtime\tlinearinterpolate 2,0,1,0,gkrevtime\n    \tkrevtime\tlimit krevtime, 0, 2\n    \toutvalue\t\"reverbtimedisplay\",krevtime\n    \tareverb\treverb a0, krevtime\n    \tout\t\tgkmaster * (a0 + areverb) * (2/3); + a1 + a2)\n    \tzacl\t\t0,2\t;clear zak a-rate signals for next k-cycle\n    endin\n    \n    instr\t500\t;simulates a patch change\n    ;p4 = desired patch number\n    \tktrig\tinit 0\n    \tif(ktrig==0) then\n    \t\tgkpatch\t=\tp4\n    \t\tgkstartduplicatepatch\t=\t0\t;ensures we shut off prev patch\n    \t\tktrig = 1\n    \t\tturnoff\n    \tendif\n    endin\n    \n    instr\t501\t;enters auto mode == creates timed patch changes\n    \tktrig\t\t\tinit\t1\n    \tkinterval\tinvalue \"autointerval\"\n    \tif(ktrig == 1) then\n    \t\tturnoff2\t51, 0,0\n    \t\tevent\t\"i\", 51\t,0, 0.5, 0.01\t;turn master fader to moderately audible\n    \t\tevent \"i\", 500, 0*kinterval,\t\tkinterval, 2\n    \t\tevent \"i\", 500, 1*kinterval,\t\tkinterval, 6\n    \t\tevent \"i\", 500, 2*kinterval,\t\tkinterval, 9\n    \t\tevent \"i\", 500, 3*kinterval,\t\tkinterval, 22\n    \t\tevent \"i\", 500, 4*kinterval,\t\tkinterval, 19\n    \t\tevent \"i\", 500, 5*kinterval,\t\tkinterval, 7\n    \t\tevent \"i\", 500, 6*kinterval,\t\tkinterval, 8\n    \t\tevent \"i\", 500, 7*kinterval,\t\tkinterval, 0\n    \t\tktrig\t\t=\t0\n    \tendif\n    endin\n    \n    instr 900\t;manage patches\n    \t;if we have a new patch, OR if we need to start a duplicate patch...\n    \tif( (gkpatchsave!=gkpatch) || (gkstartduplicatepatch==1) ) then\n    \t\t;if we have a new patch BUT we don't need to start a duplicate patch...\n    \t\tif( (gkpatchsave!=gkpatch) && (gkstartduplicatepatch==0) ) then\n    \t\t\tturnoff2\t 9, 0, 0\n    \t\t\t;turnoff2\t10, 0, 1\t;turnoff allowing release\n    \t\t\t;turnoff2\t12, 0, 0\n    \t\t\t;test whether previous patch requires that instr 12 be turned off now\n    \t\t\t; or whether 12 will turn itself off\n    \t\t\tgk12offlater\tinit\t0\n    \t\t\tif(gk12offlater\t==\t1)then\n    \t\t\t\tturnoff2 12, 0, 0\n    \t\t\t\tgk12offlater = 0\n    \t\t\tendif\n    \n    \t\t\tturnoff2\t16, 0, 0\n    \t\t\tturnoff2\t24, 0, 0\n    \t\t\t;turnoff2\t25, 0, 0\n    \t\t\t;turnoff2\t27, 0, 0\n    \t\t\tturnoff2\t30, 0, 0\n    \t\t\tturnoff2 39,0,0\n    \t\t\t;turnoff2\t40, 0, 0\n    \t\t\t;turnoff2\t45, 0, 0\n    \t\t\tturnoff2\t46, 0, 0\t;turns off instrument that fires up instr 45, but not instr 45 itself\n    \t\t\tturnoff2\t60, 0, 0\n    \t\t\tturnoff2\t71, 0, 0\n    \t\t\tturnoff2\t80, 0, 0\n    \t\t\tturnoff2\t85, 0, 0\n    \t\t\tturnoff2\t90, 0, 0\n    \t\t\tturnoff2\t91, 0, 0\n    \t\t\toutvalue \"instrumentinvoker\",9\n    \t\tendif\t\n    \t;at this point we may need to start a new patch OR we may need to start a duplicate patch\t\n    /*\n    For instr 10--\n    p4\ttable number for hz assigned to roll (if -1 or 0, roll is assigned to a constant value of 1)\n    p5\ttable number for hz assigned to yaw (if -1 or 0, yaw is assigned to a constant value of 1)\n    p6\ttable number for hz assigned to pitch (if -1 or 0, pitch is assigned to a constant value of 1)\n    p7\tindex to zak a-rate signal for storing the result \n    p8 =0: take accels from wiimote; =1: take accels from NUNCHUK\n    */\n    /*\n    Note regarding wiimote LEDs:\n    The four LEDs represent a binary number, read left to right (low order to high order), \n    \tinstead of the usual right to left (lowest order digit on the right.) Thus, sending 5 to the wiimote\n    \tresults in the lights looking like 1010 instead of the expected 0101. So we will use the following table\n    \tto force the lights to resemble conventional binary numbers:\n    \t0000\t0\n    \t0001\t8\n    \t0010\t4\n    \t0011\t12\n    \t0100\t2\n    \t0101\t10\n    \t0110\t6\n    \t0111\t14\n    \t1000\t1\n    \t1001\t9\n    \t1010\t5\n    \t1011\t13\n    \t1100\t3\n    \t1101\t11\n    \t1110\t7\n    \t1111\t15\n    */\n    \tgiLED0000\tinit\t0\n    \tgiLED0001\tinit\t8\n    \tgiLED0010\tinit\t4\n    \tgiLED0011\tinit\t12\n    \tgiLED0100\tinit\t2\n    \tgiLED0101\tinit\t10\n    \tgiLED0110\tinit\t6\n    \tgiLED0111\tinit\t14\n    \tgiLED1000\tinit\t1\n    \tgiLED1001\tinit\t9\n    \tgiLED1010\tinit\t5\n    \tgiLED1011\tinit\t13\n    \tgiLED1100\tinit\t3\n    \tgiLED1101\tinit\t11\n    \tgiLED1110\tinit\t7\n    \tgiLED1111\tinit\t15\n    \t\tpatch0:\n    \t\tif(gkpatch==0)then\n    \t\t\tOSCsend 0, \"\", 8000, \"/wii/led/1\", \"i\", giLED0000\t;light up LEDs to show patch group 1\n    \t\tendif\t\t\t\n    \t\tpatch1:\n    \t\tkpatchID\t\t=\t1\n    \t\tkzakIndexSetter\t=\t0\t;points to a k-rate zak array variable\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0001\t;light up LEDs to show patch group 1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\t;event \"i\", 10, 0, 8888, 1, 0, 0, 0, 0; start patch, listen to wiimote accels\n    \t\t\t\tevent \"i\", 9, 0, 8888, 1, 0, 0\n    \t\t\t\tgkstartduplicatepatch = 2\t;no need to start duplicate patches - instr 9 already does this\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch2:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0001\t;light up LEDs to show patch group 1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\t;event \"i\", 10, 0, 8888, 3, 0, 0, 0, 0; start patch, listen to wiimote accels\n    \t\t\t\tevent \"i\", 9, 0, 8888, 3, 0, 0\n    \t\t\t\tgkstartduplicatepatch = 2\t;no need to start duplicate patches - instr 9 already does this\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0001\t;light up LEDs to show patch group 1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\t;event \"i\", 10, 0, 8888, 11, 0, 0, 0, 0; start patch, listen to wiimote accels\n    \t\t\t\tevent \"i\", 9, 0, 8888, 11, 0, 0\n    \t\t\t\tgkstartduplicatepatch = 2\t;no need to start duplicate patches - instr 9 already does this\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tpatch4:\t\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0001\t;light up LEDs to show patch group 1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\t;event \"i\", 10, 0, 8888, 8, -1, 0, 0, 0; start patch, listen to wiimote accels\n    \t\t\t\tevent \"i\", 9, 0, 8888, 8, -1, 0\n    \t\t\t\tgkstartduplicatepatch = 2\t;no need to start duplicate patches - instr 9 already does this\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tpatch5:\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0001\t;light up LEDs to show patch group 1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\t;event \"i\", 10, 0, 8888, 8, -1, 0, 0, 0; start patch, listen to wiimote accels\n    \t\t\t\tevent \"i\", 9, 0, 8888, -2, -1, 0\n    \t\t\t\tgkstartduplicatepatch = 2\t;no need to start duplicate patches - instr 9 already does this\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch6:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0010\t;light up LEDs to show patch group 2\n    \t\t\tkactive active 30\n    \t\t\tif(kactive<=0) then\n    \t\t\t\tevent \"i\", 30, 0, 8888, 68 ; cascades of tomtom notes\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch7:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0010\t;light up LEDs to show which patch group we are in\n    \t\t\tkactive active 30\n    \t\t\tif(kactive<=0) then\n    \t\t\t\tevent \"i\", 30, 0, 8888, 60 ; cascades of toy piano notes\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch8:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0010\t;light up LEDs to show which patch group we are in\n    \t\t\tkactive active 30\n    \t\t\tif(kactive<=0) then\n    \t\t\t\tevent \"i\", 30, 0, 8888, 71 ; cascades of Lute notes\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch9:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0010\t;light up LEDs to show which patch group we are in\n    \t\t\tkactive active 30\n    \t\t\tif(kactive<=0) then\n    \t\t\t\tevent \"i\", 30, 0, 8888, 70 ; cascades of clavichord notes\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tpatch10:\t; play samples repeatedly\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0011\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 39, 0, 8888, 68, -1, 0 ;invoke notes repeatedly (until patch is vacated)\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 39, 0, 8888, 68, -1, 1 ;invoke notes repeatedly (until patch is vacated)\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tpatch11:\t;\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0011\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 39, 0, 8888, 60, -1, 0 ;invoke notes repeatedly (until patch is vacated)\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 39, 0, 8888, 60, -1, 1 ;invoke notes repeatedly (until patch is vacated)\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch12:\t;\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 11, 0, 8888, 68, -1, -1, 0\t;play tom tom sample; start patch, listen to wiimote accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch13:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 11, 0, 8888, 69, -1, -1, 0\t;play marimba sample; start patch, listen to wiimote accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch14:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 11, 0, 8888, 60, -1, -1, 0\t;play toy piano sample; start patch, listen to wiimote accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch15:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 71, -1, -1\t, 0;play lute sample; start patch, listen to wiimote accels\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 71, -1, -1\t, 1;play lute sample; start patch, listen to NUNCHUK accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tpatch16:\t\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 70, -1, -1, 0\t;play clavichord sample; start patch, listen to wiimote accels\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 70, -1, -1, 1;play clavichord thrush sample; start patch, listen to NUNCHUK accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 72, -1, -1, 0\t;play cymbal sample; start patch, listen to wiimote accels\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 72, -1, -1, 1;play cymbal sample; start patch, listen to NUNCHUK accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tpatch18:\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0100\t;light up LEDs to show which patch group we are in\n    \t\t\tgk12offlater\t=\t1\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 69, -1, -1, 0\t;play marimba sample; start patch, listen to wiimote accels\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 12, 0, 8888, 69, -1, -1, 1\t;play marimba sample; start patch, listen to NUNCHUK accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tpatch19:\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0101\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 16, 0, 8888, 70, -1, -1, 60, 0\t;play clavichord and toy piano\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 16, 0, 8888, 68, -1, -1, 69, 1\t;play tom tom and marimba\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0101\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 16, 0, 8888, 70, -1, -1, 71, 0\t;play clavichord and lute\n    \t\t\tendif\n    \t\t\tif(gkstartduplicatepatch==1)then\n    \t\t\t\tevent \"i\", 16, 0, 8888, 69, -1, -1, 68, 1\t;play jazz cymbal and marimba\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch21:\t\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\t\n    \t\t\tgkpatchGroupID = giLED0110\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 24, 0, 8888, 65, 42463, 44060, 0.0045266;, 0 ;bass clarinet, looped; start patch, listen to wiimote accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch22:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0110\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 24,  0, 8888, 67, 52783, 132046, 0.0025;,0\t;0.02125 ;flute, looped start patch, listen to wiimote accels\n    \t\t\t\tgkstartduplicatepatch = 2\n    \t\t\tendif\n    \t\tendif\n    \t\tpatch23:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    /* instr 71 plays a note:\n    ;p3\tduration\n    ;p4\tamplitude\n    ;p5\tpitch (Hz)\n    ;p6\tlowest possible Hz for LFO mixed signal (affecting amplitude envelope)\n    ;p7\thighest possible Hz for LFO mixed signal (affecting amplitude envelope)\n    ;p8\tmaster envelope rise (fraction of p3 - 0.0001 to 0.45)\n    ;p9 master envelope decay (fraction of p3 - 0.0001 to 0.45)\n    */\n    \t\tkrandratio\trandom\t0,1\n    \t\tkfreqbase\t=\t\t\t75\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED0111\t;light up LEDs to show which patch group we are in\n    \t\t\tevent \"i\", 71, 0, 8888, 1, kfreqbase*(1+krandratio), \t0.2, \t10*(1+krandratio), 0, 0\n    \t\t\tevent \"i\", 71, 0, 8888, 1, kfreqbase*(1+2*krandratio),\t0.2, \t10*(1+2*krandratio), 0, 0\n    \t\t\tevent \"i\", 71, 0, 8888, 1, kfreqbase*(1+3*krandratio),0.2, 10*(1+3*krandratio), 0, 0\n    \t\t\tevent \"i\", 71, 0, 8888, 1, kfreqbase*(1+4*krandratio),0.2, \t10*(1+4*krandratio)*(1.18), 0, 0\n    \t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\tendif\n    \t\tpatch24:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED1000\t;light up LEDs to show which patch group we are in\n    \t\t\tevent \"i\", 80,  0, 8888 ;sound with modified hz and ampl of partials\n    \t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\tendif\n    \n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tgkzakIndexMax\t=\tkzakIndexSetter\t\t;remember index to final entry\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED1001\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 91,  0, 8888 ;primitive FM\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\t\n    \t\tpatch26:\n    \t\tkpatchID\t=\tkpatchID+1\n    \t\t;store starting patch # of this group of patches in next zak array variable\n    \t\tzkw\tkpatchID, kzakIndexSetter\n    \t\tkzakIndexSetter\t\t=\tkzakIndexSetter + 1\n    \t\tif(gkpatch == kpatchID) then\n    \t\t\tgkpatchGroupID = giLED1010\t;light up LEDs to show which patch group we are in\n    \t\t\tif(gkstartduplicatepatch==0)then\n    \t\t\t\tevent \"i\", 46,  0, 8888, 3 ;routine that fires up notes when button C is pressed\n    \t\t\t\tgkstartduplicatepatch = 2\t;prevents more copies from being started\n    \t\t\tendif\n    \t\tendif\n    \t\tgkhighestpatch\t\t=\tkpatchID\n    \tendif\n    \tgkpatchsave\t\t=\tgkpatch\n    \toutvalue \"patch\", gkpatch\t;display current patch number\n    endin\n    \n    ;old \"sinefreqdisplay\" is now \"roll\" (real-time display of value derived from roll, i.e., gk1freq)\n    ;old \"squarefreqdisplay\" is now \"pitch\" (real-time display of value derived from pitch, i.e., gk2freq)\n    ;old \"sawfreqdisplay\" is now \"yaw\" (real-time display of value derived from yaw, i.e., gk3freq)\n    ;\n    ;k1 is mapped to roll\n    ;k2 is mapped to pitch\n    ;k3 is mapped to yaw\n    ;kA is mapped to tables for k1 (roll):   0=no table, 1=sine, 2=square, 3=sawtooth\n    ;kB is mapped to tables for k2 (pitch) : 0=no table, 1=sine, 2=square, 3=sawtooth\n    ;kC is mapped to tables for k3 (yaw)   : 0=no table, 1=sine, 2=square, 3=sawtooth\n    /*\n    Assign pitch, yaw and roll to frequencies of independent a-rate signals\n    p3\tduration\n    p4\ttable number for hz assigned to roll (if -1 or 0, roll is assigned to a constant value of 1)\n    p5\ttable number for hz assigned to yaw (if -1 or 0, yaw is assigned to a constant value of 1)\n    p6\ttable number for hz assigned to pitch (if -1 or 0, pitch is assigned to a constant value of 1)\n    p7\tindex to zak a-rate signal for storing the result \n    p8\t0: listen to wiimote accels; 1: listen to NUNCHUK accels\n    Pitches and amplitudes come from dynamically varying wwimote signals, already scaled by instr 3\n    example call: event \"i\", 10, 0, 8888, 1, 0, 0, 0, 1\t; start patch 1, listen to NUNCHUK accels\n    */\n    \n    \n    ;----------------------------------------------------------------------\n    \n    </CsInstruments>\n    <CsScore>\n    ;f1 0 512 10 1\n    f1 0 131073 \t\t9 1 1 0\t\t\t\t\t;single sine tone\n    f2 0 17 \t\t\t7 1 10 1 1 0 1 -1 4\t\t;almost always on function\n    f3 0 513 \t\t\t7 1 256 1 1 -1 0 -1 255 -1 1\t;square wave\n    f4 0 513 \t\t\t-7\t1 255 \t1 1\t\t0 1\t\t0 254\t 0\t;unipolar square wave (varies from 0 to 1)\n    f8 0 513 \t\t\t7 1 512 -1 1 \t\t\t\t;saw tooth falling\n    f10 0 257\t\t\t7 0 64 1 32 0 32 0 64 -1 64 0\t;straight line, roughly like sine wave\n    f11 0 262145\t\t9  1 10 0   2 17 0   3 16 0   4 15 0\t5 14 0   6 13 0  7 12 0  8 11 0  9 11 0  10 11 0  11 11 0  12 11 0;fundamental, 1st 11 partials\n    f12\t0\t256\t2\t0 0 0 0 0\t\t;frequencies of partials\n    f13\t0\t256\t2\t0 0 0 0 0\t\t;amplitudes of partials (multiples of kamp?\n    f61 0 0\t\t\t1\t\"./sound/BassClarinetA3.aif\" 0 4 0\n    f60 0 0\t\t\t1\t\"./sound/Toy_d4.aif\" 0 4 0\n    f21 0 0 \t\t\t1\t\"./sound/prayerbowlbowed_04_Clean41K.AIF\" 0 4 0\t;prayer bowl\n    f49 0 0\t\t\t1\t\"./sound/hermitthrush1_41K.aif\" 0 4 0\n    f55 0 0\t\t\t1\t\"./sound/random4noiseA.aif\" 0 4 0\n    f47 0 0\t\t\t1\t\"./sound/killerWhale41K.aif\" 0 4 0\n    f65 0 0\t\t\t1\t\"./sound/BassClarinetA3_42463_45549.aif\" 0 4 0\n    f66 0 0\t\t\t1\t\"./sound/pianoA#0_46613_48261_1.708.aif\" 0 4 0\n    f67 0 0\t\t\t1\t\"./sound/flutevibrA4_52783_132046_1.0.AIF\" 0 4 0\n    f68 0 0\t\t\t1\t\"./sound/tomtom.aif\" 0 4 0\n    f69 0 0\t\t\t1\t\"./sound/grMarimbaHard0144KB.aif\" 0 4 0\n    f70 0 0\t\t\t1\t\"./sound/clavichordC4Csound41K.aif\" 0 4 0\n    f71 0 0\t\t\t1\t\"./sound/RenLuteF341KB.aif\" 0 4 0\n    f72 0 0\t\t\t1\t\"./sound/jazzcymbal.aif\" 0 4 0\n    \n    f300 0 1024\t-23\t\"./data/equaltemperament.csv\"  ;gamut of pitches defining equal temperament\n    f301 0 1024\t-23\t\"./data/piercegamut.csv\"  ;gamut of pitches defining equal tempered Bohlen-Pierce temperament\n    f302 0 1024\t-23\t\"./data/perfectthirds.csv\"  ;gamut of pitches defining a succession of perfect thirds centered around 440\n    f303 0 1024\t-23\t\"./data/meantone.csv\"  ;gamut of pitches defining a meantone temperament\n    f304 0 256\t-23\t\"./data/rationalratios4.csv\" ;gamut of pitches derived from ratios of small integers (and octaves)\n    f305 0 256\t-23\t\"./data/rationalratiosnearequaltemps.csv\" ;gamut of pitches derived from ratios of small integers (and octaves)\n    \n    i 1\t\t\t\t\t0 88888\t;more than 24 hours\n    i 2\t\t\t\t\t0 88888\t;more than 24 hours\n    i 3\t\t\t\t \t0 88888\t;more than 24 hours\n    ;i 5\t\t\t\t\t0 88888\t;more than 24 hours\n    ;i 7\t\t\t\t\t0 88888\t;more than 24 hours\n    i 100\t\t\t\t\t0 88888\t;more than 24 hours\n    i 900\t\t\t\t\t0 88888\t;more than 24 hours\n    \n    \n    \n    </CsScore>\n    \n    </CsoundSynthesizer>\n    <bsbPanel>\n     <label>Widgets</label>\n     <objectName/>\n     <x>127</x>\n     <y>156</y>\n     <width>857</width>\n     <height>662</height>\n     <visible>true</visible>\n     <uuid/>\n     <bgcolor mode=\"background\">\n      <r>234</r>\n      <g>255</g>\n      <b>246</b>\n     </bgcolor>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>13</x>\n      <y>58</y>\n      <width>127</width>\n      <height>28</height>\n      <uuid>{4e99cf04-a713-48cd-bd27-dccc05cf7a5c}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1 frequency (ROLL)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>7</x>\n      <y>146</y>\n      <width>144</width>\n      <height>29</height>\n      <uuid>{99ea47bf-8732-4b97-a90d-f99f08aa510e}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>2 frequency (PITCH)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>20</x>\n      <y>248</y>\n      <width>118</width>\n      <height>26</height>\n      <uuid>{0880d998-fe52-4bd3-8564-5780d98e82a3}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>3 frequency (YAW)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>yaw</objectName>\n      <x>20</x>\n      <y>288</y>\n      <width>119</width>\n      <height>25</height>\n      <uuid>{9cde2987-8e28-40ee-9598-ff13f6d92d2c}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.002</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>pitch</objectName>\n      <x>18</x>\n      <y>185</y>\n      <width>115</width>\n      <height>29</height>\n      <uuid>{61ef1773-a484-4b9a-9000-e221d421f09d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.002</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>roll</objectName>\n      <x>18</x>\n      <y>92</y>\n      <width>116</width>\n      <height>34</height>\n      <uuid>{1b505f62-d739-4208-8e13-74c2059f7d07}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.920</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBKnob\">\n      <objectName>master</objectName>\n      <x>28</x>\n      <y>334</y>\n      <width>48</width>\n      <height>48</height>\n      <uuid>{3e4df53e-03e1-424b-8b4b-79f021c2c94b}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <minimum>0.00000000</minimum>\n      <maximum>1.00000000</maximum>\n      <value>0.00000000</value>\n      <mode>lin</mode>\n      <mouseControl act=\"jump\">continuous</mouseControl>\n      <resolution>0.01000000</resolution>\n      <randomizable group=\"0\">false</randomizable>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>92</x>\n      <y>339</y>\n      <width>146</width>\n      <height>72</height>\n      <uuid>{6dba5e9f-c83b-44d6-b497-b2ed0cf1f9ba}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Master volume:HOME mutes+ increases-decreases</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>309</x>\n      <y>342</y>\n      <width>112</width>\n      <height>27</height>\n      <uuid>{c4f60853-f734-41ed-ada0-c1dba00b3c1d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Current patch</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>patch</objectName>\n      <x>299</x>\n      <y>375</y>\n      <width>137</width>\n      <height>55</height>\n      <uuid>{9576e07f-b211-4858-9947-11a944d0f4d7}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>7.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>42</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>302</x>\n      <y>61</y>\n      <width>118</width>\n      <height>24</height>\n      <uuid>{84047c32-b096-4bb8-b302-aaa140e6c2c0}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>table for ROLL</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>rolldisplay</objectName>\n      <x>324</x>\n      <y>91</y>\n      <width>75</width>\n      <height>23</height>\n      <uuid>{8c452f64-cd4e-4750-b46f-c003f187afbe}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>pitchdisplay</objectName>\n      <x>331</x>\n      <y>192</y>\n      <width>75</width>\n      <height>23</height>\n      <uuid>{a017f9cb-f8b5-4f6f-a02a-e77062741319}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>316</x>\n      <y>162</y>\n      <width>104</width>\n      <height>25</height>\n      <uuid>{e9f283a4-fb37-433a-b2c1-e30c31dc14a9}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>table for PITCH</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>yawdisplay</objectName>\n      <x>333</x>\n      <y>297</y>\n      <width>75</width>\n      <height>23</height>\n      <uuid>{c6dfe54f-3960-469b-8e07-812b16b82888}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>315</x>\n      <y>252</y>\n      <width>111</width>\n      <height>40</height>\n      <uuid>{8afd8b8c-3184-4b8f-b406-d846ff60179c}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>table for YAW</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>549</x>\n      <y>449</y>\n      <width>72</width>\n      <height>27</height>\n      <uuid>{b52a6521-4a92-469a-86e3-2997322dc8b2}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>pitch table</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>temptable</objectName>\n      <x>548</x>\n      <y>480</y>\n      <width>72</width>\n      <height>27</height>\n      <uuid>{6e3b1daf-3ac3-49a7-bd8c-69c811f666c8}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>299.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>rollval</objectName>\n      <x>169</x>\n      <y>92</y>\n      <width>97</width>\n      <height>33</height>\n      <uuid>{151290f2-0c64-43b3-bbc6-60b00c792af9}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.494</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>170</x>\n      <y>58</y>\n      <width>96</width>\n      <height>28</height>\n      <uuid>{924c805b-81a8-4838-a357-9b2caede62d8}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>ROLL value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>pitchval</objectName>\n      <x>169</x>\n      <y>185</y>\n      <width>97</width>\n      <height>33</height>\n      <uuid>{c83db1d2-7c08-4b35-81df-4cfd0aa4930d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.486</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>165</x>\n      <y>148</y>\n      <width>95</width>\n      <height>29</height>\n      <uuid>{a65b87d9-1d54-4c5d-a227-11ad55996acb}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>PITCH value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>yawval</objectName>\n      <x>171</x>\n      <y>286</y>\n      <width>97</width>\n      <height>33</height>\n      <uuid>{4bbe8c53-ff19-4cac-bb30-67ddf4b0637d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.199</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>167</x>\n      <y>250</y>\n      <width>105</width>\n      <height>31</height>\n      <uuid>{f5a8b472-0bef-4ee4-9963-4383217f8501}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>YAW value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>accelval</objectName>\n      <x>462</x>\n      <y>379</y>\n      <width>79</width>\n      <height>32</height>\n      <uuid>{b194ed5b-418c-41e5-b5d0-b3541cb67903}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.200</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>458</x>\n      <y>346</y>\n      <width>107</width>\n      <height>27</height>\n      <uuid>{f42b7b12-28be-4d76-89d1-a32328aa918b}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>ACCEL value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>upcount</objectName>\n      <x>20</x>\n      <y>481</y>\n      <width>64</width>\n      <height>24</height>\n      <uuid>{90730238-33fb-4847-9041-574072941dc1}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>8</x>\n      <y>450</y>\n      <width>91</width>\n      <height>24</height>\n      <uuid>{3472e018-75bd-4aa7-a25e-1ce0d9aebfe7}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>UP count</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>gkmasterdisplay</objectName>\n      <x>19</x>\n      <y>386</y>\n      <width>64</width>\n      <height>24</height>\n      <uuid>{2152eba5-3139-405b-9520-12ac87f55129}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>gkmastersavedisplay</objectName>\n      <x>19</x>\n      <y>411</y>\n      <width>64</width>\n      <height>24</height>\n      <uuid>{11c07c68-6e76-41d0-927c-7abf745e8c16}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>buttonBval</objectName>\n      <x>216</x>\n      <y>553</y>\n      <width>48</width>\n      <height>23</height>\n      <uuid>{48444bc6-d9d2-4ce0-b958-9d078294d67b}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>224</x>\n      <y>580</y>\n      <width>33</width>\n      <height>25</height>\n      <uuid>{5d0e2a2a-deee-4b24-89ec-e065effa1da6}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>B</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>311</x>\n      <y>450</y>\n      <width>118</width>\n      <height>24</height>\n      <uuid>{3f1f05fa-26f7-4f2d-b653-901c152c01d3}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>instrument invoker</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>instrumentinvoker</objectName>\n      <x>330</x>\n      <y>480</y>\n      <width>81</width>\n      <height>27</height>\n      <uuid>{0484ce69-cb7f-4326-a5d6-94b49f6d943d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>9.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBButton\">\n      <objectName>button1</objectName>\n      <x>7</x>\n      <y>556</y>\n      <width>146</width>\n      <height>28</height>\n      <uuid>{ebb39008-90ef-49a6-bee1-0d49645ec272}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <type>event</type>\n      <pressedValue>1.00000000</pressedValue>\n      <stringvalue/>\n      <text>Auto patch sequencer</text>\n      <image>/</image>\n      <eventLine>i501 0 10</eventLine>\n      <latch>false</latch>\n      <latched>false</latched>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBScrollNumber\">\n      <objectName>autointerval</objectName>\n      <x>47</x>\n      <y>527</y>\n      <width>80</width>\n      <height>25</height>\n      <uuid>{04cfad3b-f9d2-4320-87d8-c54b5e3c9ea2}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <alignment>center</alignment>\n      <font>Arial</font>\n      <fontsize>10</fontsize>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"background\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <value>60.00000000</value>\n      <resolution>1.00000000</resolution>\n      <minimum>0.00000000</minimum>\n      <maximum>600.00000000</maximum>\n      <bordermode>border</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n      <randomizable group=\"0\">false</randomizable>\n      <mouseControl act=\"\"/>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>downcount</objectName>\n      <x>113</x>\n      <y>481</y>\n      <width>64</width>\n      <height>24</height>\n      <uuid>{ba446221-d207-46e6-962a-bd9c47c6ae0e}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>101</x>\n      <y>450</y>\n      <width>91</width>\n      <height>24</height>\n      <uuid>{30568433-8cfd-4c40-8421-f407bb44b402}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>DOWN count</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>updowncount</objectName>\n      <x>224</x>\n      <y>481</y>\n      <width>64</width>\n      <height>24</height>\n      <uuid>{0680972b-8acd-47d5-b3c3-2f0ac3bf9ab5}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>200</x>\n      <y>449</y>\n      <width>108</width>\n      <height>26</height>\n      <uuid>{4004e5ce-c95a-4134-9ce2-541e7205aa51}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>UP/DOWN count</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncrollval</objectName>\n      <x>610</x>\n      <y>99</y>\n      <width>124</width>\n      <height>34</height>\n      <uuid>{e9f4baa1-eff3-450e-b818-680d28f49c1d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.005</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>611</x>\n      <y>65</y>\n      <width>123</width>\n      <height>29</height>\n      <uuid>{4505530c-3f78-494a-b6ba-04a90df1b37a}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NC/ROLL value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncpitchval</objectName>\n      <x>610</x>\n      <y>192</y>\n      <width>124</width>\n      <height>34</height>\n      <uuid>{927d0e22-723f-4831-bf1f-e51ff58e19e0}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.924</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>612</x>\n      <y>160</y>\n      <width>122</width>\n      <height>30</height>\n      <uuid>{bfbd5318-31bb-4c79-b016-e81836bce5f0}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NC/PITCH value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncyawval</objectName>\n      <x>612</x>\n      <y>293</y>\n      <width>124</width>\n      <height>34</height>\n      <uuid>{4e577de4-0305-4b8d-84b3-119a2f0e3240}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.020</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>612</x>\n      <y>259</y>\n      <width>132</width>\n      <height>32</height>\n      <uuid>{ab634c16-8b9d-40d4-8c63-af6f59279259}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NC/YAW value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncaccelval</objectName>\n      <x>610</x>\n      <y>381</y>\n      <width>89</width>\n      <height>31</height>\n      <uuid>{7e8d8250-ff8a-4f10-9b41-129b8fda3976}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.199</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>606</x>\n      <y>348</y>\n      <width>117</width>\n      <height>26</height>\n      <uuid>{8d574bb0-877e-4587-bed0-0230c62a23e8}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NC/ACCEL value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncjoyxval</objectName>\n      <x>631</x>\n      <y>478</y>\n      <width>57</width>\n      <height>26</height>\n      <uuid>{b326293f-4268-403e-89c2-1559613603f7}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>630</x>\n      <y>448</y>\n      <width>152</width>\n      <height>29</height>\n      <uuid>{01fcf445-fff8-4151-83c8-6bc0e8684ae0}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NC/Joy X - Y value</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncjoyyval</objectName>\n      <x>713</x>\n      <y>479</y>\n      <width>67</width>\n      <height>24</height>\n      <uuid>{10f129fa-4464-4774-99a2-b10e0344f69d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>110</x>\n      <y>3</y>\n      <width>135</width>\n      <height>28</height>\n      <uuid>{008952de-9baf-4e33-b8aa-7ffe66b5a5ae}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>wiimote values</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>18</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>232</r>\n       <g>31</g>\n       <b>70</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>283</x>\n      <y>57</y>\n      <width>15</width>\n      <height>279</height>\n      <uuid>{bcd3dfb9-bfc7-4751-aa3f-1d91ebda2b15}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label/>\n      <alignment>left</alignment>\n      <font>Arial</font>\n      <fontsize>10</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"background\">\n       <r>43</r>\n       <g>90</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>432</x>\n      <y>59</y>\n      <width>15</width>\n      <height>279</height>\n      <uuid>{2c26d1ff-b56b-45be-a426-44a8fde2a287}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label/>\n      <alignment>left</alignment>\n      <font>Arial</font>\n      <fontsize>10</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"background\">\n       <r>43</r>\n       <g>90</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>458</x>\n      <y>66</y>\n      <width>135</width>\n      <height>28</height>\n      <uuid>{0140b3ce-21e2-4378-874b-05c55d5c8ece}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1 frequency (ROLL)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>452</x>\n      <y>154</y>\n      <width>152</width>\n      <height>29</height>\n      <uuid>{a633006a-0c39-47e3-a18f-0ec9100f6956}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>2 frequency (PITCH)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>465</x>\n      <y>256</y>\n      <width>126</width>\n      <height>26</height>\n      <uuid>{3459d3cb-203e-406b-925a-37bee524f576}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>3 frequency (YAW)</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncyaw</objectName>\n      <x>465</x>\n      <y>296</y>\n      <width>127</width>\n      <height>25</height>\n      <uuid>{a7b44da2-f68d-46ee-8d07-fc76cf774ee2}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.500</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncpitch</objectName>\n      <x>463</x>\n      <y>193</y>\n      <width>123</width>\n      <height>29</height>\n      <uuid>{e5715e7a-85c7-454d-b340-27e43f625671}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.376</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncroll</objectName>\n      <x>463</x>\n      <y>100</y>\n      <width>124</width>\n      <height>34</height>\n      <uuid>{c92b64aa-9692-40e1-9de0-91ac31b58c63}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1.358</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>521</x>\n      <y>17</y>\n      <width>170</width>\n      <height>29</height>\n      <uuid>{f8590be9-76ef-4e8d-87e1-abd9e0a85933}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>NUNCHUK values</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>18</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>232</r>\n       <g>31</g>\n       <b>70</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>buttonAval</objectName>\n      <x>164</x>\n      <y>553</y>\n      <width>49</width>\n      <height>23</height>\n      <uuid>{de84b149-c440-469c-8a35-6c3074538663}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>169</x>\n      <y>579</y>\n      <width>36</width>\n      <height>27</height>\n      <uuid>{fd69d860-7d4f-46de-bf21-10def7f0ca5a}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>A</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>button+val</objectName>\n      <x>375</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{43f48832-29cf-485b-859e-92ef4320f045}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>380</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{ac1d7623-7174-4dd4-bffb-a0df40293a80}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>+</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>348</x>\n      <y>516</y>\n      <width>101</width>\n      <height>30</height>\n      <uuid>{eaf26ec7-ac3b-4a5c-9e6f-56e396ff5cd7}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Buttons</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>16</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>232</r>\n       <g>31</g>\n       <b>70</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>buttonHomeval</objectName>\n      <x>323</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{29ce9251-ec16-44ac-a0ca-1f147d1b0c80}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>322</x>\n      <y>579</y>\n      <width>45</width>\n      <height>27</height>\n      <uuid>{edbc22f1-7931-4f26-a9a8-d42277e462d7}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Home</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>button-val</objectName>\n      <x>269</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{b8bcd1cc-dc82-4bc0-94a5-1414a03b3f28}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>274</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{4fdad04d-e16e-4230-92e6-256c3c89caf3}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>-</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>button1val</objectName>\n      <x>427</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{c765e051-8349-469c-968a-3fb5da9b0977}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>432</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{aa2168e0-3a20-4779-a74a-b843d6efc5ae}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>1</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>button2val</objectName>\n      <x>479</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{c0a0eb1d-6faa-4696-ba67-07e01d7f834d}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>484</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{7e9948bd-5cbe-4da9-b690-262aa7960fca}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>2</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>buttonCval</objectName>\n      <x>531</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{02371694-0767-40ea-900f-cd9a556ffecb}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>536</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{44d1720c-25a5-4b76-b1bd-6bbe2928ce4b}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>C</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>buttonZval</objectName>\n      <x>583</x>\n      <y>552</y>\n      <width>47</width>\n      <height>24</height>\n      <uuid>{31a72c2f-0518-4ce8-a078-d4e94d64ca5c}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>589</x>\n      <y>579</y>\n      <width>34</width>\n      <height>27</height>\n      <uuid>{f8cb7657-aa38-49ec-bd13-6bc912117ee1}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Z</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>426</x>\n      <y>450</y>\n      <width>118</width>\n      <height>24</height>\n      <uuid>{f2cf00dd-a4e4-4bd2-9416-ebcc1683cefc}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>current instrument</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>instrument</objectName>\n      <x>445</x>\n      <y>480</y>\n      <width>81</width>\n      <height>27</height>\n      <uuid>{156223db-ee02-45af-b940-9dc35b462af8}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>30.000</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBLabel\">\n      <objectName/>\n      <x>640</x>\n      <y>572</y>\n      <width>152</width>\n      <height>43</height>\n      <uuid>{234f7b3e-5015-4a26-a28d-de73a0630a15}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>Sensitivity\n    Lower->more sensitive</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBScrollNumber\">\n      <objectName>sensitivity</objectName>\n      <x>676</x>\n      <y>543</y>\n      <width>80</width>\n      <height>25</height>\n      <uuid>{21f95a4e-b4c6-4aa5-bf2d-8ec3450ba0fe}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <alignment>center</alignment>\n      <font>Arial</font>\n      <fontsize>10</fontsize>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"background\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <value>16.00000000</value>\n      <resolution>1.00000000</resolution>\n      <minimum>0.00000000</minimum>\n      <maximum>200.00000000</maximum>\n      <bordermode>border</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n      <randomizable group=\"0\">false</randomizable>\n      <mouseControl act=\"\"/>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncjoyxcompute</objectName>\n      <x>631</x>\n      <y>505</y>\n      <width>57</width>\n      <height>26</height>\n      <uuid>{4879b798-af17-4740-82fd-252d17c128ac}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.010</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n     <bsbObject version=\"2\" type=\"BSBDisplay\">\n      <objectName>ncjoyycompute</objectName>\n      <x>713</x>\n      <y>506</y>\n      <width>67</width>\n      <height>24</height>\n      <uuid>{b34f7b7e-8d1f-4224-b5b0-b65aca9f983c}</uuid>\n      <visible>true</visible>\n      <midichan>0</midichan>\n      <midicc>-3</midicc>\n      <label>0.500</label>\n      <alignment>center</alignment>\n      <font>Lucida Grande</font>\n      <fontsize>12</fontsize>\n      <precision>3</precision>\n      <color>\n       <r>0</r>\n       <g>0</g>\n       <b>0</b>\n      </color>\n      <bgcolor mode=\"nobackground\">\n       <r>255</r>\n       <g>255</g>\n       <b>255</b>\n      </bgcolor>\n      <bordermode>noborder</bordermode>\n      <borderradius>1</borderradius>\n      <borderwidth>1</borderwidth>\n     </bsbObject>\n    </bsbPanel>\n    <bsbPresets>\n    </bsbPresets>\n    <MacOptions>\n    Version: 3\n    Render: Real+File\n    Ask: Yes\n    Functions: None\n    Listing: Window\n    WindowBounds: 127 156 857 662\n    CurrentView: io\n    IOViewEdit: Off\n    Options: -b128 -A  -s -m38 -R --midi-velocity-amp=4 --midi-key-cps=5 \n    </MacOptions>\n    <MacGUI>\n    ioView background {60138, 65535, 63222}\n    ioText {13, 58} {127, 28} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1 frequency (ROLL)\n    ioText {7, 146} {144, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 2 frequency (PITCH)\n    ioText {20, 248} {118, 26} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 3 frequency (YAW)\n    ioText {20, 288} {119, 25} display 0.002000 0.00100 \"yaw\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.002\n    ioText {18, 185} {115, 29} display 0.002000 0.00100 \"pitch\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.002\n    ioText {18, 92} {116, 34} display 0.920000 0.00100 \"roll\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.920\n    ioKnob {28, 334} {48, 48} 1.000000 0.000000 0.010000 0.000000 master\n    ioText {92, 339} {146, 72} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Master volume:HOME mutes+ increases-decreases\n    ioText {309, 342} {112, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Current patch\n    ioText {299, 375} {137, 55} display 7.000000 0.00100 \"patch\" center \"Lucida Grande\" 42 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 7.000\n    ioText {302, 61} {118, 24} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder table for ROLL\n    ioText {324, 91} {75, 23} display 1.000000 0.00100 \"rolldisplay\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1.000\n    ioText {331, 192} {75, 23} display 1.000000 0.00100 \"pitchdisplay\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1.000\n    ioText {316, 162} {104, 25} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder table for PITCH\n    ioText {333, 297} {75, 23} display 0.000000 0.00100 \"yawdisplay\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {315, 252} {111, 40} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder table for YAW\n    ioText {549, 449} {72, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder pitch table\n    ioText {548, 480} {72, 27} display 299.000000 0.00100 \"temptable\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 299.000\n    ioText {169, 92} {97, 33} display 0.494480 0.00100 \"rollval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.494\n    ioText {170, 58} {96, 28} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder ROLL value\n    ioText {169, 185} {97, 33} display 0.485695 0.00100 \"pitchval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.486\n    ioText {165, 148} {95, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder PITCH value\n    ioText {171, 286} {97, 33} display 0.198632 0.00100 \"yawval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.199\n    ioText {167, 250} {105, 31} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder YAW value\n    ioText {462, 379} {79, 32} display 0.200164 0.00100 \"accelval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.200\n    ioText {458, 346} {107, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder ACCEL value\n    ioText {20, 481} {64, 24} display 0.000000 0.00100 \"upcount\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {8, 450} {91, 24} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder UP count\n    ioText {19, 386} {64, 24} display 0.000000 0.00100 \"gkmasterdisplay\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {19, 411} {64, 24} display 0.000000 0.00100 \"gkmastersavedisplay\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {216, 553} {48, 23} display 0.000000 0.00100 \"buttonBval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {224, 580} {33, 25} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder B\n    ioText {311, 450} {118, 24} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder instrument invoker\n    ioText {330, 480} {81, 27} display 9.000000 0.00100 \"instrumentinvoker\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 9.000\n    ioButton {7, 556} {146, 28} event 1.000000 \"button1\" \"Auto patch sequencer\" \"/\" i501 0 10\n    ioText {47, 527} {80, 25} scroll 60.000000 1.000000 \"autointerval\" center \"Arial\" 10 {0, 0, 0} {65280, 65280, 65280} background noborder \n    ioText {113, 481} {64, 24} display 0.000000 0.00100 \"downcount\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {101, 450} {91, 24} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder DOWN count\n    ioText {224, 481} {64, 24} display 0.000000 0.00100 \"updowncount\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {200, 449} {108, 26} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder UP/DOWN count\n    ioText {610, 99} {124, 34} display 0.004900 0.00100 \"ncrollval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.005\n    ioText {611, 65} {123, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder NC/ROLL value\n    ioText {610, 192} {124, 34} display 0.924359 0.00100 \"ncpitchval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.924\n    ioText {612, 160} {122, 30} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder NC/PITCH value\n    ioText {612, 293} {124, 34} display 0.020230 0.00100 \"ncyawval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.020\n    ioText {612, 259} {132, 32} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder NC/YAW value\n    ioText {610, 381} {89, 31} display 0.199427 0.00100 \"ncaccelval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.199\n    ioText {606, 348} {117, 26} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder NC/ACCEL value\n    ioText {631, 478} {57, 26} display 0.000000 0.00100 \"ncjoyxval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {630, 448} {152, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder NC/Joy X - Y value\n    ioText {713, 479} {67, 24} display 0.000000 0.00100 \"ncjoyyval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {110, 3} {135, 28} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 18 {59392, 7936, 17920} {65280, 65280, 65280} nobackground noborder wiimote values\n    ioText {283, 57} {15, 279} label 0.000000 0.00100 \"\" left \"Arial\" 10 {0, 0, 0} {11008, 23040, 65280} nobackground noborder \n    ioText {432, 59} {15, 279} label 0.000000 0.00100 \"\" left \"Arial\" 10 {0, 0, 0} {11008, 23040, 65280} nobackground noborder \n    ioText {458, 66} {135, 28} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1 frequency (ROLL)\n    ioText {452, 154} {152, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 2 frequency (PITCH)\n    ioText {465, 256} {126, 26} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 3 frequency (YAW)\n    ioText {465, 296} {127, 25} display 0.500000 0.00100 \"ncyaw\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.500\n    ioText {463, 193} {123, 29} display 0.376000 0.00100 \"ncpitch\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.376\n    ioText {463, 100} {124, 34} display 1.358000 0.00100 \"ncroll\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1.358\n    ioText {521, 17} {170, 29} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 18 {59392, 7936, 17920} {65280, 65280, 65280} nobackground noborder NUNCHUK values\n    ioText {164, 553} {49, 23} display 0.000000 0.00100 \"buttonAval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {169, 579} {36, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder A\n    ioText {375, 552} {47, 24} display 0.000000 0.00100 \"button+val\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {380, 579} {34, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder +\n    ioText {348, 516} {101, 30} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 16 {59392, 7936, 17920} {65280, 65280, 65280} nobackground noborder Buttons\n    ioText {323, 552} {47, 24} display 0.000000 0.00100 \"buttonHomeval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {322, 579} {45, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Home\n    ioText {269, 552} {47, 24} display 0.000000 0.00100 \"button-val\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {274, 579} {34, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder -\n    ioText {427, 552} {47, 24} display 0.000000 0.00100 \"button1val\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {432, 579} {34, 27} label 1.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 1\n    ioText {479, 552} {47, 24} display 0.000000 0.00100 \"button2val\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {484, 579} {34, 27} label 2.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 2\n    ioText {531, 552} {47, 24} display 0.000000 0.00100 \"buttonCval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {536, 579} {34, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder C\n    ioText {583, 552} {47, 24} display 0.000000 0.00100 \"buttonZval\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 0.000\n    ioText {589, 579} {34, 27} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Z\n    ioText {426, 450} {118, 24} label 0.000000 0.00100 \"\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder current instrument\n    ioText {445, 480} {81, 27} display 30.000000 0.00100 \"instrument\" center \"Lucida Grande\" 12 {0, 0, 0} {65280, 65280, 65280} nobackground noborder 30.000\nThe file could not be attached: 'ascii' codec can't decode byte 0xc3 in position 149: ordinal not in range(128)\n"}}