-m128 ksmps = 128 nchnls = 2 0dbfs = 1 ;============================================================================; ;============================================================================; ; PLAYING SCALES WITH A MIDI KEYBOARD ; ;============================================================================; ; by Joachim Heintz and Richard Boulanger ; ; 2010 / 2012 / 2014 ; ; Version for Csound6 ; ;============================================================================; ;============================================================================; ;============================================================================; ; SOME GLOBAL VARIABLES AND ASSIGNMENTS ; ;============================================================================; giScales[][] init 30, 100 ;two-dimensional array to hold the values giScaleLens[] init 30 ;how many values in one scale giSine ftgen 0, 0, 8192, 10, 1 giSaw ftgen 0, 0, 8192, 10, 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9 giSquare ftgen 0, 0, 8192, 10, 1, 0, 1/3, 0, 1/5, 0, 1/7, 0, 1/9, 0, 1/11 massign 0, "play"; send all midi noteon/noteoff events to instr 'play' ;============================================================================; ; OPCODE DEFINITIONS ; ;============================================================================; opcode FreqByEqScale, i, iiii ;;frequency calculation for one step of an equal tempered scale. the unit for the scale can be an octave, a duodecim, or whatever ;iref_freq: reference frequency ;iumult: unit multiplier (2 = octave, 3 = Bohlen-Pierce scale, 5 = stockhausen scale in Studie2) ;istepspu: steps per unit (12 for semitones, 13 for complete Bohlen-Pierce scale, 25 for studie2 scale) ;istep: selected step (0 = reference frequency, 1 = one step higher, -1 = one step lower) iref_freq, iumult, istepspu, istep xin ifreq = iref_freq * (iumult ^ (istep / istepspu)) xout ifreq endop opcode FreqByCentArr, i, iii ;frequency calculation of a step of a scale which is defined by a list of cent values ;refers to the which index of giScales: array with the number of cent values per unit multiplier (usually 2 = octave) ;its first value is the unit multiplier iumult ;the second value must be 0 and matches iref_freq, if istep == 0 ;iref_freq: reference frequency (= for istep == 0) ;istep: selected step (0 = reference frequency, 1 = one step higher, -1 = one step lower) iwhich, iref_freq, istep xin iumult = giScales[iwhich][0] iarrlen = giScaleLens[iwhich] - 1 ipos = floor(istep/iarrlen) ;"octave" position ibasfreq = (iumult ^ ipos) * iref_freq; base freq of istep icentindx = istep % iarrlen + 1 ;position of the appropriate centvalue ... icentindx = (icentindx < 1 ? (iarrlen + icentindx) : icentindx); ... in the array icent = giScales[iwhich][icentindx] ; get cent value ifreq = ibasfreq * cent(icent); get frequency xout ifreq endop opcode FreqByRatioArr, i, iii ;frequency calculation of a step in a scale which is defined by a list of proportions ;refers to the which index of giScales: array with the number of proportions per unit multiplier (usually 2 = octave) ;its first value is the unit multiplier iumult (2 = octave, 3 = duodecime or whatever) ;the second value must be 1 and matches iref_freq, if istep == 0 ;iref_freq: reference frequency (= for istep == 0) ;istep: selected step (0 = reference frequency, 1 = one step higher, -1 = one step lower) iwhich, iref_freq, istep xin iumult = giScales[iwhich][0] iarrlen = giScaleLens[iwhich] - 1 ipos = floor(istep/iarrlen); "octave" position ibasfreq = (iumult ^ ipos) * iref_freq; base freq of istep ipropindx = istep % iarrlen + 1; position of the appropriate proportion ... ipropindx = (ipropindx < 1 ? (iarrlen + ipropindx) : ipropindx); ... in the array iprop = giScales[iwhich][ipropindx] ; get proportion ifreq = ibasfreq * iprop; get frequency xout ifreq endop opcode FreqByECRArr, i, iii ;frequency calculation by either equal steps, cent list, or ratio list. the first value in the array gives the unit multiplier of the scale (e.g. 2 = octave or 3 = perfect 12th). the methods are distinguished by the second value in iarr: ;if the second value is 0, the array is considered to be a centlist ;if the second value is 1, the arry is considered to be a list of proportions ;else the second value is read as the number of equal tempered steps in the unit multiplier (e.g. 12 gives the usual keyboard tuning with a ratio of 12th root by 2 for each step when the first table value is 2) iwhich, iref_freq, istep xin ;iwhich = index in giScales and giScaleLens ifirst = giScales[iwhich][0] ; unit multiplier isecond = giScales[iwhich][1] ; 0=centlist, 1=ratios, else=equal tempered if isecond == 0 then ifreq FreqByCentArr iwhich, iref_freq, istep elseif isecond == 1 then ifreq FreqByRatioArr iwhich, iref_freq, istep else ifreq FreqByEqScale iref_freq, ifirst, isecond, istep endif xout ifreq endop opcode MidiNoteIn, kkk, 0 ;returns channel, key and velocity from a MIDI Note-On event. if no note-on event is received, -1 is returned for all three output values keventin, kchanin, knotin, kvelin midiin if keventin == 144 then kchan = kchanin knot = knotin kvel = kvelin else kchan = -1 knot = -1 kvel = -1 endif xout kchan, knot, kvel endop opcode IsOp, i, So ;returns 1 for (, 2 for +, 3 for -, 4 for *, 5 for /, 6 for %, 7 for ^ ;0 for anything else String, indx xin Str strsub String, indx, indx+1 if strcmp(Str, "(") == 0 then iRes = 1 elseif strcmp(Str, "+") == 0 then iRes = 2 elseif strcmp(Str, "-") == 0 then iRes = 3 elseif strcmp(Str, "*") == 0 then iRes = 4 elseif strcmp(Str, "/") == 0 then iRes = 5 elseif strcmp(Str, "%") == 0 then iRes = 6 elseif strcmp(Str, "^") == 0 then iRes = 7 else iRes = 0 endif xout iRes endop opcode IsNum, i, So ;returns 1 if Schar is a number or point, 0 elsewhere Schar, ipos xin iNum strchar Schar, ipos if iNum == 46 || (iNum > 47 && iNum < 58) then iRes = 1 else iRes = 0 endif xout iRes endop opcode IsNoth, i, So ;returns 1 if Schar is a space or tab, 0 elsewhere Schar, ipos xin iNum strchar Schar, ipos if iNum == 32 || iNum == 9 then iRes = 1 else iRes = 0 endif xout iRes endop opcode StrExpr, i, S Str xin indx = 0 ;printf_i "'%s'\n", 1, Str ;look after each character until indx == strlen(Str) do ;do nothing if part of a number or a space if IsNum(Str, indx) == 1 || IsNoth(Str, indx) == 1 then indx += 1 ;if '(', look for the ')' and evaluate elseif IsOp(Str, indx) == 1 then ;position of second parenthesis iPosPar2 strindex Str, ")" ;is there an operator after iSubIndx = iPosPar2 iIsOp2 = 0 until iIsOp2 > 0 || iSubIndx == strlen(Str) do iIsOp2 IsOp Str, iSubIndx iSubIndx += 1 enduntil ;substring inside this parenthesis S1 strsub Str, indx+1, iPosPar2 ;if this is the end of the string, simply evaluate this section if iIsOp2 == 0 then iNum StrExpr S1 igoto end else ;if there is an operator after this parenthesis, evaluate both strings S2 strsub Str, iPosPar2+2 if iIsOp2 == 2 then iNum = StrExpr(S1) + StrExpr(S2) igoto end elseif iIsOp2 == 3 then iNum = StrExpr(S1) - StrExpr(S2) igoto end elseif iIsOp2 == 4 then iNum = StrExpr(S1) * StrExpr(S2) igoto end elseif iIsOp2 == 5 then iNum = StrExpr(S1) / StrExpr(S2) igoto end elseif iIsOp2 == 6 then iNum = StrExpr(S1) % StrExpr(S2) igoto end else iNum = StrExpr(S1) ^ StrExpr(S2) igoto end endif endif ;if operator, recursion with this operator else S1 strsub Str, 0, indx S2 strsub Str, indx+1 if IsOp(Str, indx) == 2 then iNum = StrExpr(S1) + StrExpr(S2) igoto end elseif IsOp(Str, indx) == 3 then iNum = StrExpr(S1) - StrExpr(S2) igoto end elseif IsOp(Str, indx) == 4 then iNum = StrExpr(S1) * StrExpr(S2) igoto end elseif IsOp(Str, indx) == 5 then iNum = StrExpr(S1) / StrExpr(S2) igoto end elseif IsOp(Str, indx) == 6 then iNum = StrExpr(S1) % StrExpr(S2) igoto end else iNum = StrExpr(S1) ^ StrExpr(S2) igoto end endif endif enduntil iNum strtod Str end: xout iNum endop opcode StrayLen, i, Sjj ;returns the number of elements in Stray. elements are defined by two seperators as ASCII coded characters: isep1 defaults to 32 (= space), isep2 defaults to 9 (= tab). if just one seperator is used, isep2 equals isep1 Stray, isepA, isepB xin ;;DEFINE THE SEPERATORS isep1 = (isepA == -1 ? 32 : isepA) isep2 = (isepA == -1 && isepB == -1 ? 9 : (isepB == -1 ? isep1 : isepB)) Sep1 sprintf "%c", isep1 Sep2 sprintf "%c", isep2 ;;INITIALIZE SOME PARAMETERS ilen strlen Stray icount = 0; number of elements iwarsep = 1 indx = 0 if ilen == 0 igoto end ;don't go into the loop if String is empty loop: Snext strsub Stray, indx, indx+1; next sign isep1p strcmp Snext, Sep1; returns 0 if Snext is sep1 isep2p strcmp Snext, Sep2; 0 if Snext is sep2 if isep1p == 0 || isep2p == 0 then; if sep1 or sep2 iwarsep = 1; tell the log so else ; if not if iwarsep == 1 then ; and has been sep1 or sep2 before icount = icount + 1; increase counter iwarsep = 0; and tell you are ot sep1 nor sep2 endif endif loop_lt indx, 1, ilen, loop end: xout icount endop opcode SToScaleArr, 0, Sijj ;fill a numerical string into iwhere first dimension of giScales ;and its length into iwhere of giScaleLens Stray, iwhere, isepA, isepB xin ;;DEFINE THE SEPERATORS isep1 = (isepA == -1 ? 32 : isepA) isep2 = (isepA == -1 && isepB == -1 ? 9 : (isepB == -1 ? isep1 : isepB)) Sep1 sprintf "%c", isep1 Sep2 sprintf "%c", isep2 ;;WRITE ARRAY LENGTH iarrlen StrayLen Stray, isep1, isep2 giScaleLens[iwhere] = iarrlen ;;INITIALIZE SOME PARAMETERS ilen strlen Stray istartsel = -1; startindex for searched element iel = -1; number of element in Stray and ift iwarleer = 1; is this the start of a new element indx = 0 ;character index inewel = 0 ;new element to find ;;LOOP if ilen == 0 igoto end ;don't go into the loop if Stray is empty loop: Schar strsub Stray, indx, indx+1; this character isep1p strcmp Schar, Sep1; returns 0 if Schar is sep1 isep2p strcmp Schar, Sep2; 0 if Schar is sep2 is_sep = (isep1p == 0 || isep2p == 0 ? 1 : 0) ;1 if Schar is a seperator ;END OF STRING AND NO SEPARATORS BEFORE? if indx == ilen && iwarleer == 0 then Sel strsub Stray, istartsel, -1 inewel = 1 ;FIRST CHARACTER OF AN ELEMENT? elseif is_sep == 0 && iwarleer == 1 then istartsel = indx ;if so, set startindex iwarleer = 0 ;reset info about previous separator iel = iel+1 ;increment element count ;FIRST SEPERATOR AFTER AN ELEMENT? elseif iwarleer == 0 && is_sep == 1 then Sel strsub Stray, istartsel, indx ;get element inewel = 1 ;tell about iwarleer = 1 ;reset info about previous separator endif ;WRITE THE ELEMENT TO THE ARRAY if inewel == 1 then inum StrExpr Sel ;convert expression to number giScales[iwhere][iel] = inum endif inewel = 0 loop_le indx, 1, ilen, loop end: endop opcode ShowLED_a, 0, Sakkk ;Shows an audio signal in an outvalue channel. You can choose to show the value in dB or in raw amplitudes. ;Input: ;Soutchan: string with the name of the outvalue channel ;asig: audio signal which is to displayed ;kdispfreq: refresh frequency (Hz) ;kdb: 1 = show in dB, 0 = show in raw amplitudes (both in the range 0-1) ;kdbrange: if idb=1: how many db-steps are shown (e.g. if 36 you will not see anything from a signal below -36 dB) Soutchan, asig, kdispfreq, kdb, kdbrange xin kdispval max_k asig, kdispfreq, 1 if kdb != 0 then kdb = dbfsamp(kdispval) kval = (kdbrange + kdb) / kdbrange else kval = kdispval endif outvalue Soutchan, kval endop opcode ShowOver_a, 0, Sakk ;Shows if the incoming audio signal was more than 1 and stays there for some time ;Input: ;Soutchan: string with the name of the outvalue channel ;asig: audio signal which is to displayed ;kdispfreq: refresh frequency (Hz) ;khold: time in seconds to "hold the red light" Soutchan, asig, kdispfreq, khold xin kon init 0 ktim times kstart init 0 kend init 0 khold = (khold < .01 ? .01 : khold); avoiding too short hold times kmax max_k asig, kdispfreq, 1 if kon == 0 && kmax > 1 then kstart = ktim kend = kstart + khold outvalue Soutchan, kmax kon = 1 endif if kon == 1 && ktim > kend then outvalue Soutchan, 0 kon = 0 endif endop ;============================================================================; ; INSTRUMENTS ; ;============================================================================; instr init ;;INITIALIZE FUNCTION TABLES event_i "i", "refresh", 0, 1 ;;INITIALIZE MENUS AND MESSAGES outvalue "equal_tmprd", 0 outvalue "various", 0 outvalue "bohlen-pierce", 0 outvalue "midi_event", "" ;;INITIALIZE SOME GLOBAL VALUES gkscale init 1 gkreftone init 69 gktunfreq init 440 gksound init 0 ;;SHOW VALUES OF FIRST SCALE event_i "i", "show", 0, 1 ;;TURN ON MASTER AND REVERB INSTRUMENT event_i "i", "master", 0, 99999 event_i "i", "reverb", 0, 99999 turnoff endin instr master ;reduce rate to query widgets for saving cpu power ktrig metro 5 if ktrig == 1 then ;;GENERAL VALUES gkreftone invalue "reftone"; any midi note number gktunfreq invalue "tunfreq"; any frequency for it gksound invalue "sound"; select sound by menu ;;SELECT SCALE BY MENU IF CHANGED kscale1 invalue "equal_tmprd" kscale2 invalue "various" kscale3 invalue "bohlen-pierce" kscact1 changed kscale1 kscact2 changed kscale2 kscact3 changed kscale3 gkscale = (kscact1==1 ? kscale1+1 : (kscact2==1 ? kscale2+11 : (kscact3==1 ? kscale3+21 : gkscale))); set gkscale to new menu value if change ;;SHOW SELECTED SCALE TYPE AND OTHER INFOS if kscact1 == 1 || kscact2 == 1 || kscact3 == 1 then event "i", "show", 0, 1 endif ;;REFRESH ARRAYS IF A SCALE HAS BEEN CHANGED knew invalue "new" kchange changed knew if knew == 1 && kchange == 1 then event "i", "refresh", 0, 1 endif ;;READ USER INPUT FOR SELECTING SCALES BY MIDI gkgm1_scl invalue "gm1_scale" gkgm1_key invalue "gm1_key" gkgm1_chn invalue "gm1_chn" gkgm2_scl invalue "gm2_scale" gkgm2_key invalue "gm2_key" gkgm2_chn invalue "gm2_chn" gkgm3_scl invalue "gm3_scale" gkgm3_key invalue "gm3_key" gkgm3_chn invalue "gm3_chn" gkgm4_scl invalue "gm4_scale" gkgm4_key invalue "gm4_key" gkgm4_chn invalue "gm4_chn" gkgm5_scl invalue "gm5_scale" gkgm5_key invalue "gm5_key" gkgm5_chn invalue "gm5_chn" gkgm6_scl invalue "gm6_scale" gkgm6_key invalue "gm6_key" gkgm6_chn invalue "gm6_chn" gkgm7_scl invalue "gm7_scale" gkgm7_key invalue "gm7_key" gkgm7_chn invalue "gm7_chn" gkgm8_scl invalue "gm8_scale" gkgm8_key invalue "gm8_key" gkgm8_chn invalue "gm8_chn" endif ;end of cpu saving ... endin instr refresh; building and refreshing function tables containing scale values ;;BUILDING ARRAYS LINE EDIT WIDGETS ;(ugly code, but invalue seems not to be reliable in a loop) Scale1 invalue "scale1" Scale2 invalue "scale2" Scale3 invalue "scale3" Scale4 invalue "scale4" Scale5 invalue "scale5" Scale6 invalue "scale6" Scale7 invalue "scale7" Scale8 invalue "scale8" Scale9 invalue "scale9" Scale10 invalue "scale10" Scale11 invalue "scale11" Scale12 invalue "scale12" Scale13 invalue "scale13" Scale14 invalue "scale14" Scale15 invalue "scale15" Scale16 invalue "scale16" Scale17 invalue "scale17" Scale18 invalue "scale18" Scale19 invalue "scale19" Scale20 invalue "scale20" Scale21 invalue "scale21" Scale22 invalue "scale22" Scale23 invalue "scale23" Scale24 invalue "scale24" Scale25 invalue "scale25" Scale26 invalue "scale26" Scale27 invalue "scale27" Scale28 invalue "scale28" Scale29 invalue "scale29" Scale30 invalue "scale30" SToScaleArr Scale1, 0 SToScaleArr Scale2, 1 SToScaleArr Scale3, 2 SToScaleArr Scale4, 3 SToScaleArr Scale5, 4 SToScaleArr Scale6, 5 SToScaleArr Scale7, 6 SToScaleArr Scale8, 7 SToScaleArr Scale9, 8 SToScaleArr Scale10, 9 SToScaleArr Scale11, 10 SToScaleArr Scale12, 11 SToScaleArr Scale13, 12 SToScaleArr Scale14, 13 SToScaleArr Scale15, 14 SToScaleArr Scale16, 15 SToScaleArr Scale17, 16 SToScaleArr Scale18, 17 SToScaleArr Scale19, 18 SToScaleArr Scale20, 19 SToScaleArr Scale21, 20 SToScaleArr Scale22, 21 SToScaleArr Scale23, 22 SToScaleArr Scale24, 23 SToScaleArr Scale25, 24 SToScaleArr Scale26, 25 SToScaleArr Scale27, 26 SToScaleArr Scale28, 27 SToScaleArr Scale29, 28 SToScaleArr Scale30, 29 turnoff endin instr show; show scale info and set menu if changed ;currently (may 2014) there is an issue in sending long strings via outvalue ;so only short info is being sent ;EQUAL TEMPERED if i(gkscale) == 1 then ;halftone Sinfo sprintf "1 Halftone\n12 steps per octave with a ratio of 12th root of 2 = %f...", 2^(1/12) ;Sinfo = "Scale 1 selected" outvalue "equal_tmprd", 0 elseif i(gkscale) == 2 then ;thirdtone Sinfo sprintf "2 Thirdtone\n18 steps per octave with a ratio of 18th root of 2 = %f...", 2^(1/18) ;Sinfo = "Scale 2 selected" outvalue "equal_tmprd", 1 elseif i(gkscale) == 3 then ;quartertone ;Sinfo = "Scale 3 selected" Sinfo sprintf "3 Quartertone\n24 steps per octave with a ratio of 24th root of 2 = %f...", 2^(1/24) outvalue "equal_tmprd", 2 elseif i(gkscale) == 4 then ;fifthtone ;Sinfo = "Scale 4 selected" Sinfo sprintf "4 Fifthtone\n30 steps per octave with a ratio of 30th root of 2 = %f...", 2^(1/30) outvalue "equal_tmprd", 3 elseif i(gkscale) == 5 then ;sixthtone ;Sinfo = "Scale 5 selected" Sinfo sprintf "5 Sixthtone\n36 steps per octave with a ratio of 36th root of 2 = %f...", 2^(1/36) outvalue "equal_tmprd", 4 elseif i(gkscale) == 6 then ;eighttone ;Sinfo = "Scale 6 selected" Sinfo sprintf "6 Eighttone\n48 steps per octave with a ratio of 48th root of 2 = %f...", 2^(1/48) outvalue "equal_tmprd", 5 elseif i(gkscale) == 7 then ;twelfsttone ;Sinfo = "Scale 7 selected" Sinfo sprintf "7 Twelfsttone\n72 steps per octave with a ratio of 72th root of 2 = %f...", 2^(1/72) outvalue "equal_tmprd", 6 elseif i(gkscale) == 8 then ;sixteenthtone ;Sinfo = "Scale 8 selected" Sinfo sprintf "8 Sixteenthtone\n96 steps per octave with a ratio of 96th root of 2 = %f...", 2^(1/96) outvalue "equal_tmprd", 7 elseif i(gkscale) == 9 then ;stockhausen scale in "studie ii" ;Sinfo = "Scale 9 selected" Sinfo sprintf "9 Stockhausen Scale in 'Studie II'\n25 steps per 1:5 with a ratio of 25th root of 5 = %f...", 5^(1/25) outvalue "equal_tmprd", 8 elseif i(gkscale) == 10 then ;user defined ;Sinfo = "Scale 10 selected" Sinfo sprintf "%s", "10 User defined\nYou can add your own description in the code at instr 4" outvalue "equal_tmprd", 9 ;VARIOUS TEMPERED elseif i(gkscale) == 11 then ;pythagorean ;Sinfo = "Scale 11 selected" Sinfo sprintf "%s", "11 Pythagorean chromatic scale (14th century) with ratios\n1, 2187/2048, 9/8, 32/27, 81/64, 4/3, 729/512, 3/2, 6561/4096, 27/16, 16/9, 243/128\n(after Klaus Lang, Auf Wohlklangswellen durch der Toene Meer, Graz 1999, BEM 10, p. 41)" outvalue "various", 0 elseif i(gkscale) == 12 then ;zarlino / meantone ;Sinfo = "Scale 12 selected" Sinfo sprintf "%s", "12 Meantone temperature after Zarlino 1571 with cent values\n0, 76, 193, 310, 386, 503, 579, 697, 773, 890, 1007, 1083\n(after Klaus Lang, Auf Wohlklangswellen durch der Toene Meer, Graz 1999, BEM 10, p. 68)" outvalue "various", 1 elseif i(gkscale) == 13 then ;werckmeister III ;Sinfo = "Scale 13 selected" Sinfo sprintf "%s", "13 Werckmeister III temperature (1691) with cent values\n0, 90, 192, 294, 390, 498, 588, 696, 792, 888, 996, 1092\n(after Klaus Lang, Auf Wohlklangswellen durch der Toene Meer, Graz 1999, BEM 10, p. 97)" outvalue "various", 2 elseif i(gkscale) == 14 then ;kirnberger II ;Sinfo = "Scale 14 selected" Sinfo sprintf "%s", "14 Kirnberger II temperature (1771) with cent values\n0, 90, 204, 294, 386, 498, 590, 702, 792, 895, 996, 1088\n(after Klaus Lang, Auf Wohlklangswellen durch der Toene Meer, Graz 1999, BEM 10, p. 100)" outvalue "various", 3 elseif i(gkscale) == 15 then ;sruti I ;Sinfo = "Scale 15 selected" Sinfo sprintf "%s", "15 Sruti I:\n22 steps per octave in indian classical music with cent values \n0, 90, 112, 182, 204, 294, 316, 386, 408, 498, 520, 590, 610, 702, 792, 814, 884, 906, 996, 1018, 1088, 1110\n(after P. Sambamoorthy, South Indian, Music, Book IV, Second Edition, Madras 1954, pp 95-97)" outvalue "various", 4 elseif i(gkscale) == 16 then ;sruti II ;Sinfo = "Scale 16 selected" Sinfo sprintf "%s", "16 Sruti II:\n22 steps per octave in indian clssical music with cent values\n0 68, 135, 200, 263, 325, 385, 444, 501, 557, 612, 666, 719, 771, 822, 872, 921, 969, 1017, 1064, 1110, 1155\n(after Narsing R. Eswara, Tonal Foundations of Indian Music, 2007, Appendix A.4)" outvalue "various", 5 elseif i(gkscale) == 17 then ;user defined ;Sinfo = "Scale 17 selected" Sinfo sprintf "%s", "17 User defined\nYou can add your own description in the code at instr 4" outvalue "various", 6 elseif i(gkscale) == 18 then ;user defined ;Sinfo = "Scale 18 selected" Sinfo sprintf "%s", "18 User defined\nYou can add your own description in the code at instr 4" outvalue "various", 7 elseif i(gkscale) == 19 then ;user defined ;Sinfo = "Scale 19 selected" Sinfo sprintf "%s", "19 User defined\nYou can add your own description in the code at instr 4" outvalue "various", 8 elseif i(gkscale) == 20 then ;user defined ;Sinfo = "Scale 20 selected" Sinfo sprintf "%s", "20 User defined\nYou can add your own description in the code at instr 4" outvalue "various", 9 ;BOHLEN-PIERCE elseif i(gkscale) == 21 then ;equal tempered (13 steps) ;Sinfo = "Scale 21 selected" Sinfo sprintf "21 Bohlen-Pierce Equal Tempered:\n13 steps per 3:1 (duodecima) with a ratio of 13th root of 3 = %f...", 3^(1/13) outvalue "bohlen-pierce", 0 elseif i(gkscale) == 22 then ;ratios (13 steps) ;Sinfo = "Scale 22 selected" Sinfo sprintf "%s", "22 Bohlen-Pierce Ratios:\n13 steps per 3:1 (duodecima) with ratios 1, 27/25, 25/21, 9/7, 7/5, 75/49, 5/3, 9/5, 49/25, 15/7, 7/3, 63/25, 25/9" outvalue "bohlen-pierce", 1 elseif i(gkscale) == 23 then ;Dur I (9 steps) ;Sinfo = "Scale 23 selected" Sinfo sprintf "%s", "23 Bohlen-Pierce Dur I Mode:\n9 steps per 3:1 (duodecima) with ratios 1, 27/25, 9/7, 7/5, 5/3, 9/5, 49/25, 7/3, 63/25" outvalue "bohlen-pierce", 2 elseif i(gkscale) == 24 then ;Dur II (9 steps) ;Sinfo = "Scale 24 selected" Sinfo sprintf "%s", "24 Bohlen-Pierce Dur II Mode:\n9 steps per 3:1 (duodecima) with ratios 1, 25/21, 9/7, 7/5, 5/3, 9/5, 15/7, 7/3, 63/25" outvalue "bohlen-pierce", 3 elseif i(gkscale) == 25 then ;Moll I (9 steps) ;Sinfo = "Scale 25 selected" Sinfo sprintf "%s", "25 Bohlen-Pierce Moll I Mode (Delta):\n9 steps per 3:1 (duodecima) with ratios 1, 25/21, 9/7, 75/49, 5/3, 9/5, 15/7, 7/3, 25/9" outvalue "bohlen-pierce", 4 elseif i(gkscale) == 26 then ;Moll II (9 steps) ;Sinfo = "Scale 26 selected" Sinfo sprintf "%s", "26 Bohlen-Pierce Moll II Mode (Pierce):\n9 steps per 3:1 (duodecima) with ratios 1, 27/25, 9/7, 7/5, 5/3, 9/5, 15/7, 7/3, 25/9" outvalue "bohlen-pierce", 5 elseif i(gkscale) == 27 then ;Gamma (9 steps) ;Sinfo = "Scale 27 selected" Sinfo sprintf "%s", "27 Bohlen-Pierce Gamma Mode:\n9 steps per 3:1 (duodecima) with ratios 1, 27/25, 9/7, 7/5, 5/3, 9/5, 49/25, 7/3, 25/9" outvalue "bohlen-pierce", 6 elseif i(gkscale) == 28 then ;Harmonic (9 steps) ;Sinfo = "Scale 28 selected" Sinfo sprintf "%s", "28 Bohlen-Pierce Harmonic Mode:\n9 steps per 3:1 (duodecima) with ratios 1, 27/25, 9/7, 7/5, 5/3, 9/5, 15/7, 7/3, 63/25" outvalue "bohlen-pierce", 7 elseif i(gkscale) == 29 then ;Lambda (9 steps) ;Sinfo = "Scale 29 selected" Sinfo sprintf "%s", "29 Bohlen-Pierce Lambda Mode:\n9 steps per 3:1 (duodecima) with ratios 1, 25/21, 9/7, 7/5, 5/3, 9/5, 15/7, 7/3, 25/9" outvalue "bohlen-pierce", 8 elseif i(gkscale) == 30 then ;user defined ;Sinfo = "Scale 30 selected" Sinfo sprintf "%s", "30 User defined\nYou can add your own description in the code at instr 4" outvalue "bohlen-pierce", 9 endif outvalue "scsel1", (i(gkscale) < 11 ? 1 : 0) outvalue "scsel2", (i(gkscale) > 10 && i(gkscale) < 21 ? 1 : 0) outvalue "scsel3", (i(gkscale) > 20 ? 1 : 0) outvalue "info", Sinfo turnoff endin instr show_mid_event ikey = p4 ivel = p5 ichn = p6 Smidi_event sprintf "Key = %d\nVelocity = %d\nChannel = %d\n", ikey, ivel, ichn outvalue "midi_event", Smidi_event turnoff endin instr show_output ;;SHOW OUTPUT OUT THE CURRENT EVENT ikey = p4 ifreq = p5 Skey sprintf "%d", ikey outvalue "key", Skey; key pressed icent = (log(ifreq / i(gktunfreq)) * 1200) / log(2) Scent sprintf "%.1f", icent outvalue "cent", Scent; cent difference in relation to the reference frequency outvalue "freq", ifreq inormfreq = cpsmidinn(ikey); usual freq of the pressed key outvalue "normfreq", inormfreq icentdiff = 1200 * (log(ifreq/inormfreq) / log(2)); centdifference ifreq to inormfreq Scentdiff sprintf "%.1f", icentdiff outvalue "centdiff", Scentdiff turnoff endin instr play; playing one note ;;INPUT ikey notnum ivel veloc ichn midichn event_i "i", "show_mid_event", 0, 1, ikey, ivel, ichn ;show values ;;IS THIS A NOTE TO SELECT A SCALE (= NOT TO BE PLAYED)? if ikey == i(gkgm1_key) && ichn == i(gkgm1_chn) then gkscale = gkgm1_scl+1; set gkscale to the new value event_i "i", "show", 0, 1 elseif ikey == i(gkgm2_key) && ichn == i(gkgm2_chn) then gkscale = gkgm2_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm3_key) && ichn == i(gkgm3_chn) then gkscale = gkgm3_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm4_key) && ichn == i(gkgm4_chn) then gkscale = gkgm4_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm5_key) && ichn == i(gkgm5_chn) then gkscale = gkgm5_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm6_key) && ichn == i(gkgm6_chn) then gkscale = gkgm6_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm7_key) && ichn == i(gkgm7_chn) then gkscale = gkgm7_scl+1 event_i "i", "show", 0, 1 elseif ikey == i(gkgm8_key) && ichn == i(gkgm8_chn) then gkscale = gkgm8_scl+1 event_i "i", "show", 0, 1 else ;;PLAY THE USUAL NOTE ivel = ivel/127 ireftone = i(gkreftone) itunfreq = i(gktunfreq) iscale = i(gkscale); 1-30 istep = ikey - ireftone; how many steps (keys) higher or lower than the reftone ifreq FreqByECRArr iscale-1, itunfreq, istep; calculation of the frequency ;;SELECT OUTPUT SOUND if gksound == 0 then; sine anote poscil ivel, ifreq, giSine elseif gksound == 1 then; saw anote poscil ivel, ifreq, giSaw elseif gksound == 2 then; square anote poscil ivel, ifreq, giSquare elseif gksound == 3 then; square vco2 anote vco2 ivel, ifreq, 10 elseif gksound == 4 then; pluck anote pluck ivel, ifreq, ifreq, 0, 1 endif aenv linsegr 0, .1, 1, p3-0.1, 1, .1, 0 aout = anote * aenv; calculate sound gadry init 0 gadry = gadry + aout; add to global audio signal ;;CALL SUBINSTRUMENT TO SHOW OUTPUT event_i "i", "show_output", 0, 1, ikey, ifreq endif endin instr reverb; global reverb and display ;;GUI INPUT kwdmix invalue "wdmix";(between 0=dry und 1=reverberating) kroomsize invalue "roomsize"; 0-1 (for freeverb) khfdamp invalue "hfdamp"; attenuation of high frequencies (0-1) (for freeverb) kvol invalue "vol" ;volume slider kvol port kvol, .1 ;smooth changes ;;REVERB AND AUDIO OUTPUT awetL, awetR freeverb gadry, gadry, kroomsize, khfdamp aoutL = (1-kwdmix) * gadry + (kwdmix * awetL) aoutR = (1-kwdmix) * gadry + (kwdmix * awetR) aoutL = aoutL * kvol aoutR = aoutR * kvol outs aoutL, aoutR ;;SEND TO GUI kTrigDisp metro 10 ShowLED_a "outL", aoutL, kTrigDisp, 1, 50 ShowLED_a "outR", aoutR, kTrigDisp, 1, 50 ShowOver_a "outLover", aoutL/0dbfs, kTrigDisp, 1 ShowOver_a "outRover", aoutR/0dbfs, kTrigDisp, 1 ;;RESET GLOBAL AUDIO gadry = 0 endin i "init" 0 1 49 9 1290 754 true 190 188 143 1010 17 374 773 {9f76fd32-ca50-46b5-940d-820fe800928e} true 0 -3 center Lucida Grande 18 3 0 0 0 255 255 255 border 1 1 key 846 595 62 27 {3bc52c98-448f-4f87-bb44-571bbd00aa08} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 391 595 457 28 {58bf0432-9be8-42aa-a453-521fd719a63f} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 cent 847 623 82 27 {47ed2c50-ebe4-4161-a4bd-b856a958806e} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 307 623 539 27 {6844d514-7a40-42a6-ab39-8a807fdea606} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 freq 847 649 82 27 {7975f04a-23ae-4886-9391-3e348e3d82ad} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 306 649 542 29 {c91d9759-0b82-4717-9621-a4d4cf004e1e} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 753 45 252 26 {0a533a2f-56e9-45c3-b5c5-87962ec7dcf2} true 0 0 right DejaVu Sans 12 3 0 0 0 255 255 255 noborder 1 1 normfreq 847 675 82 28 {88acc66e-3cfe-43ee-be10-59666b1b2e28} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 307 675 541 29 {28b05a3e-f445-486e-9945-664136d7b390} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 centdiff 847 701 82 30 {bb3b02d4-0dfd-44fc-8d2c-a9dd3925a597} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 307 701 541 31 {3f7fe471-d23f-4472-a3eb-de1edd3334c6} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 info 276 476 710 109 {b6a1d2d0-6f91-4261-9e77-d46b08bc421c} true 0 -3 center Lucida Grande 14 3 0 0 0 237 169 107 noborder 1 1 _Play 466 45 91 27 {7e1ef5ca-2594-48c8-abef-8c52de3f2ad9} true 0 -3 value 1.00000000 START / i1 0 10 false false _Stop 580 45 91 27 {48ac72cc-9099-4bd7-8736-446ab91b48e6} true 0 -3 value 1.00000000 STOP / i1 0 10 false true vol 314 769 250 28 {ac58723d-0e06-4f05-bd62-b9647a2947b0} true 0 -3 0.00000000 1.00000000 0.54800000 lin continuous -1.00000000 false 349 740 97 27 {687143f9-ea96-4984-8e67-5597ffa3f81d} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 outL 579 745 336 22 {56692e84-8339-4713-bedf-b81a5d5dea6b} true 0 -3 out1_post 0.00000000 1.00000000 0.00000000 1.00000000 -4.57804129 0.36363600 fill 1 0.00000000 jump 0 234 0 false 0 0 0 outLover 913 745 27 22 {9dbc1525-61ed-4dcc-aeb3-650eb87744db} true 0 -3 outLover 0.00000000 1.00000000 0.00000000 1.00000000 0.00000000 0.00000000 fill 1 0.00000000 jump 196 14 12 false 0 0 0 outR 579 771 336 22 {09a3dabb-c32b-4652-b07c-a5149e90b11b} true 0 -3 out2_post 0.00000000 1.00000000 0.00000000 1.00000000 -4.69263388 0.52631600 fill 1 0.00000000 jump 0 234 0 false 0 0 0 outRover 913 771 27 22 {d515ef65-7c19-46c4-a888-c5cbc4e5653c} true 0 -3 outRover 0.00000000 1.00000000 0.00000000 1.00000000 0.00000000 0.00000000 fill 1 0.00000000 jump 196 14 12 false 0 0 0 vol 444 740 98 27 {7e4a0ff0-63bb-41fe-a64c-41c8dc65828b} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 447 7 449 38 {460c390f-19ce-46a2-ae4e-2ca424395160} true 0 -3 center Lucida Grande 22 3 0 0 0 255 255 255 noborder 1 1 430 71 576 38 {321ab18e-c680-4bd3-81ae-696ef1e02fe2} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 431 108 158 25 {1f650c2a-caaa-45d1-8405-66a7b7ab147a} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 431 131 578 78 {c6919d13-0dde-4b29-8628-3e8f74241f42} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 431 207 466 27 {36e69f68-86a5-436a-a774-0d64767cd5f3} true 0 -3 left Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 431 233 583 155 {41ba012c-7cc4-4060-a02e-05afaf5762b7} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 431 387 584 78 {bf72fd7e-bb12-4d4f-acb9-d21ac8b8c3e6} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 3 33 422 217 {8fee01a4-6aff-4a18-b9d3-682fd8b62927} true 0 -3 sound 201 220 165 25 {fcbc67a7-51c0-4ca5-94e3-98229024c81a} true 0 0 sine 0 saw 1 square 2 square vco2 3 pluck 4 4 false 43 216 160 31 {89a47f25-152d-40af-a3a2-0d2499bbdbc2} true 0 -3 center Lucida Grande 18 3 0 0 0 255 255 255 noborder 1 1 scsel1 23 189 104 23 {fa1d2e5d-12c8-4900-af8a-b5a4feebf74f} true 0 -3 vert34 0.00000000 1.00000000 0.00000000 1.00000000 0.00000000 0.43478300 fill 1 0.00000000 jump 0 234 0 false 0 0 0 scsel2 154 189 104 23 {39ac622a-56e3-4d32-a2e9-b8f85dbec7b3} true 0 -3 vert34 0.00000000 1.00000000 0.00000000 1.00000000 1.00000000 0.43478300 fill 1 0.00000000 jump 0 234 0 false 0 0 0 scsel3 285 189 104 23 {5b35e488-40f1-4be1-9dc2-079192003890} true 0 -3 vert34 0.00000000 1.00000000 0.00000000 1.00000000 0.00000000 0.43478300 fill 1 0.00000000 jump 0 234 0 false 0 0 0 tunfreq 313 44 107 26 {c014f205-06aa-45df-be4c-8b8bb3583229} true 0 -3 left Lucida Grande 14 0 0 0 255 255 255 0.00000100 1 1e+12 false 261.625 206 44 108 28 {a9440b0b-595c-4c9b-b112-b55b7cd728bb} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 227 65 72 25 {04c0e64a-16bb-4ddb-b286-62d57f752e34} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 equal_tmprd 12 167 126 24 {5ee933a0-615a-4995-b661-f16a24a14150} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 UserDefined 9 5 false 10 93 393 30 {8cc05c0f-ad73-46ae-ace2-556caad97763} true 0 -3 center Lucida Grande 18 3 0 0 0 255 255 255 noborder 1 1 reftone 136 44 62 26 {d62aecdf-74ab-43d1-a501-549e1973297c} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 60 8 44 130 28 {88e4e2ee-f553-4356-8ea4-554dfc18d3d5} true 0 -3 right Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 8 67 129 27 {d80338cb-8182-4796-a1ae-8a922f0d03cf} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 15 120 121 47 {2b882335-a79a-4ce8-b5c7-15e51e2a2c4b} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 various 141 167 132 24 {64462832-bfe5-491c-8b85-6c00f2062b17} true 0 -3 11 Pythagorean 0 12 Zarlino 1/4 Comma 1 13 Werckmeister III 2 14 Kirnberger II 3 15 Indian Sruti I 4 16 Indian Sruti II 5 17 User Defined 6 18 User Defined 7 19 User Defined 8 20 User Defined 9 2 false 148 120 121 47 {79d233f5-b289-442a-a78f-bc2a90c32392} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 bohlen-pierce 275 167 136 24 {dd3f6092-bad8-4ae1-8e90-044dab957c1d} true 0 -3 21 Equal Tempered 0 22 Ratios 1 23 Dur I Mode 2 24 Dur II Mode 3 25 Moll I (Delta) Mode 4 26 Moll II (Pierce) Mode 5 27 Gamma Mode 6 28 Harmonic Mode 7 29 Lambda Mode 8 30 User Defined 9 0 false 278 120 121 47 {6d2e6268-a18a-4196-b14c-eb4a6afada8a} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 4 256 261 311 {50c3bfda-28ab-4c5a-82c0-14459384a68a} true 0 -3 gm1_scale 10 323 108 25 {94cd0db6-ab80-4318-ada1-489baaa49a6c} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 0 false gm1_key 124 323 61 25 {4edbfe44-aa5a-4cb1-811e-817d739605e3} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 36 gm1_chn 188 323 61 25 {7a93960a-e5d8-4940-b320-4212e941ed6b} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 18 293 83 27 {34ddb657-9510-4824-b955-89185b1d6a71} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 125 293 50 27 {391a889d-de9b-4019-af3b-ae4ab68fb663} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 181 293 73 27 {b056127d-4963-413f-9b90-f3df8811af4f} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 noborder 1 1 gm2_scale 10 354 108 25 {a4ae0f35-4e5a-4480-b043-89f1256211cc} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 11 false gm2_key 124 354 61 25 {048b8812-0d96-4035-b4bb-9000b1786f02} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 37 gm2_chn 188 354 61 25 {31698544-6623-484c-99d2-14945339d4c3} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm3_scale 10 382 108 25 {ebc0eda5-bfae-4055-b3c1-4c45d8c0df99} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I Mode 24 26 BP Moll II Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 20 false gm3_key 124 382 61 25 {7d8605f3-241c-4e8e-8e8d-df51359091ac} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 38 gm3_chn 188 382 61 25 {8ac519ad-9dfa-44f3-82a4-a55c607e29c2} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm4_scale 10 413 108 25 {3a87415d-126b-4a43-80dd-cb5f8f076713} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 2 false gm4_key 124 413 61 25 {316bb9bd-fb55-4852-b227-dad4cd7794b9} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 40 gm4_chn 188 413 61 25 {1807bde7-43ce-4994-b20c-ade301dbfc88} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm5_scale 10 441 108 25 {274ebd83-0d72-4a70-ad7b-8473364c9392} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I Mode 24 26 BP Moll II Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 25 false gm5_key 124 441 61 25 {67a7e03e-f0ad-4092-b182-7361c1b7bd78} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 41 gm5_chn 188 441 61 25 {f146f09c-4288-4042-8561-6e27cb9e4eff} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm6_scale 10 472 108 25 {d34a9233-6773-44c6-b327-2b93b34f9aa7} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 10 false gm6_key 124 472 61 25 {654afdbe-6baf-4630-baf9-583b50e9e93f} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 43 gm6_chn 188 472 61 25 {370d1312-dc97-4f4b-91c9-fd439ad33c63} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm7_scale 10 500 108 25 {551dd85c-08f1-4aee-90c3-03ce89cdeae1} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 12 false gm7_key 124 500 61 25 {2c4c42b0-7616-4e5a-acb9-1fd5bfb6378c} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 45 gm7_chn 188 500 61 25 {0784db53-0760-4631-a367-64f2eb53dabf} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 gm8_scale 10 531 108 25 {b9e13efc-7de6-4c27-94b5-35d922782236} true 0 -3 1 Halftones 0 2 Thirdtones 1 3 Quartertones 2 4 Fifthtones 3 5 Sixthtones 4 6 Eighttones 5 7 Twelfthtones 6 8 Sixteenthtones 7 9 Stockhausen Studie II 8 10 User Defined 9 11 Pythagorean 10 12 Zarlino 1/4 Comma 11 13 Werckmeister III 12 14 Kirnberger II 13 15 Indian Sruti I 14 16 Indian Sruti II 15 17 User Defined 16 18 User Defined 17 19 User Defined 18 20 User Defined 19 21 BP Equal Tempered 20 22 BP Ratios 21 23 BP Dur I Mode 22 24 BP Dur II Mode 23 25 BP Moll I (Delta) Mode 24 26 BP Moll II (Pierce) Mode 25 27 BP Gamma Mode 26 28 BP Harmonic Mode 27 29 BP Lambda Mode 28 30 User Defined 29 4 false gm8_key 124 531 61 25 {7f6a41d8-2c24-4e30-a513-a0c8576a9673} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 0 127 false 47 gm8_chn 188 531 61 25 {74754e99-71ea-4e0b-a34b-ad9ae57445a1} true 0 -3 right Lucida Grande 14 0 0 0 255 255 255 1.00000000 1 16 false 2 9 263 252 31 {61aaff8a-e262-49a0-b834-8e124e9340e4} true 0 -3 center Lucida Grande 18 3 0 0 0 255 255 255 noborder 1 1 2 597 261 201 {764f7fce-c3ca-4869-a1f4-90a5bd098426} true 0 -3 center Lucida Grande 14 3 0 0 0 255 255 255 border 1 1 wdmix 52 642 160 28 {05f629ba-fed7-41ac-9efd-f1614cf08fa9} true 0 -3 0.00000000 1.00000000 0.43125000 lin continuous -1.00000000 false 3 643 49 25 {e522ff72-282b-4b83-948a-952b9d2b7664} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 212 644 48 25 {a556f13f-b772-4baf-8d29-b4d955f36bda} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 73 619 109 24 {2b72ce0e-23e3-4903-a4be-3d1c03bf14f9} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 roomsize 51 694 161 30 {c92bd11e-57a8-4b00-a2f0-5172e2382e8f} true 0 -3 0.00000000 1.00000000 0.42857143 lin continuous -1.00000000 false 1 696 50 25 {f955e85e-6c4d-4908-9710-c3d6559a5408} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 210 696 52 24 {aadcb08e-dfaf-47c2-b913-19bd09dd0e5f} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 72 670 110 24 {094b23b0-6d2a-4f79-b03f-8a7473b41956} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 hfdamp 46 753 160 31 {6f8db5c1-b0b6-4740-ae4c-b32b0d6b2b9c} true 0 -3 0.00000000 1.00000000 0.36875000 lin continuous -1.00000000 false 2 756 44 26 {615df0d8-51da-4a6f-82dd-6360b33f98ad} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 204 757 59 25 {2bfde5cc-dc42-4add-a9ec-1346575f5f53} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 40 723 175 30 {c8577a79-24bc-4075-8d88-d66383ea66ce} true 0 -3 center Lucida Grande 10 3 0 0 0 255 255 255 noborder 1 1 scale1 1156 51 220 24 {41924a59-97b1-43bc-8481-d36acf53cc47} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 50 138 26 {47e38419-62ba-460b-a267-7cf6da2f961e} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale2 1156 75 220 24 {148c7136-1bf7-4c90-839e-2a2687c7773f} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 75 138 26 {ca945a81-40a8-49e4-b4ce-f3c440c2b42f} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale3 1156 99 220 24 {b4667509-0101-4453-8b9b-fe8920cbcf93} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 99 138 26 {726509f4-50ff-4564-9e2a-b1c786b962f7} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale4 1156 124 220 24 {3a86087a-c910-4e2d-8aa8-06078cbd63b6} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 124 138 26 {0025791b-f77a-439a-b39e-7c9ff252c8b3} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale5 1156 148 220 24 {5db08c35-cf97-4111-8f52-fb05460e4e0d} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 148 138 26 {a31c3cf5-4e7d-4314-8700-fbf3badf98c3} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale6 1156 173 220 24 {4127e44d-5013-4b66-95f1-d0c0a42fd1bc} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 173 138 26 {cfb79d3e-2555-43a6-af4c-9289b9673791} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale7 1156 197 220 24 {bf4933e2-13b2-4c42-a4a8-e40cb672cb81} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 197 138 26 {5d94d8ff-6383-4486-9dca-41d0c51deab0} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale8 1156 222 220 24 {1af2b968-3f9d-4b8a-895d-ce312149c3b3} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 222 138 26 {a1abea1c-f33e-4dd9-9c64-677f4b8cfddc} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale9 1156 245 220 24 {5db50544-26b2-47b2-b93e-6b028c94b79d} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 245 138 26 {a43bea2e-a2ee-4004-ac9e-002877d3c6ed} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale10 1156 270 220 24 {166d0f00-2be7-413d-93f9-f24f6e03aed6} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 270 138 26 {0ff548f1-c6b9-42e2-a499-e16f8849045f} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale11 1156 294 220 24 {b5593333-b902-4ce2-b4fa-5f516ea3ff23} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 294 138 26 {a423fbc0-cc68-4629-85aa-8f481b3139f2} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale12 1156 319 220 24 {ead660d7-fc87-4ee7-a4b9-072d057c2aa4} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 319 138 26 {2cf5d943-5bcf-4661-b338-b9721e7c8917} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale13 1156 343 220 24 {3a058ccc-fa3d-407e-9bc7-8245f6b0965a} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 343 138 26 {e5546b76-099b-47b8-a13e-5ba6a491495b} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale14 1156 368 220 24 {8ae1ce39-54d9-406a-8ebd-caf9510bcac6} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 368 138 26 {e2aaccf0-a0d3-4dbd-a237-019cf77d605c} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale15 1156 392 220 24 {9c571518-20fb-4b2f-a3d3-91248bcad372} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 392 138 26 {afd9fdfe-7be2-40c3-9421-3e22df9c8c8e} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale16 1156 417 220 24 {4cea0667-fa01-4b06-9009-34485bfe62a8} true 0 0 left DejaVu Sans 14 3 0 0 0 206 206 206 nobackground 1018 417 138 26 {12c5d630-064d-4b8a-89b6-cb167158fb41} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale17 1156 440 220 24 {da80b6f0-7db6-4c30-b796-0bb35da95d0d} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 440 138 26 {d4445e61-4c3d-4dc8-a198-e3c2ac272655} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale18 1156 465 220 24 {bf20c58c-cda9-4281-9d33-dfe23868ead1} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 465 138 26 {328ce731-1a06-48ee-921c-93e55971f145} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale19 1156 489 220 24 {83143afb-dfdc-4d2b-9992-c88ce0f6a2dc} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 489 138 26 {5ac37219-6934-4896-8ef6-f586e712a2f9} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale20 1156 514 220 24 {20e8cf37-0ac9-4450-8dd4-b70c5a6aaeb6} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 514 138 26 {42d0d5df-6975-4cd5-809d-e3560fb76be6} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale21 1156 538 220 24 {0a8fe8ca-3efe-4f22-a7ad-999b94cb4178} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 538 138 26 {29d5a91d-ed88-4bb5-9fcf-2f5ab99477c6} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale22 1156 563 220 24 {264738ea-cb2b-4cc5-be17-ac17ea7f337e} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 563 138 26 {9af90ad2-5c07-43f9-87b8-5a711a9096e4} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale23 1156 586 220 24 {d0a3b549-3434-449b-949e-36e0d509ffff} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 586 138 26 {2ad8b869-ec31-45a3-8767-f44237a1d126} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale24 1156 611 220 24 {fa85f026-2fc3-4e31-90fb-16f0f53136ad} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 611 138 26 {af80d63e-d5eb-4adb-982c-4b00237e6160} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale25 1156 635 220 24 {43124faa-e689-4af2-b29f-cdf06b58e766} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 635 138 26 {bd925631-99bd-42d0-8134-b2d27f0e380b} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale26 1156 660 220 24 {f5dabc23-5f3c-465a-a0d5-ee9ce9955943} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 660 138 26 {7cf4bea9-f231-4db8-bf51-81bf6fa24d06} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale27 1156 684 220 24 {3d8a2466-18ca-48e3-94d8-e349a7814f97} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 684 138 26 {675ca19b-cf4f-46c8-ab64-b606dea3a710} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale28 1156 709 220 24 {3768fb29-0b74-4640-b7f3-c45c95d3fb1f} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 709 138 26 {c2485292-109a-4afd-bf12-667a05984b7e} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale29 1156 733 220 24 {644240e6-34ce-44c0-afe9-5c5733c98ef7} true 0 -3 left Lucida Grande 14 3 0 0 0 206 206 206 nobackground 1018 733 138 26 {e3d2642a-6c5b-425e-9b42-83ba92498712} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 scale30 1156 758 220 24 {699ad52a-6334-4c81-85ed-b0c0c62dff8b} true 0 0 left DejaVu Sans 14 3 0 0 0 206 206 206 nobackground 1018 758 138 26 {cb60f824-d334-4897-b678-8600ac4a0ede} true 0 -3 left Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 267 375 162 93 {30bb34d6-d258-4378-bd08-c2a4a8cd442d} true 0 -3 270 378 156 59 {834120d4-1a7f-401e-8671-9257529f95cc} true 0 0 center DejaVu Sans 12 3 0 0 0 255 255 255 noborder 1 1 new 297 436 100 30 {4c65b8b1-6b84-49b5-9b41-86f4796e4005} true 0 0 value 1.00000000 New Values! / i1 0 10 false false 268 257 161 111 {6494ec80-5dcf-4335-ba2d-99aa2e2f31cd} true 0 -3 277 265 137 25 {39a0c8be-fb8f-4a5e-9c79-f8694e516142} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 midi_event 278 288 137 71 {b0139093-9747-4da9-aaf1-848c9c3b7589} true 0 -3 center Lucida Grande 12 3 0 0 0 255 255 255 noborder 1 1 i "play" 0 1 60 i "play" 1 1 62 i "play" 2 1 64 i "play" 3 1 65 i "play" 4 1 67