Home » Personal collection » Acorn hard disk » files » music » !MakeMIDI/old/!RI060999

!MakeMIDI/old/!RI060999

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn hard disk » files » music
Filename: !MakeMIDI/old/!RI060999
Read OK:
File size: 30AF bytes
Load address: 0000
Exec address: 0000
File contents
   10REM !MakeMIDI
   20REM LEN Dominic Ford, 1999
   30:
   40ON ERROR !txt%=0:$(txt%+4)=REPORT$+" at line "+STR$ERL+CHR$0:SYS "Wimp_ReportError",txt%,0,"MIDI Maker":END
   50DIM q% 256,q2% 256,r% 256,menusp% &1000,iconsp% 256,infosp% &400,txt% 256,e% 256
   60DIM space &10000
   70OSCLI"LOAD <Obey$Dir>.MIDIHeader "+STR$~space
   80?(space+&D)=&80
   90:
  100PROCclear
  110PROCsetupconvert
  120:
  130SYS "Wimp_Initialise",200,&4B534154,"MIDI Maker"
  140PROCicon(FALSE)
  150PROCmenus
  160 REPEAT
  170  SYS "Wimp_Poll",0,q% TO a%
  180  CASE a% OF
  190   WHEN 6
  200    CASE q%!12 OF
  210     WHEN -2
  220      IF q%!16=icon% AND q%!8=2 THEN PROCopen_menu
  230     WHEN save%
  240      CASE q%!16 OF
  250       WHEN 1
  260         IF (q%!8)>16 THEN
  270           !q2%=save%
  280           q2%!4=1
  290           SYS "Wimp_GetIconState",,q2%
  300           q2%!64=save%
  310           SYS "Wimp_GetWindowState",,(q2%+64)
  320           !r%=save%
  330           r%!4=5
  340           r%!8=(q2%!68)+(q2%!8)
  350           r%!12=(q2%!72)+(q2%!12)
  360           r%!16=(q2%!68)+(q2%!16)
  370           r%!20=(q2%!72)+(q2%!20)
  380           r%!24=&80000000
  390           r%!28=&80000000
  400           r%!32=&7FFFFFFF
  410           r%!36=&7FFFFFFF
  420           SYS "Wimp_DragBox",,r%
  430         ENDIF
  440       WHEN 2
  450         PROCsave(FNget_str(savetxt%))
  460         SYS "Wimp_CreateMenu",,-1
  470      ENDCASE
  480    ENDCASE
  490   WHEN 7
  500    SYS "Wimp_GetPointerInfo",,q2%
  510    !r%=36
  520    r%!16=1
  530    r%!20=q2%!12
  540    r%!24=q2%!16
  550    r%!28=!q2%
  560    r%!32=q2%!4
  570    r%!12=0
  580    r%!36=miditop%-space
  590     savefile$=FNget_str(savetxt%)
  600     p%=0
  610     WHILE INSTR(savefile$,".",p%)>0
  620       p%=INSTR(savefile$,".",p%)+1
  630     ENDWHILE
  640     savefile$=MID$(savefile$,p%)
  650     r%!40=&FD4
  660     $(r%+44)=savefile$+CHR$0
  670     !r%=((((45+LEN(savefile$)) DIV 4)+1)*4)
  680    SYS "Wimp_SendMessage",18,r%,q2%!12,q2%!16
  690    SYS "Wimp_CreateMenu",,-1
  700   WHEN 8
  710    IF (!q%=save%) AND (q%!4=0) AND (q%!24=13) THEN
  720     PROCsave(FNget_str(savetxt%))
  730     SYS "Wimp_CreateMenu",-1
  740     PROCmenus
  750    ELSE
  760     SYS "Wimp_ProcessKey",q%!24
  770    ENDIF
  780   WHEN 9
  790    PROChandlemenu
  800   WHEN 17,18
  810    CASE q%!16 OF
  820     WHEN 0
  830      END
  840     WHEN 2
  850      $(savetxt%)=FNget_str(q%+44):!savelen%=LEN(FNget_str(q%+44))
  860      PROCsave(FNget_str(q%+44))
  870      q%!12=q%!8
  880      q%!16=3
  890      SYS "Wimp_SendMessage",18,q%,q%!4
  900      q%!16=2
  910     WHEN 3
  920      IF q%!20=-2 AND q%!24=icon% THEN
  930       PROCconvert
  940       SYS "Wimp_CreateMenu",-1
  950       q%!16=3
  960      ENDIF
  970    ENDCASE
  980   WHEN 19
  990    CASE q%!16 OF
 1000     WHEN 1
 1010      PROCerror("Drag Icon to a Filer Window to Save")
 1020     WHEN 3
 1030      PROCerror("Warning - Data May be Saved Incorrectly!")
 1040    ENDCASE
 1050  ENDCASE
 1060 UNTIL FALSE
 1070:
 1080DEFPROCclear
 1090file$="":pages=0:miditop%=space+&104
 1100lenW=space+&E1:start=space+&E5
 1110ENDPROC
 1120:
 1130DEFPROCsave(file$)
 1140LOCAL f%,miditopold%
 1150LOCAL ERROR
 1160ON ERROR LOCAL RESTORE ERROR:PROCfault(ERR,REPORT$):ENDPROC
 1170miditopold%=miditop%
 1180timer%=&17:PROCsendmidi(3,&FF,&2F,0)
 1190length=miditop%-start:P%=lenW:[OPT0:EQUW0:EQUB(length DIV256):EQUB(length AND255):]
 1200OSCLI"SAVE "+file$+" "+STR$~space+" "+STR$~miditop%
 1210OSCLI"SETTYPE "+file$+" FD4"
 1220miditop%=miditopold%
 1230RESTORE ERROR
 1240ENDPROC
 1250:
 1260DEFPROCerror(e$)
 1270!e%=0
 1280$(e%+4)=e$+CHR$0
 1290SYS "Wimp_ReportError",e%,0,"MIDI Maker"
 1300ENDPROC
 1310:
 1320DEFFNconfirm(m$)
 1330LOCAL r%
 1340!e%=0
 1350$(e%+4)=m$+CHR$0
 1360SYS "Wimp_ReportError",e%,&13,"MIDI Maker" TO ,r%
 1370=r%
 1380:
 1390DEFPROCfault(err%,err$)
 1400!e%=err%
 1410$(e%+4)=err$+CHR$0
 1420IFerr%=220 THEN $(e%+4)="Bad filename"+CHR$0
 1430SYS "Wimp_ReportError",e%,0,"MIDI Maker"
 1440ENDPROC
 1450:
 1460DEFPROCconvert
 1470file$=FNget_str(q%+44)
 1480type%=q%!40
 1490IF type%<>&AF1 THEN
 1500 !txt%=0:$(txt%+4)="Please convert to a Maestro file before attempting conversion"+CHR$0
 1510 SYS "Wimp_ReportError",txt%,0,"MIDI Maker"
 1520ELSE
 1530 PROCdoit(file$)
 1540 pages=pages+1
 1550 PROCicon(TRUE):PROCmenus
 1560ENDIF
 1570ENDPROC
 1580:
 1590DEFFNget_str(q%)
 1600LOCAL fn$,p%
 1610p%=0:fn$=""
 1620REPEAT
 1630 fn$=fn$+CHR$(q%?p%)
 1640 p%=p%+1
 1650UNTIL (q%?p%)<32
 1660=fn$
 1670:
 1680DEFPROCmenus
 1690 PROCinfobox
 1700 PROCsavebox
 1710 PROCmainmenu
 1720ENDPROC
 1730:
 1740DEFPROCsavebox
 1750 m%=menusp%
 1760 m%!28=&84000012
 1770 m%!32=&01070207
 1780 m%!36=&000C0103
 1790 m%!40=0:m%!44=0
 1800 m%!48=250:m%!52=160
 1810 m%!56=&00000019
 1820 m%!60=&00000000
 1830 m%!64=1:m%!68=250:m%!70=160
 1840 $(m%+72)="Save as:"+CHR$0
 1850 m%!84=3
 1860 m%!88=15:m%!92=10
 1870 m%!96=185:m%!100=55
 1880 m%!104=&0700F13D
 1890 m%!108=m%+250
 1900 m%!112=m%+192
 1910 m%!116=100
 1920 m%!120=80:m%!124=80
 1930 m%!128=145:m%!132=145
 1940 m%!136=&0700611A
 1950 m%!140=m%+200
 1960 m%!144=1
 1970 m%!148=1
 1980 m%!152=195:m%!156=10
 1990 m%!160=240:m%!164=55
 2000 m%!168=&C701903D
 2010 $(m%+172)="OK"+CHR$0
 2020 $(m%+200)="file_fd4"
 2030 $(m%+250)=file$:savetxt%=m%+250
 2040 !(m%+148)=8:savelen%=m%+148
 2050 m%!192=0
 2060 SYS "Wimp_CreateWindow",,m% TO save%
 2070ENDPROC
 2080:
 2090DEFPROCmainmenu
 2100 p%=menusp%+512:mainmenu%=p%
 2110 $p%="MIDI Maker"+CHR$0:p%!12=&70207:p%!16=200
 2120 p%!20=40:p%!24=0:f%=p%+28
 2130 !f%=0:f%!4=info%:f%!8=&07000011:$(f%+12)="Info"+CHR$0:f%+=24
 2140 IFpages=0THENf%!8=2^22+&07000011 ELSEf%!8=&07000011
 2150 !f%=0:f%!4=save%:$(f%+12)="Make MIDI"+CHR$0:f%+=24
 2160 IFpages=0THENf%!8=2^22+&07000011 ELSEf%!8=&07003011
 2170 !f%=0:f%!4=-1:$(f%+12)="Clear"+CHR$0:f%+=24
 2180 !f%=&80:f%!4=-1:f%!8=&07003011:$(f%+12)="Quit"+CHR$0:f%+=24
 2190ENDPROC
 2200:
 2210DEFPROChandlemenu
 2220 LOCAL a%,l%
 2230 CASE !q% OF
 2240   WHEN 2
 2250    a%=FNconfirm("Wipe processed music... Are you sure?")
 2260    IF a%=1 THEN PROCclear:PROCicon(TRUE):PROCmenus
 2270   WHEN 3
 2280   END
 2290 ENDCASE
 2300 SYS "Wimp_GetPointerInfo",,q%
 2310 IF ((q%!8) AND 1)=1 THEN PROCopen_menu
 2320ENDPROC
 2330:
 2340DEFPROCinfobox
 2350LOCAL s%,i%
 2360s%=infosp%
 2370s%!28=&84000012
 2380s%!32=&1070207
 2390s%!36=&20103
 2400s%!40=20:s%!44=0
 2410s%!48=636:s%!52=216
 2420s%!56=&00000119
 2430s%!60=&00000000
 2440s%!64=1
 2450s%!68=616
 2460s%!70=216
 2470s%!72=s%+528
 2480s%!76=s%+390
 2490s%!80=32
 2500s%!84=8
 2510i%=s%+88
 2520!i%=32:i%!4=8
 2530i%!8=184:i%!12=56
 2540i%!16=&07000211
 2550$(i%+20)="Version:"+CHR$0
 2560i%+=32
 2570!i%=188:i%!4=8
 2580i%!8=632:i%!12=56
 2590i%!16=&0700013D
 2600i%!20=s%+400
 2610i%!24=s%+390
 2620i%!28=30
 2630i%+=32
 2640!i%=32:i%!4=60
 2650i%!8=184:i%!12=108
 2660i%!16=&07000211
 2670$(i%+20)="Author:"+CHR$0
 2680i%+=32
 2690!i%=188:i%!4=60
 2700i%!8=632:i%!12=108
 2710i%!16=&0700013D
 2720i%!20=s%+432
 2730i%!24=s%+390
 2740i%!28=30
 2750i%+=32
 2760!i%=32:i%!4=112
 2770i%!8=184:i%!12=160
 2780i%!16=&07000211
 2790$(i%+20)="Purpose:"+CHR$0
 2800i%+=32
 2810!i%=188:i%!4=112
 2820i%!8=632:i%!12=160
 2830i%!16=&0700013D
 2840i%!20=s%+464
 2850i%!24=s%+390
 2860i%!28=30
 2870i%+=32
 2880!i%=32:i%!4=164
 2890i%!8=184:i%!12=212
 2900i%!16=&07000211
 2910$(i%+20)="Name:"+CHR$0
 2920i%+=32
 2930!i%=188:i%!4=164
 2940i%!8=632:i%!12=212
 2950i%!16=&0700013D
 2960i%!20=s%+496
 2970i%!24=s%+390
 2980i%!28=30
 2990s%!390=0
 3000$(s%+400)="1.00 (8-Aug-99)"+CHR$0
 3010$(s%+432)="� Dominic Ford, 1999"+CHR$0
 3020$(s%+464)="Maestro to MIDI"+CHR$0
 3030$(s%+496)="MIDI Maker"+CHR$0
 3040$(s%+528)="About this program"+CHR$0
 3050SYS "Wimp_CreateWindow",,s% TO info%
 3060ENDPROC
 3070:
 3080DEFPROCopen_menu
 3090 SYS "Wimp_CreateMenu",,mainmenu%,(!q%)-64,160
 3100ENDPROC
 3110:
 3120DEFPROCicon(redraw)
 3130sp%=iconsp%
 3140IF redraw THEN
 3150 !sp%=-1:sp%!4=icon%
 3160 SYS "Wimp_DeleteIcon",,sp%
 3170ENDIF
 3180!sp%=-1
 3190sp%!4=0
 3200sp%!8=-16
 3210sp%!12=128:sp%!16=84
 3220sp%!20=&1700310B
 3230sp%!24=sp%+40
 3240sp%!28=sp%+80
 3250sp%!32=32
 3260IF pages=0 THEN $(sp%+40)="Idle"+CHR$0
 3270IF pages=1 THEN $(sp%+40)="1 page"+CHR$0
 3280IF pages>1 THEN $(sp%+40)=STR$pages+" pages"+CHR$0
 3290$(sp%+80)="S!makemidi"+CHR$0
 3300SYS "Wimp_CreateIcon",,sp% TO icon%
 3310ENDPROC
 3320:
 3330REM CONVERSION ENGINE
 3340:
 3350DEFPROCdoit(filename$)
 3360SYS"Hourglass_On"
 3370PROCloadmusic
 3380PROCdoconversion
 3390SYS"Hourglass_Off"
 3400ENDPROC
 3410:
 3420DEFPROCsetupconvert
 3430DIM S &9000
 3440DIM queue%(7),clef%(7),note%(7),count%(7),pos%(7),midi%(7,7),midisend%(1,31,1)
 3450DIMaccstatus%(7),sharpseq%(6),flatseq%(6)
 3460PROCreaddata
 3470ENDPROC
 3480:
 3490DEFPROCloadmusic
 3500FILE%=OPENIN filename$
 3510M$="":FORR%=1TO7:M$+=CHR$BGET#FILE%:NEXT
 3520IFM$<>"Maestro"THENPRINT"Maestro file is corrupt":END
 3530B%=BGET#FILE%:B2%=BGET#FILE%:B3%=BGET#FILE%
 3540IFB%<>&A ORB2%<>2 ORB3%<>1THENPRINT"This Maestro file is in a non-standard format. Please load it into Maestro and  resave it.":CLOSE#FILE%:END
 3550INPUT#FILE%,gates%:FORR%=0TO7:INPUT#FILE%,queue%(R%):NEXT
 3560FORR%=1TOgates%:?(S+R%)=BGET#FILE%:NEXT
 3570FORV%=0TO7
 3580 IFqueue%(V%)<>0THENFORR%=1TOqueue%(V%):?(S+R%+&1000*V%+&1000)=BGET#FILE%:NEXT
 3590NEXT
 3600B%=BGET#FILE%:IFB%<>2 THENPRINT"This Maestro file is in a non-standard format. Please load it into Maestro and  resave it.":CLOSE#FILE%:END
 3610staves%=BGET#FILE%+4*BGET#FILE%
 3620CLOSE#FILE%
 3630ENDPROC
 3640:
 3650DEFPROCdoconversion
 3660FORR%=0TO7:pos%(R%)=S+&1000*R%+&1001:clef%(R%)=0:count%(R%)=0:accstatus%(R%)=0:NEXT
 3670keyflat=FALSE:noaccidents%=0:PROCbarline
 3680position%=S+1:timer%=0:PROCreadgates:MODE0
 3690REPEAT
 3700 timer%=0
 3710 REPEAT
 3720  moveon=FALSE:timer%=timer%+1
 3730  FORR%=0TO7
 3740   IFcount%(R%)=1THEN
 3750    moveon=TRUE
 3760    PROCsendmidi(3,&80+midi%(staves%,R%),note%(R%),0)
 3770   ENDIF
 3780   IFcount%(R%)<>0THENcount%(R%)=count%(R%)-1
 3790  NEXT
 3800  REMFORwait=0TO125:NEXT
 3810 UNTIL moveon
 3820 PROCreadgates
 3830 SYS"Hourglass_Percentage",INT((position%-S)/gates%*100)
 3840UNTILposition%>(gates%+S)
 3850ENDPROC
 3860:
 3870DEFPROCreadgates
 3880LOCALtype%
 3890 type%=?position%
 3900 IF type%=0THEN
 3910  PROCspecial(?(position%+1)):position%=position%+2
 3920  IFNOT(position%>(gates%+S))THENPROCreadgates
 3930 ELSE
 3940  PROCaddnotes(type%):position%=position%+1
 3950 ENDIF
 3960ENDPROC
 3970:
 3980DEFPROCaddnotes(queues%)
 3990LOCALR%
 4000 FORR%=0TO7
 4010  IF(queues%MOD2)=1THENPROCgetqueue(R%)
 4020  queues%=queues%DIV2
 4030 NEXT
 4040ENDPROC
 4050:
 4060DEFPROCgetqueue(q%)
 4070LOCALnotepos%,note%,accidentals%,lenbits%,dots%
 4080 IFcount%(q%)<>0THEN
 4090  PROCsendmidi(3,&80+midi%(staves%,q%),note%(q%),0)
 4100 ENDIF
 4110 notepos%=(?pos%(q%))DIV8
 4120 accidentals%=FNrevbits(?(pos%(q%)+1),0,3)
 4130 IFaccidentals%<>0THENPROCchangeaccstatus(midisend%(clef%(q%),notepos%,1),accidentals%)
 4140 note%=midisend%(clef%(q%),notepos%,0)+accstatus%(midisend%(clef%(q%),notepos%,1))
 4150 PROCsendmidi(3,&90+midi%(staves%,q%),note%,&3F)
 4160 note%(q%)=note%
 4170 lenbits%=FNrevbits(?(pos%(q%)+1),5,3)
 4180 dots%=FNrevbits(?(pos%(q%)+1),3,2)
 4190 count%(q%)=INT((2^(8-lenbits%))*4*(1.5^dots%))
 4200 pos%(q%)=pos%(q%)+2
 4210ENDPROC
 4220:
 4230DEFFNrevbits(bits%,first%,no%)
 4240 LOCALR%,out%
 4250 out%=0
 4260 FORR%=0TOno%-1
 4270  out%=out%-(2^R%)*((bits%AND(2^(first%+R%)))<>0)
 4280 NEXT
 4290=out%
 4300:
 4310DEFPROCspecial(type%)
 4320 IF(type%AND1)=1THENPROCtimsig
 4330 IF(type%AND3)=2THENPROCkeysig
 4340 IF(type%AND7)=4THENPROCclefset
 4350 IF(type%AND63)=32THENPROCbarline
 4360ENDPROC
 4370:
 4380DEFPROCtimsig
 4390ENDPROC
 4400:
 4410DEFPROCkeysig
 4420 keyflat=((type%AND4)=4)
 4430 noaccidents%=FNrevbits(type%,3,3)
 4440 PROCbarline
 4450ENDPROC
 4460:
 4470DEFPROCclefset
 4480 LOCALclef%,stave%
 4490 clef%=(type%AND16)DIV16
 4500 stave%=((type%AND32)DIV32)*2+((type%AND64)DIV64)
 4510 FORR%=0TO7
 4520  IFmidi%(staves%,R%)=stave% THENclef%(R%)=clef%
 4530 NEXT
 4540ENDPROC
 4550:
 4560DEFPROCbarline
 4570 IF keyflat THEN
 4580  FORR%=0TO6
 4590   IFflatseq%(R%)<noaccidents%THENaccstatus%(R%)=-1 ELSEaccstatus%(R%)=0
 4600  NEXT
 4610 ELSE
 4620  FORR%=0TO6
 4630   IFsharpseq%(R%)<noaccidents%THENaccstatus%(R%)=1 ELSEaccstatus%(R%)=0
 4640  NEXT
 4650 ENDIF
 4660ENDPROC
 4670:
 4680DEFPROCchangeaccstatus(key%,type%)
 4690 CASE type% OF
 4700  WHEN 1:accstatus%(key%)=0
 4710  WHEN 2:accstatus%(key%)=1
 4720  WHEN 3:accstatus%(key%)=-1
 4730 ENDCASE
 4740ENDPROC
 4750:
 4760DEFPROCdeltatime(n%)
 4770LOCALbytes%,a%,b%,c%,d%
 4780d%=FNrevbits(n%,0,7):bytes%=1
 4790c%=FNrevbits(n%,7,7)+128:IFc%<>128THENbytes%=2
 4800b%=FNrevbits(n%,14,7)+128:IFb%<>128THENbytes%=3
 4810a%=FNrevbits(n%,21,7)+128:IFa%<>128THENbytes%=4
 4820IFbytes%>3THEN?miditop%=a%:miditop%=miditop%+1
 4830IFbytes%>2THEN?miditop%=b%:miditop%=miditop%+1
 4840IFbytes%>1THEN?miditop%=c%:miditop%=miditop%+1
 4850?miditop%=d%:miditop%=miditop%+1
 4860ENDPROC
 4870:
 4880DEFPROCsendmidi(n,x,y,z)
 4890 PROCdeltatime(timer%):timer%=0
 4900 ?miditop%=x
 4910 IFn>1 THEN ?(miditop%+1)=y
 4920 IFn>2 THEN ?(miditop%+2)=z
 4930 miditop%=miditop%+n
 4940ENDPROC
 4950:
 4960DEFPROCreaddata
 4970 RESTORE
 4980 FORstaves%=0TO7
 4990  FORR%=0TO7:READmidi%(staves%,R%):NEXT
 5000 NEXT
 5010 FORclef%=0TO1
 5020  FORnote%=0TO31
 5030   FORdata%=0TO1
 5040    READmidisend%(clef%,note%,data%)
 5050   NEXT
 5060  NEXT
 5070 NEXT
 5080 REM Below represents "Father Christmas Goes Down All Escalators Backwards!"
 5090 sharpseq%(0)=4:flatseq%(0)=2:REM A
 5100 sharpseq%(1)=6:flatseq%(1)=0:REM B
 5110 sharpseq%(2)=1:flatseq%(2)=5:REM C
 5120 sharpseq%(3)=3:flatseq%(3)=3:REM D
 5130 sharpseq%(4)=5:flatseq%(4)=1:REM E
 5140 sharpseq%(5)=0:flatseq%(5)=6:REM F
 5150 sharpseq%(6)=2:flatseq%(6)=4:REM G
 5160ENDPROC
 5170ENDPROC
 5180:
 5190REM MIDI Voice allocations to each queue
 5200DATA0,0,0,0,0,0,0,0
 5210DATA0,0,0,0,1,1,1,1
 5220DATA0,1,1,1,1,2,2,2
 5230DATA0,0,1,1,2,2,3,3
 5240DATA0,0,0,0,0,0,0,9
 5250DATA0,0,0,0,1,1,1,9
 5260DATA0,1,1,1,1,2,2,9
 5270DATA0,0,1,1,2,2,3,9
 5280:
 5290REM Treble Clef (Maestro line no/accidental --> MIDI Note)
 5300DATA0,7
 5310DATA45,0
 5320DATA47,1
 5330DATA48,2
 5340DATA50,3
 5350DATA52,4
 5360DATA53,5
 5370DATA55,6
 5380DATA57,0
 5390DATA59,1
 5400DATA60,2
 5410DATA62,3
 5420DATA64,4
 5430DATA65,5
 5440DATA67,6
 5450DATA69,0
 5460DATA71,1
 5470DATA72,2
 5480DATA74,3
 5490DATA76,4
 5500DATA77,5
 5510DATA79,6
 5520DATA81,0
 5530DATA83,1
 5540DATA84,2
 5550DATA86,3
 5560DATA88,4
 5570DATA89,5
 5580DATA91,6
 5590DATA93,0
 5600DATA95,1
 5610DATA96,2
 5620:
 5630REM Bass Clef (Maestro line no/accidental --> MIDI Note)
 5640DATA0,7
 5650DATA24,2
 5660DATA26,3
 5670DATA28,4
 5680DATA29,5
 5690DATA31,6
 5700DATA33,0
 5710DATA35,1
 5720DATA36,2
 5730DATA38,3
 5740DATA40,4
 5750DATA41,5
 5760DATA43,6
 5770DATA45,0
 5780DATA47,1
 5790DATA48,2
 5800DATA50,3
 5810DATA52,4
 5820DATA53,5
 5830DATA55,6
 5840DATA57,0
 5850DATA59,1
 5860DATA60,2
 5870DATA62,3
 5880DATA64,4
 5890DATA65,5
 5900DATA67,6
 5910DATA69,0
 5920DATA71,1
 5930DATA72,2
 5940DATA74,3
 5950DATA76,4

� !MakeMIDI
� � Dominic Ford, 1999
:
(Z� � !txt%=0:$(txt%+4)=�$+" at line "+Þ+�0:ș "Wimp_ReportError",txt%,0,"MIDI Maker":�
2R� q% 256,q2% 256,r% 256,menusp% &1000,iconsp% 256,infosp% &400,txt% 256,e% 256
<� space &10000
F*�"LOAD <Obey$Dir>.MIDIHeader "+�~space
P?(space+&D)=&80
Z:
d
�clear
n�setupconvert
x:
�3ș "Wimp_Initialise",200,&4B534154,"MIDI Maker"
��icon(�)
�
�menus
� �
�  ș "Wimp_Poll",0,q% � a%
�
  Ȏ a% �
�
   � 6
�    Ȏ q%!12 �
�
     � -2
�-      � q%!16=icon% � q%!8=2 � �open_menu
�     � save%
�      Ȏ q%!16 �
�       � 1
         � (q%!8)>16 �
           !q2%=save%
           q2%!4=1
"*           ș "Wimp_GetIconState",,q2%
,           q2%!64=save%
61           ș "Wimp_GetWindowState",,(q2%+64)
@           !r%=save%
J           r%!4=5
T$           r%!8=(q2%!68)+(q2%!8)
^&           r%!12=(q2%!72)+(q2%!12)
h&           r%!16=(q2%!68)+(q2%!16)
r&           r%!20=(q2%!72)+(q2%!20)
|           r%!24=&80000000
�           r%!28=&80000000
�           r%!32=&7FFFFFFF
�           r%!36=&7FFFFFFF
�$           ș "Wimp_DragBox",,r%
�         �
�       � 2
�&         �save(�get_str(savetxt%))
�%         ș "Wimp_CreateMenu",,-1
�      �
�	    �
�
   � 7
�%    ș "Wimp_GetPointerInfo",,q2%
�    !r%=36
    r%!16=1
    r%!20=q2%!12
    r%!24=q2%!16
&    r%!28=!q2%
0    r%!32=q2%!4
:    r%!12=0
D    r%!36=miditop%-space
N%     savefile$=�get_str(savetxt%)
X
     p%=0
b      ȕ �savefile$,".",p%)>0
l"       p%=�savefile$,".",p%)+1
v
     �
�!     savefile$=�savefile$,p%)
�     r%!40=&FD4
�     $(r%+44)=savefile$+�0
�,     !r%=((((45+�(savefile$)) � 4)+1)*4)
�1    ș "Wimp_SendMessage",18,r%,q2%!12,q2%!16
�     ș "Wimp_CreateMenu",,-1
�
   � 8
�/    � (!q%=save%) � (q%!4=0) � (q%!24=13) �
�"     �save(�get_str(savetxt%))
�      ș "Wimp_CreateMenu",-1
�     �menus
�	    �
�#     ș "Wimp_ProcessKey",q%!24
	    �

   � 9
    �handlemenu
    � 17,18
*    Ȏ q%!16 �
4     � 0
>      �
H     � 2
RB      $(savetxt%)=�get_str(q%+44):!savelen%=�(�get_str(q%+44))
\       �save(�get_str(q%+44))
f      q%!12=q%!8
p      q%!16=3
z*      ș "Wimp_SendMessage",18,q%,q%!4
�      q%!16=2
�     � 3
�$      � q%!20=-2 � q%!24=icon% �
�       �convert
�"       ș "Wimp_CreateMenu",-1
�       q%!16=3
�      �
�	    �
�   � 19
�    Ȏ q%!16 �
�     � 1
�7      �error("Drag Icon to a Filer Window to Save")
�     � 3
<      �error("Warning - Data May be Saved Incorrectly!")
	    �
  �
$ � �
.:
8��clear
B(file$="":pages=0:miditop%=space+&104
L"lenW=space+&E1:start=space+&E5
V�
`:
j��save(file$)
t� f%,miditopold%
~� �
�� � � � �:�fault(�,�$):�
�miditopold%=miditop%
�%timer%=&17:�sendmidi(3,&FF,&2F,0)
�Slength=miditop%-start:P%=lenW:[OPT0:EQUW0:EQUB(length �256):EQUB(length �255):]
�-�"SAVE "+file$+" "+�~space+" "+�~miditop%
��"SETTYPE "+file$+" FD4"
�miditop%=miditopold%
�� �
��
�:
���error(e$)
�	!e%=0
$(e%+4)=e$+�0

+ș "Wimp_ReportError",e%,0,"MIDI Maker"
�
:
(ݤconfirm(m$)
2� r%
<	!e%=0
F$(e%+4)=m$+�0
P3ș "Wimp_ReportError",e%,&13,"MIDI Maker" � ,r%
Z=r%
d:
n��fault(err%,err$)
x!e%=err%
�$(e%+4)=err$+�0
�)�err%=220 � $(e%+4)="Bad filename"+�0
�+ș "Wimp_ReportError",e%,0,"MIDI Maker"
��
�:
�
��convert
�file$=�get_str(q%+44)
�type%=q%!40
�� type%<>&AF1 �
�Y !txt%=0:$(txt%+4)="Please convert to a Maestro file before attempting conversion"+�0
�. ș "Wimp_ReportError",txt%,0,"MIDI Maker"
��
� �doit(file$)
 pages=pages+1
 �icon(�):�menus
�
"�
,:
6ݤget_str(q%)
@� fn$,p%
Jp%=0:fn$=""
T�
^ fn$=fn$+�(q%?p%)
h p%=p%+1
r� (q%?p%)<32
|=fn$
�:
���menus
�
 �infobox
�
 �savebox
� �mainmenu
��
�:
�
��savebox
� m%=menusp%
� m%!28=&84000012
� m%!32=&01070207
� m%!36=&000C0103
� m%!40=0:m%!44=0
 m%!48=250:m%!52=160
 m%!56=&00000019
 m%!60=&00000000
&  m%!64=1:m%!68=250:m%!70=160
0 $(m%+72)="Save as:"+�0
: m%!84=3
D m%!88=15:m%!92=10
N m%!96=185:m%!100=55
X m%!104=&0700F13D
b m%!108=m%+250
l m%!112=m%+192
v m%!116=100
� m%!120=80:m%!124=80
� m%!128=145:m%!132=145
� m%!136=&0700611A
� m%!140=m%+200
�
 m%!144=1
�
 m%!148=1
� m%!152=195:m%!156=10
� m%!160=240:m%!164=55
� m%!168=&C701903D
� $(m%+172)="OK"+�0
� $(m%+200)="file_fd4"
�$ $(m%+250)=file$:savetxt%=m%+250
�  !(m%+148)=8:savelen%=m%+148

 m%!192=0
' ș "Wimp_CreateWindow",,m% � save%
�
 :
*��mainmenu
4  p%=menusp%+512:mainmenu%=p%
>/ $p%="MIDI Maker"+�0:p%!12=&70207:p%!16=200
H p%!20=40:p%!24=0:f%=p%+28
R> !f%=0:f%!4=info%:f%!8=&07000011:$(f%+12)="Info"+�0:f%+=24
\1 �pages=0�f%!8=2^22+&07000011 �f%!8=&07000011
f4 !f%=0:f%!4=save%:$(f%+12)="Make MIDI"+�0:f%+=24
p1 �pages=0�f%!8=2^22+&07000011 �f%!8=&07003011
z- !f%=0:f%!4=-1:$(f%+12)="Clear"+�0:f%+=24
�= !f%=&80:f%!4=-1:f%!8=&07003011:$(f%+12)="Quit"+�0:f%+=24
��
�:
���handlemenu
� � a%,l%
�
 Ȏ !q% �
�
   � 2
�<    a%=�confirm("Wipe processed music... Are you sure?")
�'    � a%=1 � �clear:�icon(�):�menus
�
   � 3
�   �
� �
�! ș "Wimp_GetPointerInfo",,q%
	" � ((q%!8) � 1)=1 � �open_menu
	�
	:
	$
��infobox
	.� s%,i%
	8s%=infosp%
	Bs%!28=&84000012
	Ls%!32=&1070207
	Vs%!36=&20103
	`s%!40=20:s%!44=0
	js%!48=636:s%!52=216
	ts%!56=&00000119
	~s%!60=&00000000
	�s%!64=1
	�
s%!68=616
	�
s%!70=216
	�s%!72=s%+528
	�s%!76=s%+390
	�s%!80=32
	�s%!84=8
	�i%=s%+88
	�!i%=32:i%!4=8
	�i%!8=184:i%!12=56
	�i%!16=&07000211
	�$(i%+20)="Version:"+�0

i%+=32

!i%=188:i%!4=8
i%!8=632:i%!12=56
i%!16=&0700013D
(i%!20=s%+400
2i%!24=s%+390
<i%!28=30
F
i%+=32
P!i%=32:i%!4=60
Zi%!8=184:i%!12=108
di%!16=&07000211
n$(i%+20)="Author:"+�0
x
i%+=32
�!i%=188:i%!4=60
�i%!8=632:i%!12=108
�i%!16=&0700013D
�i%!20=s%+432
�i%!24=s%+390
�i%!28=30
�
i%+=32
�!i%=32:i%!4=112
�i%!8=184:i%!12=160
�i%!16=&07000211
�$(i%+20)="Purpose:"+�0
�
i%+=32
�!i%=188:i%!4=112
i%!8=632:i%!12=160
i%!16=&0700013D
i%!20=s%+464
"i%!24=s%+390
,i%!28=30
6
i%+=32
@!i%=32:i%!4=164
Ji%!8=184:i%!12=212
Ti%!16=&07000211
^$(i%+20)="Name:"+�0
h
i%+=32
r!i%=188:i%!4=164
|i%!8=632:i%!12=212
�i%!16=&0700013D
�i%!20=s%+496
�i%!24=s%+390
�i%!28=30
�s%!390=0
�"$(s%+400)="1.00 (8-Aug-99)"+�0
�'$(s%+432)="� Dominic Ford, 1999"+�0
�"$(s%+464)="Maestro to MIDI"+�0
�$(s%+496)="MIDI Maker"+�0
�%$(s%+528)="About this program"+�0
�&ș "Wimp_CreateWindow",,s% � info%
��
�:
��open_menu
1 ș "Wimp_CreateMenu",,mainmenu%,(!q%)-64,160
�
&:
0��icon(redraw)
:sp%=iconsp%
D� redraw �
N !sp%=-1:sp%!4=icon%
X ș "Wimp_DeleteIcon",,sp%
b�
l!sp%=-1
vsp%!4=0
�
sp%!8=-16
�sp%!12=128:sp%!16=84
�sp%!20=&1700310B
�sp%!24=sp%+40
�sp%!28=sp%+80
�
sp%!32=32
�#� pages=0 � $(sp%+40)="Idle"+�0
�%� pages=1 � $(sp%+40)="1 page"+�0
�,� pages>1 � $(sp%+40)=�pages+" pages"+�0
�$(sp%+80)="S!makemidi"+�0
�%ș "Wimp_CreateIcon",,sp% � icon%
��
�:

� CONVERSION ENGINE

:

��doit(filename$)

 ș"Hourglass_On"

*�loadmusic

4�doconversion

>ș"Hourglass_Off"

H�

R:

\��setupconvert

f
� S &9000

pP� queue%(7),clef%(7),note%(7),count%(7),pos%(7),midi%(7,7),midisend%(1,31,1)

z+�accstatus%(7),sharpseq%(6),flatseq%(6)

�
�readdata

��

�:

���loadmusic

�FILE%=� filename$

� M$="":�R%=1�7:M$+=��#FILE%:�

�/�M$<>"Maestro"��"Maestro file is corrupt":�

�&B%=�#FILE%:B2%=�#FILE%:B3%=�#FILE%

ԃ�B%<>&A �B2%<>2 �B3%<>1��"This Maestro file is in a non-standard format. Please load it into Maestro and  resave it.":�#FILE%:�

�/�#FILE%,gates%:�R%=0�7:�#FILE%,queue%(R%):�

�"�R%=1�gates%:?(S+R%)=�#FILE%:�

��V%=0�7

�E �queue%(V%)<>0��R%=1�queue%(V%):?(S+R%+&1000*V%+&1000)=�#FILE%:�
�
~B%=�#FILE%:�B%<>2 ��"This Maestro file is in a non-standard format. Please load it into Maestro and  resave it.":�#FILE%:�
staves%=�#FILE%+4*�#FILE%
$�#FILE%
.�
8:
B��doconversion
LQ�R%=0�7:pos%(R%)=S+&1000*R%+&1001:clef%(R%)=0:count%(R%)=0:accstatus%(R%)=0:�
V%keyflat=�:noaccidents%=0:�barline
`(position%=S+1:timer%=0:�readgates:�0
j�
t
 timer%=0
~ �
�  moveon=�:timer%=timer%+1
�
  �R%=0�7
�   �count%(R%)=1�
�    moveon=�
�6    �sendmidi(3,&80+midi%(staves%,R%),note%(R%),0)
�   �
�-   �count%(R%)<>0�count%(R%)=count%(R%)-1
�  �
�  �FORwait=0TO125:NEXT
�
 � moveon
� �readgates
�9 ș"Hourglass_Percentage",�((position%-S)/gates%*100)
�position%>(gates%+S)

�
:
��readgates
(
�type%
2 type%=?position%
< � type%=0�
F4  �special(?(position%+1)):position%=position%+2
P)  �(position%>(gates%+S))��readgates
Z �
d,  �addnotes(type%):position%=position%+1
n �
x�
�:
���addnotes(queues%)
��R%
� �R%=0�7
�"  �(queues%�2)=1��getqueue(R%)
�  queues%=queues%�2
� �
��
�:
���getqueue(q%)
�/�notepos%,note%,accidentals%,lenbits%,dots%
� �count%(q%)<>0�
�4  �sendmidi(3,&80+midi%(staves%,q%),note%(q%),0)
 �
 notepos%=(?pos%(q%))�8
- accidentals%=�revbits(?(pos%(q%)+1),0,3)
"T �accidentals%<>0��changeaccstatus(midisend%(clef%(q%),notepos%,1),accidentals%)
,V note%=midisend%(clef%(q%),notepos%,0)+accstatus%(midisend%(clef%(q%),notepos%,1))
61 �sendmidi(3,&90+midi%(staves%,q%),note%,&3F)
@ note%(q%)=note%
J) lenbits%=�revbits(?(pos%(q%)+1),5,3)
T& dots%=�revbits(?(pos%(q%)+1),3,2)
^1 count%(q%)=�((2^(8-lenbits%))*4*(1.5^dots%))
h pos%(q%)=pos%(q%)+2
r�
|:
�ݤrevbits(bits%,first%,no%)
�
 �R%,out%
� out%=0
� �R%=0�no%-1
�3  out%=out%-(2^R%)*((bits%�(2^(first%+R%)))<>0)
� �
�	=out%
�:
���special(type%)
� �(type%�1)=1��timsig
� �(type%�3)=2��keysig
� �(type%�7)=4��clefset
� �(type%�63)=32��barline
�
:
��timsig
&�
0:
:��keysig
D keyflat=((type%�4)=4)
N% noaccidents%=�revbits(type%,3,3)
X
 �barline
b�
l:
v
��clefset
� �clef%,stave%
� clef%=(type%�16)�16
�- stave%=((type%�32)�32)*2+((type%�64)�64)
� �R%=0�7
�0  �midi%(staves%,R%)=stave% �clef%(R%)=clef%
� �
��
�:
�
��barline
� � keyflat �
�
  �R%=0�6
�E   �flatseq%(R%)<noaccidents%�accstatus%(R%)=-1 �accstatus%(R%)=0
�  �
 �

  �R%=0�6
E   �sharpseq%(R%)<noaccidents%�accstatus%(R%)=1 �accstatus%(R%)=0
   �
* �
4�
>:
H!��changeaccstatus(key%,type%)
R Ȏ type% �
\  � 1:accstatus%(key%)=0
f  � 2:accstatus%(key%)=1
p  � 3:accstatus%(key%)=-1
z �
��
�:
���deltatime(n%)
��bytes%,a%,b%,c%,d%
� d%=�revbits(n%,0,7):bytes%=1
�-c%=�revbits(n%,7,7)+128:�c%<>128�bytes%=2
�.b%=�revbits(n%,14,7)+128:�b%<>128�bytes%=3
�.a%=�revbits(n%,21,7)+128:�a%<>128�bytes%=4
�.�bytes%>3�?miditop%=a%:miditop%=miditop%+1
�.�bytes%>2�?miditop%=b%:miditop%=miditop%+1
�.�bytes%>1�?miditop%=c%:miditop%=miditop%+1
�$?miditop%=d%:miditop%=miditop%+1
��
:
��sendmidi(n,x,y,z)
  �deltatime(timer%):timer%=0
$ ?miditop%=x
. �n>1 � ?(miditop%+1)=y
8 �n>2 � ?(miditop%+2)=z
B miditop%=miditop%+n
L�
V:
`��readdata
j �
t �staves%=0�7
~"  �R%=0�7:�midi%(staves%,R%):�
� �
� �clef%=0�1
�  �note%=0�31
�   �data%=0�1
�%    �midisend%(clef%,note%,data%)
�   �
�  �
� �
�N � Below represents "Father Christmas Goes Down All Escalators Backwards!"
�% sharpseq%(0)=4:flatseq%(0)=2:� A
�% sharpseq%(1)=6:flatseq%(1)=0:� B
�% sharpseq%(2)=1:flatseq%(2)=5:� C
% sharpseq%(3)=3:flatseq%(3)=3:� D

% sharpseq%(4)=5:flatseq%(4)=1:� E
% sharpseq%(5)=0:flatseq%(5)=6:� F
% sharpseq%(6)=2:flatseq%(6)=4:� G
(�
2�
<:
F*� MIDI Voice allocations to each queue
P�0,0,0,0,0,0,0,0
Z�0,0,0,0,1,1,1,1
d�0,1,1,1,1,2,2,2
n�0,0,1,1,2,2,3,3
x�0,0,0,0,0,0,0,9
��0,0,0,0,1,1,1,9
��0,1,1,1,1,2,2,9
��0,0,1,1,2,2,3,9
�:
�<� Treble Clef (Maestro line no/accidental --> MIDI Note)
��0,7
�	�45,0
�	�47,1
�	�48,2
�	�50,3
�	�52,4
�	�53,5
�	�55,6
	�57,0
	�59,1
	�60,2
"	�62,3
,	�64,4
6	�65,5
@	�67,6
J	�69,0
T	�71,1
^	�72,2
h	�74,3
r	�76,4
|	�77,5
�	�79,6
�	�81,0
�	�83,1
�	�84,2
�	�86,3
�	�88,4
�	�89,5
�	�91,6
�	�93,0
�	�95,1
�	�96,2
�:
�:� Bass Clef (Maestro line no/accidental --> MIDI Note)
�0,7
	�24,2
	�26,3
&	�28,4
0	�29,5
:	�31,6
D	�33,0
N	�35,1
X	�36,2
b	�38,3
l	�40,4
v	�41,5
�	�43,6
�	�45,0
�	�47,1
�	�48,2
�	�50,3
�	�52,4
�	�53,5
�	�55,6
�	�57,0
�	�59,1
�	�60,2
�	�62,3
�	�64,4
	�65,5
	�67,6
	�69,0
 	�71,1
*	�72,2
4	�74,3
>	�76,4
�
00000000  0d 00 0a 0f f4 20 21 4d  61 6b 65 4d 49 44 49 0d  |..... !MakeMIDI.|
00000010  00 14 1a f4 20 a9 20 44  6f 6d 69 6e 69 63 20 46  |.... . Dominic F|
00000020  6f 72 64 2c 20 31 39 39  39 0d 00 1e 05 3a 0d 00  |ord, 1999....:..|
00000030  28 5a ee 20 85 20 21 74  78 74 25 3d 30 3a 24 28  |(Z. . !txt%=0:$(|
00000040  74 78 74 25 2b 34 29 3d  f6 24 2b 22 20 61 74 20  |txt%+4)=.$+" at |
00000050  6c 69 6e 65 20 22 2b c3  9e 2b bd 30 3a c8 99 20  |line "+..+.0:.. |
00000060  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
00000070  72 22 2c 74 78 74 25 2c  30 2c 22 4d 49 44 49 20  |r",txt%,0,"MIDI |
00000080  4d 61 6b 65 72 22 3a e0  0d 00 32 52 de 20 71 25  |Maker":...2R. q%|
00000090  20 32 35 36 2c 71 32 25  20 32 35 36 2c 72 25 20  | 256,q2% 256,r% |
000000a0  32 35 36 2c 6d 65 6e 75  73 70 25 20 26 31 30 30  |256,menusp% &100|
000000b0  30 2c 69 63 6f 6e 73 70  25 20 32 35 36 2c 69 6e  |0,iconsp% 256,in|
000000c0  66 6f 73 70 25 20 26 34  30 30 2c 74 78 74 25 20  |fosp% &400,txt% |
000000d0  32 35 36 2c 65 25 20 32  35 36 0d 00 3c 12 de 20  |256,e% 256..<.. |
000000e0  73 70 61 63 65 20 26 31  30 30 30 30 0d 00 46 2a  |space &10000..F*|
000000f0  ff 22 4c 4f 41 44 20 3c  4f 62 65 79 24 44 69 72  |."LOAD <Obey$Dir|
00000100  3e 2e 4d 49 44 49 48 65  61 64 65 72 20 22 2b c3  |>.MIDIHeader "+.|
00000110  7e 73 70 61 63 65 0d 00  50 13 3f 28 73 70 61 63  |~space..P.?(spac|
00000120  65 2b 26 44 29 3d 26 38  30 0d 00 5a 05 3a 0d 00  |e+&D)=&80..Z.:..|
00000130  64 0a f2 63 6c 65 61 72  0d 00 6e 11 f2 73 65 74  |d..clear..n..set|
00000140  75 70 63 6f 6e 76 65 72  74 0d 00 78 05 3a 0d 00  |upconvert..x.:..|
00000150  82 33 c8 99 20 22 57 69  6d 70 5f 49 6e 69 74 69  |.3.. "Wimp_Initi|
00000160  61 6c 69 73 65 22 2c 32  30 30 2c 26 34 42 35 33  |alise",200,&4B53|
00000170  34 31 35 34 2c 22 4d 49  44 49 20 4d 61 6b 65 72  |4154,"MIDI Maker|
00000180  22 0d 00 8c 0c f2 69 63  6f 6e 28 a3 29 0d 00 96  |".....icon(.)...|
00000190  0a f2 6d 65 6e 75 73 0d  00 a0 06 20 f5 0d 00 aa  |..menus.... ....|
000001a0  1e 20 20 c8 99 20 22 57  69 6d 70 5f 50 6f 6c 6c  |.  .. "Wimp_Poll|
000001b0  22 2c 30 2c 71 25 20 b8  20 61 25 0d 00 b4 0d 20  |",0,q% . a%.... |
000001c0  20 c8 8e 20 61 25 20 ca  0d 00 be 0a 20 20 20 c9  | .. a% .....   .|
000001d0  20 36 0d 00 c8 12 20 20  20 20 c8 8e 20 71 25 21  | 6....    .. q%!|
000001e0  31 32 20 ca 0d 00 d2 0d  20 20 20 20 20 c9 20 2d  |12 .....     . -|
000001f0  32 0d 00 dc 2d 20 20 20  20 20 20 e7 20 71 25 21  |2...-      . q%!|
00000200  31 36 3d 69 63 6f 6e 25  20 80 20 71 25 21 38 3d  |16=icon% . q%!8=|
00000210  32 20 8c 20 f2 6f 70 65  6e 5f 6d 65 6e 75 0d 00  |2 . .open_menu..|
00000220  e6 10 20 20 20 20 20 c9  20 73 61 76 65 25 0d 00  |..     . save%..|
00000230  f0 14 20 20 20 20 20 20  c8 8e 20 71 25 21 31 36  |..      .. q%!16|
00000240  20 ca 0d 00 fa 0e 20 20  20 20 20 20 20 c9 20 31  | .....       . 1|
00000250  0d 01 04 1a 20 20 20 20  20 20 20 20 20 e7 20 28  |....         . (|
00000260  71 25 21 38 29 3e 31 36  20 8c 0d 01 0e 19 20 20  |q%!8)>16 .....  |
00000270  20 20 20 20 20 20 20 20  20 21 71 32 25 3d 73 61  |         !q2%=sa|
00000280  76 65 25 0d 01 18 16 20  20 20 20 20 20 20 20 20  |ve%....         |
00000290  20 20 71 32 25 21 34 3d  31 0d 01 22 2a 20 20 20  |  q2%!4=1.."*   |
000002a0  20 20 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |        .. "Wimp|
000002b0  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_GetIconState",,|
000002c0  71 32 25 0d 01 2c 1b 20  20 20 20 20 20 20 20 20  |q2%..,.         |
000002d0  20 20 71 32 25 21 36 34  3d 73 61 76 65 25 0d 01  |  q2%!64=save%..|
000002e0  36 31 20 20 20 20 20 20  20 20 20 20 20 c8 99 20  |61           .. |
000002f0  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
00000300  74 61 74 65 22 2c 2c 28  71 32 25 2b 36 34 29 0d  |tate",,(q2%+64).|
00000310  01 40 18 20 20 20 20 20  20 20 20 20 20 20 21 72  |.@.           !r|
00000320  25 3d 73 61 76 65 25 0d  01 4a 15 20 20 20 20 20  |%=save%..J.     |
00000330  20 20 20 20 20 20 72 25  21 34 3d 35 0d 01 54 24  |      r%!4=5..T$|
00000340  20 20 20 20 20 20 20 20  20 20 20 72 25 21 38 3d  |           r%!8=|
00000350  28 71 32 25 21 36 38 29  2b 28 71 32 25 21 38 29  |(q2%!68)+(q2%!8)|
00000360  0d 01 5e 26 20 20 20 20  20 20 20 20 20 20 20 72  |..^&           r|
00000370  25 21 31 32 3d 28 71 32  25 21 37 32 29 2b 28 71  |%!12=(q2%!72)+(q|
00000380  32 25 21 31 32 29 0d 01  68 26 20 20 20 20 20 20  |2%!12)..h&      |
00000390  20 20 20 20 20 72 25 21  31 36 3d 28 71 32 25 21  |     r%!16=(q2%!|
000003a0  36 38 29 2b 28 71 32 25  21 31 36 29 0d 01 72 26  |68)+(q2%!16)..r&|
000003b0  20 20 20 20 20 20 20 20  20 20 20 72 25 21 32 30  |           r%!20|
000003c0  3d 28 71 32 25 21 37 32  29 2b 28 71 32 25 21 32  |=(q2%!72)+(q2%!2|
000003d0  30 29 0d 01 7c 1e 20 20  20 20 20 20 20 20 20 20  |0)..|.          |
000003e0  20 72 25 21 32 34 3d 26  38 30 30 30 30 30 30 30  | r%!24=&80000000|
000003f0  0d 01 86 1e 20 20 20 20  20 20 20 20 20 20 20 72  |....           r|
00000400  25 21 32 38 3d 26 38 30  30 30 30 30 30 30 0d 01  |%!28=&80000000..|
00000410  90 1e 20 20 20 20 20 20  20 20 20 20 20 72 25 21  |..           r%!|
00000420  33 32 3d 26 37 46 46 46  46 46 46 46 0d 01 9a 1e  |32=&7FFFFFFF....|
00000430  20 20 20 20 20 20 20 20  20 20 20 72 25 21 33 36  |           r%!36|
00000440  3d 26 37 46 46 46 46 46  46 46 0d 01 a4 24 20 20  |=&7FFFFFFF...$  |
00000450  20 20 20 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |         .. "Wim|
00000460  70 5f 44 72 61 67 42 6f  78 22 2c 2c 72 25 0d 01  |p_DragBox",,r%..|
00000470  ae 0e 20 20 20 20 20 20  20 20 20 cd 0d 01 b8 0e  |..         .....|
00000480  20 20 20 20 20 20 20 c9  20 32 0d 01 c2 26 20 20  |       . 2...&  |
00000490  20 20 20 20 20 20 20 f2  73 61 76 65 28 a4 67 65  |       .save(.ge|
000004a0  74 5f 73 74 72 28 73 61  76 65 74 78 74 25 29 29  |t_str(savetxt%))|
000004b0  0d 01 cc 25 20 20 20 20  20 20 20 20 20 c8 99 20  |...%         .. |
000004c0  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
000004d0  22 2c 2c 2d 31 0d 01 d6  0b 20 20 20 20 20 20 cb  |",,-1....      .|
000004e0  0d 01 e0 09 20 20 20 20  cb 0d 01 ea 0a 20 20 20  |....    .....   |
000004f0  c9 20 37 0d 01 f4 25 20  20 20 20 c8 99 20 22 57  |. 7...%    .. "W|
00000500  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00000510  66 6f 22 2c 2c 71 32 25  0d 01 fe 0e 20 20 20 20  |fo",,q2%....    |
00000520  21 72 25 3d 33 36 0d 02  08 0f 20 20 20 20 72 25  |!r%=36....    r%|
00000530  21 31 36 3d 31 0d 02 12  14 20 20 20 20 72 25 21  |!16=1....    r%!|
00000540  32 30 3d 71 32 25 21 31  32 0d 02 1c 14 20 20 20  |20=q2%!12....   |
00000550  20 72 25 21 32 34 3d 71  32 25 21 31 36 0d 02 26  | r%!24=q2%!16..&|
00000560  12 20 20 20 20 72 25 21  32 38 3d 21 71 32 25 0d  |.    r%!28=!q2%.|
00000570  02 30 13 20 20 20 20 72  25 21 33 32 3d 71 32 25  |.0.    r%!32=q2%|
00000580  21 34 0d 02 3a 0f 20 20  20 20 72 25 21 31 32 3d  |!4..:.    r%!12=|
00000590  30 0d 02 44 1c 20 20 20  20 72 25 21 33 36 3d 6d  |0..D.    r%!36=m|
000005a0  69 64 69 74 6f 70 25 2d  73 70 61 63 65 0d 02 4e  |iditop%-space..N|
000005b0  25 20 20 20 20 20 73 61  76 65 66 69 6c 65 24 3d  |%     savefile$=|
000005c0  a4 67 65 74 5f 73 74 72  28 73 61 76 65 74 78 74  |.get_str(savetxt|
000005d0  25 29 0d 02 58 0d 20 20  20 20 20 70 25 3d 30 0d  |%)..X.     p%=0.|
000005e0  02 62 20 20 20 20 20 20  c8 95 20 a7 73 61 76 65  |.b      .. .save|
000005f0  66 69 6c 65 24 2c 22 2e  22 2c 70 25 29 3e 30 0d  |file$,".",p%)>0.|
00000600  02 6c 22 20 20 20 20 20  20 20 70 25 3d a7 73 61  |.l"       p%=.sa|
00000610  76 65 66 69 6c 65 24 2c  22 2e 22 2c 70 25 29 2b  |vefile$,".",p%)+|
00000620  31 0d 02 76 0a 20 20 20  20 20 ce 0d 02 80 21 20  |1..v.     ....! |
00000630  20 20 20 20 73 61 76 65  66 69 6c 65 24 3d c1 73  |    savefile$=.s|
00000640  61 76 65 66 69 6c 65 24  2c 70 25 29 0d 02 8a 13  |avefile$,p%)....|
00000650  20 20 20 20 20 72 25 21  34 30 3d 26 46 44 34 0d  |     r%!40=&FD4.|
00000660  02 94 1e 20 20 20 20 20  24 28 72 25 2b 34 34 29  |...     $(r%+44)|
00000670  3d 73 61 76 65 66 69 6c  65 24 2b bd 30 0d 02 9e  |=savefile$+.0...|
00000680  2c 20 20 20 20 20 21 72  25 3d 28 28 28 28 34 35  |,     !r%=((((45|
00000690  2b a9 28 73 61 76 65 66  69 6c 65 24 29 29 20 81  |+.(savefile$)) .|
000006a0  20 34 29 2b 31 29 2a 34  29 0d 02 a8 31 20 20 20  | 4)+1)*4)...1   |
000006b0  20 c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  | .. "Wimp_SendMe|
000006c0  73 73 61 67 65 22 2c 31  38 2c 72 25 2c 71 32 25  |ssage",18,r%,q2%|
000006d0  21 31 32 2c 71 32 25 21  31 36 0d 02 b2 20 20 20  |!12,q2%!16...   |
000006e0  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
000006f0  65 4d 65 6e 75 22 2c 2c  2d 31 0d 02 bc 0a 20 20  |eMenu",,-1....  |
00000700  20 c9 20 38 0d 02 c6 2f  20 20 20 20 e7 20 28 21  | . 8.../    . (!|
00000710  71 25 3d 73 61 76 65 25  29 20 80 20 28 71 25 21  |q%=save%) . (q%!|
00000720  34 3d 30 29 20 80 20 28  71 25 21 32 34 3d 31 33  |4=0) . (q%!24=13|
00000730  29 20 8c 0d 02 d0 22 20  20 20 20 20 f2 73 61 76  |) ...."     .sav|
00000740  65 28 a4 67 65 74 5f 73  74 72 28 73 61 76 65 74  |e(.get_str(savet|
00000750  78 74 25 29 29 0d 02 da  20 20 20 20 20 20 c8 99  |xt%))...      ..|
00000760  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
00000770  75 22 2c 2d 31 0d 02 e4  0f 20 20 20 20 20 f2 6d  |u",-1....     .m|
00000780  65 6e 75 73 0d 02 ee 09  20 20 20 20 cc 0d 02 f8  |enus....    ....|
00000790  23 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 50  |#     .. "Wimp_P|
000007a0  72 6f 63 65 73 73 4b 65  79 22 2c 71 25 21 32 34  |rocessKey",q%!24|
000007b0  0d 03 02 09 20 20 20 20  cd 0d 03 0c 0a 20 20 20  |....    .....   |
000007c0  c9 20 39 0d 03 16 13 20  20 20 20 f2 68 61 6e 64  |. 9....    .hand|
000007d0  6c 65 6d 65 6e 75 0d 03  20 0e 20 20 20 c9 20 31  |lemenu.. .   . 1|
000007e0  37 2c 31 38 0d 03 2a 12  20 20 20 20 c8 8e 20 71  |7,18..*.    .. q|
000007f0  25 21 31 36 20 ca 0d 03  34 0c 20 20 20 20 20 c9  |%!16 ...4.     .|
00000800  20 30 0d 03 3e 0b 20 20  20 20 20 20 e0 0d 03 48  | 0..>.      ...H|
00000810  0c 20 20 20 20 20 c9 20  32 0d 03 52 42 20 20 20  |.     . 2..RB   |
00000820  20 20 20 24 28 73 61 76  65 74 78 74 25 29 3d a4  |   $(savetxt%)=.|
00000830  67 65 74 5f 73 74 72 28  71 25 2b 34 34 29 3a 21  |get_str(q%+44):!|
00000840  73 61 76 65 6c 65 6e 25  3d a9 28 a4 67 65 74 5f  |savelen%=.(.get_|
00000850  73 74 72 28 71 25 2b 34  34 29 29 0d 03 5c 20 20  |str(q%+44))..\  |
00000860  20 20 20 20 20 f2 73 61  76 65 28 a4 67 65 74 5f  |     .save(.get_|
00000870  73 74 72 28 71 25 2b 34  34 29 29 0d 03 66 14 20  |str(q%+44))..f. |
00000880  20 20 20 20 20 71 25 21  31 32 3d 71 25 21 38 0d  |     q%!12=q%!8.|
00000890  03 70 11 20 20 20 20 20  20 71 25 21 31 36 3d 33  |.p.      q%!16=3|
000008a0  0d 03 7a 2a 20 20 20 20  20 20 c8 99 20 22 57 69  |..z*      .. "Wi|
000008b0  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
000008c0  31 38 2c 71 25 2c 71 25  21 34 0d 03 84 11 20 20  |18,q%,q%!4....  |
000008d0  20 20 20 20 71 25 21 31  36 3d 32 0d 03 8e 0c 20  |    q%!16=2.... |
000008e0  20 20 20 20 c9 20 33 0d  03 98 24 20 20 20 20 20  |    . 3...$     |
000008f0  20 e7 20 71 25 21 32 30  3d 2d 32 20 80 20 71 25  | . q%!20=-2 . q%|
00000900  21 32 34 3d 69 63 6f 6e  25 20 8c 0d 03 a2 13 20  |!24=icon% ..... |
00000910  20 20 20 20 20 20 f2 63  6f 6e 76 65 72 74 0d 03  |      .convert..|
00000920  ac 22 20 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |."       .. "Wim|
00000930  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2d 31  |p_CreateMenu",-1|
00000940  0d 03 b6 12 20 20 20 20  20 20 20 71 25 21 31 36  |....       q%!16|
00000950  3d 33 0d 03 c0 0b 20 20  20 20 20 20 cd 0d 03 ca  |=3....      ....|
00000960  09 20 20 20 20 cb 0d 03  d4 0b 20 20 20 c9 20 31  |.    .....   . 1|
00000970  39 0d 03 de 12 20 20 20  20 c8 8e 20 71 25 21 31  |9....    .. q%!1|
00000980  36 20 ca 0d 03 e8 0c 20  20 20 20 20 c9 20 31 0d  |6 .....     . 1.|
00000990  03 f2 37 20 20 20 20 20  20 f2 65 72 72 6f 72 28  |..7      .error(|
000009a0  22 44 72 61 67 20 49 63  6f 6e 20 74 6f 20 61 20  |"Drag Icon to a |
000009b0  46 69 6c 65 72 20 57 69  6e 64 6f 77 20 74 6f 20  |Filer Window to |
000009c0  53 61 76 65 22 29 0d 03  fc 0c 20 20 20 20 20 c9  |Save")....     .|
000009d0  20 33 0d 04 06 3c 20 20  20 20 20 20 f2 65 72 72  | 3...<      .err|
000009e0  6f 72 28 22 57 61 72 6e  69 6e 67 20 2d 20 44 61  |or("Warning - Da|
000009f0  74 61 20 4d 61 79 20 62  65 20 53 61 76 65 64 20  |ta May be Saved |
00000a00  49 6e 63 6f 72 72 65 63  74 6c 79 21 22 29 0d 04  |Incorrectly!")..|
00000a10  10 09 20 20 20 20 cb 0d  04 1a 07 20 20 cb 0d 04  |..    .....  ...|
00000a20  24 08 20 fd 20 a3 0d 04  2e 05 3a 0d 04 38 0b dd  |$. . .....:..8..|
00000a30  f2 63 6c 65 61 72 0d 04  42 28 66 69 6c 65 24 3d  |.clear..B(file$=|
00000a40  22 22 3a 70 61 67 65 73  3d 30 3a 6d 69 64 69 74  |"":pages=0:midit|
00000a50  6f 70 25 3d 73 70 61 63  65 2b 26 31 30 34 0d 04  |op%=space+&104..|
00000a60  4c 22 6c 65 6e 57 3d 73  70 61 63 65 2b 26 45 31  |L"lenW=space+&E1|
00000a70  3a 73 74 61 72 74 3d 73  70 61 63 65 2b 26 45 35  |:start=space+&E5|
00000a80  0d 04 56 05 e1 0d 04 60  05 3a 0d 04 6a 11 dd f2  |..V....`.:..j...|
00000a90  73 61 76 65 28 66 69 6c  65 24 29 0d 04 74 14 ea  |save(file$)..t..|
00000aa0  20 66 25 2c 6d 69 64 69  74 6f 70 6f 6c 64 25 0d  | f%,miditopold%.|
00000ab0  04 7e 07 ea 20 85 0d 04  88 1c ee 20 85 20 ea 20  |.~.. ...... . . |
00000ac0  f7 20 85 3a f2 66 61 75  6c 74 28 9f 2c f6 24 29  |. .:.fault(.,.$)|
00000ad0  3a e1 0d 04 92 18 6d 69  64 69 74 6f 70 6f 6c 64  |:.....miditopold|
00000ae0  25 3d 6d 69 64 69 74 6f  70 25 0d 04 9c 25 74 69  |%=miditop%...%ti|
00000af0  6d 65 72 25 3d 26 31 37  3a f2 73 65 6e 64 6d 69  |mer%=&17:.sendmi|
00000b00  64 69 28 33 2c 26 46 46  2c 26 32 46 2c 30 29 0d  |di(3,&FF,&2F,0).|
00000b10  04 a6 53 6c 65 6e 67 74  68 3d 6d 69 64 69 74 6f  |..Slength=midito|
00000b20  70 25 2d 73 74 61 72 74  3a 50 25 3d 6c 65 6e 57  |p%-start:P%=lenW|
00000b30  3a 5b 4f 50 54 30 3a 45  51 55 57 30 3a 45 51 55  |:[OPT0:EQUW0:EQU|
00000b40  42 28 6c 65 6e 67 74 68  20 81 32 35 36 29 3a 45  |B(length .256):E|
00000b50  51 55 42 28 6c 65 6e 67  74 68 20 80 32 35 35 29  |QUB(length .255)|
00000b60  3a 5d 0d 04 b0 2d ff 22  53 41 56 45 20 22 2b 66  |:]...-."SAVE "+f|
00000b70  69 6c 65 24 2b 22 20 22  2b c3 7e 73 70 61 63 65  |ile$+" "+.~space|
00000b80  2b 22 20 22 2b c3 7e 6d  69 64 69 74 6f 70 25 0d  |+" "+.~miditop%.|
00000b90  04 ba 1c ff 22 53 45 54  54 59 50 45 20 22 2b 66  |...."SETTYPE "+f|
00000ba0  69 6c 65 24 2b 22 20 46  44 34 22 0d 04 c4 18 6d  |ile$+" FD4"....m|
00000bb0  69 64 69 74 6f 70 25 3d  6d 69 64 69 74 6f 70 6f  |iditop%=miditopo|
00000bc0  6c 64 25 0d 04 ce 07 f7  20 85 0d 04 d8 05 e1 0d  |ld%..... .......|
00000bd0  04 e2 05 3a 0d 04 ec 0f  dd f2 65 72 72 6f 72 28  |...:......error(|
00000be0  65 24 29 0d 04 f6 09 21  65 25 3d 30 0d 05 00 11  |e$)....!e%=0....|
00000bf0  24 28 65 25 2b 34 29 3d  65 24 2b bd 30 0d 05 0a  |$(e%+4)=e$+.0...|
00000c00  2b c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  |+.. "Wimp_Report|
00000c10  45 72 72 6f 72 22 2c 65  25 2c 30 2c 22 4d 49 44  |Error",e%,0,"MID|
00000c20  49 20 4d 61 6b 65 72 22  0d 05 14 05 e1 0d 05 1e  |I Maker"........|
00000c30  05 3a 0d 05 28 11 dd a4  63 6f 6e 66 69 72 6d 28  |.:..(...confirm(|
00000c40  6d 24 29 0d 05 32 08 ea  20 72 25 0d 05 3c 09 21  |m$)..2.. r%..<.!|
00000c50  65 25 3d 30 0d 05 46 11  24 28 65 25 2b 34 29 3d  |e%=0..F.$(e%+4)=|
00000c60  6d 24 2b bd 30 0d 05 50  33 c8 99 20 22 57 69 6d  |m$+.0..P3.. "Wim|
00000c70  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 65  |p_ReportError",e|
00000c80  25 2c 26 31 33 2c 22 4d  49 44 49 20 4d 61 6b 65  |%,&13,"MIDI Make|
00000c90  72 22 20 b8 20 2c 72 25  0d 05 5a 07 3d 72 25 0d  |r" . ,r%..Z.=r%.|
00000ca0  05 64 05 3a 0d 05 6e 16  dd f2 66 61 75 6c 74 28  |.d.:..n...fault(|
00000cb0  65 72 72 25 2c 65 72 72  24 29 0d 05 78 0c 21 65  |err%,err$)..x.!e|
00000cc0  25 3d 65 72 72 25 0d 05  82 13 24 28 65 25 2b 34  |%=err%....$(e%+4|
00000cd0  29 3d 65 72 72 24 2b bd  30 0d 05 8c 29 e7 65 72  |)=err$+.0...).er|
00000ce0  72 25 3d 32 32 30 20 8c  20 24 28 65 25 2b 34 29  |r%=220 . $(e%+4)|
00000cf0  3d 22 42 61 64 20 66 69  6c 65 6e 61 6d 65 22 2b  |="Bad filename"+|
00000d00  bd 30 0d 05 96 2b c8 99  20 22 57 69 6d 70 5f 52  |.0...+.. "Wimp_R|
00000d10  65 70 6f 72 74 45 72 72  6f 72 22 2c 65 25 2c 30  |eportError",e%,0|
00000d20  2c 22 4d 49 44 49 20 4d  61 6b 65 72 22 0d 05 a0  |,"MIDI Maker"...|
00000d30  05 e1 0d 05 aa 05 3a 0d  05 b4 0d dd f2 63 6f 6e  |......:......con|
00000d40  76 65 72 74 0d 05 be 19  66 69 6c 65 24 3d a4 67  |vert....file$=.g|
00000d50  65 74 5f 73 74 72 28 71  25 2b 34 34 29 0d 05 c8  |et_str(q%+44)...|
00000d60  0f 74 79 70 65 25 3d 71  25 21 34 30 0d 05 d2 13  |.type%=q%!40....|
00000d70  e7 20 74 79 70 65 25 3c  3e 26 41 46 31 20 8c 0d  |. type%<>&AF1 ..|
00000d80  05 dc 59 20 21 74 78 74  25 3d 30 3a 24 28 74 78  |..Y !txt%=0:$(tx|
00000d90  74 25 2b 34 29 3d 22 50  6c 65 61 73 65 20 63 6f  |t%+4)="Please co|
00000da0  6e 76 65 72 74 20 74 6f  20 61 20 4d 61 65 73 74  |nvert to a Maest|
00000db0  72 6f 20 66 69 6c 65 20  62 65 66 6f 72 65 20 61  |ro file before a|
00000dc0  74 74 65 6d 70 74 69 6e  67 20 63 6f 6e 76 65 72  |ttempting conver|
00000dd0  73 69 6f 6e 22 2b bd 30  0d 05 e6 2e 20 c8 99 20  |sion"+.0.... .. |
00000de0  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
00000df0  72 22 2c 74 78 74 25 2c  30 2c 22 4d 49 44 49 20  |r",txt%,0,"MIDI |
00000e00  4d 61 6b 65 72 22 0d 05  f0 05 cc 0d 05 fa 11 20  |Maker"......... |
00000e10  f2 64 6f 69 74 28 66 69  6c 65 24 29 0d 06 04 12  |.doit(file$)....|
00000e20  20 70 61 67 65 73 3d 70  61 67 65 73 2b 31 0d 06  | pages=pages+1..|
00000e30  0e 14 20 f2 69 63 6f 6e  28 b9 29 3a f2 6d 65 6e  |.. .icon(.):.men|
00000e40  75 73 0d 06 18 05 cd 0d  06 22 05 e1 0d 06 2c 05  |us......."....,.|
00000e50  3a 0d 06 36 11 dd a4 67  65 74 5f 73 74 72 28 71  |:..6...get_str(q|
00000e60  25 29 0d 06 40 0c ea 20  66 6e 24 2c 70 25 0d 06  |%)..@.. fn$,p%..|
00000e70  4a 0f 70 25 3d 30 3a 66  6e 24 3d 22 22 0d 06 54  |J.p%=0:fn$=""..T|
00000e80  05 f5 0d 06 5e 15 20 66  6e 24 3d 66 6e 24 2b bd  |....^. fn$=fn$+.|
00000e90  28 71 25 3f 70 25 29 0d  06 68 0c 20 70 25 3d 70  |(q%?p%)..h. p%=p|
00000ea0  25 2b 31 0d 06 72 10 fd  20 28 71 25 3f 70 25 29  |%+1..r.. (q%?p%)|
00000eb0  3c 33 32 0d 06 7c 08 3d  66 6e 24 0d 06 86 05 3a  |<32..|.=fn$....:|
00000ec0  0d 06 90 0b dd f2 6d 65  6e 75 73 0d 06 9a 0d 20  |......menus.... |
00000ed0  f2 69 6e 66 6f 62 6f 78  0d 06 a4 0d 20 f2 73 61  |.infobox.... .sa|
00000ee0  76 65 62 6f 78 0d 06 ae  0e 20 f2 6d 61 69 6e 6d  |vebox.... .mainm|
00000ef0  65 6e 75 0d 06 b8 05 e1  0d 06 c2 05 3a 0d 06 cc  |enu.........:...|
00000f00  0d dd f2 73 61 76 65 62  6f 78 0d 06 d6 0f 20 6d  |...savebox.... m|
00000f10  25 3d 6d 65 6e 75 73 70  25 0d 06 e0 14 20 6d 25  |%=menusp%.... m%|
00000f20  21 32 38 3d 26 38 34 30  30 30 30 31 32 0d 06 ea  |!28=&84000012...|
00000f30  14 20 6d 25 21 33 32 3d  26 30 31 30 37 30 32 30  |. m%!32=&0107020|
00000f40  37 0d 06 f4 14 20 6d 25  21 33 36 3d 26 30 30 30  |7.... m%!36=&000|
00000f50  43 30 31 30 33 0d 06 fe  14 20 6d 25 21 34 30 3d  |C0103.... m%!40=|
00000f60  30 3a 6d 25 21 34 34 3d  30 0d 07 08 18 20 6d 25  |0:m%!44=0.... m%|
00000f70  21 34 38 3d 32 35 30 3a  6d 25 21 35 32 3d 31 36  |!48=250:m%!52=16|
00000f80  30 0d 07 12 14 20 6d 25  21 35 36 3d 26 30 30 30  |0.... m%!56=&000|
00000f90  30 30 30 31 39 0d 07 1c  14 20 6d 25 21 36 30 3d  |00019.... m%!60=|
00000fa0  26 30 30 30 30 30 30 30  30 0d 07 26 20 20 6d 25  |&00000000..&  m%|
00000fb0  21 36 34 3d 31 3a 6d 25  21 36 38 3d 32 35 30 3a  |!64=1:m%!68=250:|
00000fc0  6d 25 21 37 30 3d 31 36  30 0d 07 30 1b 20 24 28  |m%!70=160..0. $(|
00000fd0  6d 25 2b 37 32 29 3d 22  53 61 76 65 20 61 73 3a  |m%+72)="Save as:|
00000fe0  22 2b bd 30 0d 07 3a 0c  20 6d 25 21 38 34 3d 33  |"+.0..:. m%!84=3|
00000ff0  0d 07 44 16 20 6d 25 21  38 38 3d 31 35 3a 6d 25  |..D. m%!88=15:m%|
00001000  21 39 32 3d 31 30 0d 07  4e 18 20 6d 25 21 39 36  |!92=10..N. m%!96|
00001010  3d 31 38 35 3a 6d 25 21  31 30 30 3d 35 35 0d 07  |=185:m%!100=55..|
00001020  58 15 20 6d 25 21 31 30  34 3d 26 30 37 30 30 46  |X. m%!104=&0700F|
00001030  31 33 44 0d 07 62 12 20  6d 25 21 31 30 38 3d 6d  |13D..b. m%!108=m|
00001040  25 2b 32 35 30 0d 07 6c  12 20 6d 25 21 31 31 32  |%+250..l. m%!112|
00001050  3d 6d 25 2b 31 39 32 0d  07 76 0f 20 6d 25 21 31  |=m%+192..v. m%!1|
00001060  31 36 3d 31 30 30 0d 07  80 18 20 6d 25 21 31 32  |16=100.... m%!12|
00001070  30 3d 38 30 3a 6d 25 21  31 32 34 3d 38 30 0d 07  |0=80:m%!124=80..|
00001080  8a 1a 20 6d 25 21 31 32  38 3d 31 34 35 3a 6d 25  |.. m%!128=145:m%|
00001090  21 31 33 32 3d 31 34 35  0d 07 94 15 20 6d 25 21  |!132=145.... m%!|
000010a0  31 33 36 3d 26 30 37 30  30 36 31 31 41 0d 07 9e  |136=&0700611A...|
000010b0  12 20 6d 25 21 31 34 30  3d 6d 25 2b 32 30 30 0d  |. m%!140=m%+200.|
000010c0  07 a8 0d 20 6d 25 21 31  34 34 3d 31 0d 07 b2 0d  |... m%!144=1....|
000010d0  20 6d 25 21 31 34 38 3d  31 0d 07 bc 19 20 6d 25  | m%!148=1.... m%|
000010e0  21 31 35 32 3d 31 39 35  3a 6d 25 21 31 35 36 3d  |!152=195:m%!156=|
000010f0  31 30 0d 07 c6 19 20 6d  25 21 31 36 30 3d 32 34  |10.... m%!160=24|
00001100  30 3a 6d 25 21 31 36 34  3d 35 35 0d 07 d0 15 20  |0:m%!164=55.... |
00001110  6d 25 21 31 36 38 3d 26  43 37 30 31 39 30 33 44  |m%!168=&C701903D|
00001120  0d 07 da 16 20 24 28 6d  25 2b 31 37 32 29 3d 22  |.... $(m%+172)="|
00001130  4f 4b 22 2b bd 30 0d 07  e4 19 20 24 28 6d 25 2b  |OK"+.0.... $(m%+|
00001140  32 30 30 29 3d 22 66 69  6c 65 5f 66 64 34 22 0d  |200)="file_fd4".|
00001150  07 ee 24 20 24 28 6d 25  2b 32 35 30 29 3d 66 69  |..$ $(m%+250)=fi|
00001160  6c 65 24 3a 73 61 76 65  74 78 74 25 3d 6d 25 2b  |le$:savetxt%=m%+|
00001170  32 35 30 0d 07 f8 20 20  21 28 6d 25 2b 31 34 38  |250...  !(m%+148|
00001180  29 3d 38 3a 73 61 76 65  6c 65 6e 25 3d 6d 25 2b  |)=8:savelen%=m%+|
00001190  31 34 38 0d 08 02 0d 20  6d 25 21 31 39 32 3d 30  |148.... m%!192=0|
000011a0  0d 08 0c 27 20 c8 99 20  22 57 69 6d 70 5f 43 72  |...' .. "Wimp_Cr|
000011b0  65 61 74 65 57 69 6e 64  6f 77 22 2c 2c 6d 25 20  |eateWindow",,m% |
000011c0  b8 20 73 61 76 65 25 0d  08 16 05 e1 0d 08 20 05  |. save%....... .|
000011d0  3a 0d 08 2a 0e dd f2 6d  61 69 6e 6d 65 6e 75 0d  |:..*...mainmenu.|
000011e0  08 34 20 20 70 25 3d 6d  65 6e 75 73 70 25 2b 35  |.4  p%=menusp%+5|
000011f0  31 32 3a 6d 61 69 6e 6d  65 6e 75 25 3d 70 25 0d  |12:mainmenu%=p%.|
00001200  08 3e 2f 20 24 70 25 3d  22 4d 49 44 49 20 4d 61  |.>/ $p%="MIDI Ma|
00001210  6b 65 72 22 2b bd 30 3a  70 25 21 31 32 3d 26 37  |ker"+.0:p%!12=&7|
00001220  30 32 30 37 3a 70 25 21  31 36 3d 32 30 30 0d 08  |0207:p%!16=200..|
00001230  48 1e 20 70 25 21 32 30  3d 34 30 3a 70 25 21 32  |H. p%!20=40:p%!2|
00001240  34 3d 30 3a 66 25 3d 70  25 2b 32 38 0d 08 52 3e  |4=0:f%=p%+28..R>|
00001250  20 21 66 25 3d 30 3a 66  25 21 34 3d 69 6e 66 6f  | !f%=0:f%!4=info|
00001260  25 3a 66 25 21 38 3d 26  30 37 30 30 30 30 31 31  |%:f%!8=&07000011|
00001270  3a 24 28 66 25 2b 31 32  29 3d 22 49 6e 66 6f 22  |:$(f%+12)="Info"|
00001280  2b bd 30 3a 66 25 2b 3d  32 34 0d 08 5c 31 20 e7  |+.0:f%+=24..\1 .|
00001290  70 61 67 65 73 3d 30 8c  66 25 21 38 3d 32 5e 32  |pages=0.f%!8=2^2|
000012a0  32 2b 26 30 37 30 30 30  30 31 31 20 8b 66 25 21  |2+&07000011 .f%!|
000012b0  38 3d 26 30 37 30 30 30  30 31 31 0d 08 66 34 20  |8=&07000011..f4 |
000012c0  21 66 25 3d 30 3a 66 25  21 34 3d 73 61 76 65 25  |!f%=0:f%!4=save%|
000012d0  3a 24 28 66 25 2b 31 32  29 3d 22 4d 61 6b 65 20  |:$(f%+12)="Make |
000012e0  4d 49 44 49 22 2b bd 30  3a 66 25 2b 3d 32 34 0d  |MIDI"+.0:f%+=24.|
000012f0  08 70 31 20 e7 70 61 67  65 73 3d 30 8c 66 25 21  |.p1 .pages=0.f%!|
00001300  38 3d 32 5e 32 32 2b 26  30 37 30 30 30 30 31 31  |8=2^22+&07000011|
00001310  20 8b 66 25 21 38 3d 26  30 37 30 30 33 30 31 31  | .f%!8=&07003011|
00001320  0d 08 7a 2d 20 21 66 25  3d 30 3a 66 25 21 34 3d  |..z- !f%=0:f%!4=|
00001330  2d 31 3a 24 28 66 25 2b  31 32 29 3d 22 43 6c 65  |-1:$(f%+12)="Cle|
00001340  61 72 22 2b bd 30 3a 66  25 2b 3d 32 34 0d 08 84  |ar"+.0:f%+=24...|
00001350  3d 20 21 66 25 3d 26 38  30 3a 66 25 21 34 3d 2d  |= !f%=&80:f%!4=-|
00001360  31 3a 66 25 21 38 3d 26  30 37 30 30 33 30 31 31  |1:f%!8=&07003011|
00001370  3a 24 28 66 25 2b 31 32  29 3d 22 51 75 69 74 22  |:$(f%+12)="Quit"|
00001380  2b bd 30 3a 66 25 2b 3d  32 34 0d 08 8e 05 e1 0d  |+.0:f%+=24......|
00001390  08 98 05 3a 0d 08 a2 10  dd f2 68 61 6e 64 6c 65  |...:......handle|
000013a0  6d 65 6e 75 0d 08 ac 0c  20 ea 20 61 25 2c 6c 25  |menu.... . a%,l%|
000013b0  0d 08 b6 0d 20 c8 8e 20  21 71 25 20 ca 0d 08 c0  |.... .. !q% ....|
000013c0  0a 20 20 20 c9 20 32 0d  08 ca 3c 20 20 20 20 61  |.   . 2...<    a|
000013d0  25 3d a4 63 6f 6e 66 69  72 6d 28 22 57 69 70 65  |%=.confirm("Wipe|
000013e0  20 70 72 6f 63 65 73 73  65 64 20 6d 75 73 69 63  | processed music|
000013f0  2e 2e 2e 20 41 72 65 20  79 6f 75 20 73 75 72 65  |... Are you sure|
00001400  3f 22 29 0d 08 d4 27 20  20 20 20 e7 20 61 25 3d  |?")...'    . a%=|
00001410  31 20 8c 20 f2 63 6c 65  61 72 3a f2 69 63 6f 6e  |1 . .clear:.icon|
00001420  28 b9 29 3a f2 6d 65 6e  75 73 0d 08 de 0a 20 20  |(.):.menus....  |
00001430  20 c9 20 33 0d 08 e8 08  20 20 20 e0 0d 08 f2 06  | . 3....   .....|
00001440  20 cb 0d 08 fc 21 20 c8  99 20 22 57 69 6d 70 5f  | ....! .. "Wimp_|
00001450  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00001460  2c 71 25 0d 09 06 22 20  e7 20 28 28 71 25 21 38  |,q%..." . ((q%!8|
00001470  29 20 80 20 31 29 3d 31  20 8c 20 f2 6f 70 65 6e  |) . 1)=1 . .open|
00001480  5f 6d 65 6e 75 0d 09 10  05 e1 0d 09 1a 05 3a 0d  |_menu.........:.|
00001490  09 24 0d dd f2 69 6e 66  6f 62 6f 78 0d 09 2e 0b  |.$...infobox....|
000014a0  ea 20 73 25 2c 69 25 0d  09 38 0e 73 25 3d 69 6e  |. s%,i%..8.s%=in|
000014b0  66 6f 73 70 25 0d 09 42  13 73 25 21 32 38 3d 26  |fosp%..B.s%!28=&|
000014c0  38 34 30 30 30 30 31 32  0d 09 4c 12 73 25 21 33  |84000012..L.s%!3|
000014d0  32 3d 26 31 30 37 30 32  30 37 0d 09 56 10 73 25  |2=&1070207..V.s%|
000014e0  21 33 36 3d 26 32 30 31  30 33 0d 09 60 14 73 25  |!36=&20103..`.s%|
000014f0  21 34 30 3d 32 30 3a 73  25 21 34 34 3d 30 0d 09  |!40=20:s%!44=0..|
00001500  6a 17 73 25 21 34 38 3d  36 33 36 3a 73 25 21 35  |j.s%!48=636:s%!5|
00001510  32 3d 32 31 36 0d 09 74  13 73 25 21 35 36 3d 26  |2=216..t.s%!56=&|
00001520  30 30 30 30 30 31 31 39  0d 09 7e 13 73 25 21 36  |00000119..~.s%!6|
00001530  30 3d 26 30 30 30 30 30  30 30 30 0d 09 88 0b 73  |0=&00000000....s|
00001540  25 21 36 34 3d 31 0d 09  92 0d 73 25 21 36 38 3d  |%!64=1....s%!68=|
00001550  36 31 36 0d 09 9c 0d 73  25 21 37 30 3d 32 31 36  |616....s%!70=216|
00001560  0d 09 a6 10 73 25 21 37  32 3d 73 25 2b 35 32 38  |....s%!72=s%+528|
00001570  0d 09 b0 10 73 25 21 37  36 3d 73 25 2b 33 39 30  |....s%!76=s%+390|
00001580  0d 09 ba 0c 73 25 21 38  30 3d 33 32 0d 09 c4 0b  |....s%!80=32....|
00001590  73 25 21 38 34 3d 38 0d  09 ce 0c 69 25 3d 73 25  |s%!84=8....i%=s%|
000015a0  2b 38 38 0d 09 d8 11 21  69 25 3d 33 32 3a 69 25  |+88....!i%=32:i%|
000015b0  21 34 3d 38 0d 09 e2 15  69 25 21 38 3d 31 38 34  |!4=8....i%!8=184|
000015c0  3a 69 25 21 31 32 3d 35  36 0d 09 ec 13 69 25 21  |:i%!12=56....i%!|
000015d0  31 36 3d 26 30 37 30 30  30 32 31 31 0d 09 f6 1a  |16=&07000211....|
000015e0  24 28 69 25 2b 32 30 29  3d 22 56 65 72 73 69 6f  |$(i%+20)="Versio|
000015f0  6e 3a 22 2b bd 30 0d 0a  00 0a 69 25 2b 3d 33 32  |n:"+.0....i%+=32|
00001600  0d 0a 0a 12 21 69 25 3d  31 38 38 3a 69 25 21 34  |....!i%=188:i%!4|
00001610  3d 38 0d 0a 14 15 69 25  21 38 3d 36 33 32 3a 69  |=8....i%!8=632:i|
00001620  25 21 31 32 3d 35 36 0d  0a 1e 13 69 25 21 31 36  |%!12=56....i%!16|
00001630  3d 26 30 37 30 30 30 31  33 44 0d 0a 28 10 69 25  |=&0700013D..(.i%|
00001640  21 32 30 3d 73 25 2b 34  30 30 0d 0a 32 10 69 25  |!20=s%+400..2.i%|
00001650  21 32 34 3d 73 25 2b 33  39 30 0d 0a 3c 0c 69 25  |!24=s%+390..<.i%|
00001660  21 32 38 3d 33 30 0d 0a  46 0a 69 25 2b 3d 33 32  |!28=30..F.i%+=32|
00001670  0d 0a 50 12 21 69 25 3d  33 32 3a 69 25 21 34 3d  |..P.!i%=32:i%!4=|
00001680  36 30 0d 0a 5a 16 69 25  21 38 3d 31 38 34 3a 69  |60..Z.i%!8=184:i|
00001690  25 21 31 32 3d 31 30 38  0d 0a 64 13 69 25 21 31  |%!12=108..d.i%!1|
000016a0  36 3d 26 30 37 30 30 30  32 31 31 0d 0a 6e 19 24  |6=&07000211..n.$|
000016b0  28 69 25 2b 32 30 29 3d  22 41 75 74 68 6f 72 3a  |(i%+20)="Author:|
000016c0  22 2b bd 30 0d 0a 78 0a  69 25 2b 3d 33 32 0d 0a  |"+.0..x.i%+=32..|
000016d0  82 13 21 69 25 3d 31 38  38 3a 69 25 21 34 3d 36  |..!i%=188:i%!4=6|
000016e0  30 0d 0a 8c 16 69 25 21  38 3d 36 33 32 3a 69 25  |0....i%!8=632:i%|
000016f0  21 31 32 3d 31 30 38 0d  0a 96 13 69 25 21 31 36  |!12=108....i%!16|
00001700  3d 26 30 37 30 30 30 31  33 44 0d 0a a0 10 69 25  |=&0700013D....i%|
00001710  21 32 30 3d 73 25 2b 34  33 32 0d 0a aa 10 69 25  |!20=s%+432....i%|
00001720  21 32 34 3d 73 25 2b 33  39 30 0d 0a b4 0c 69 25  |!24=s%+390....i%|
00001730  21 32 38 3d 33 30 0d 0a  be 0a 69 25 2b 3d 33 32  |!28=30....i%+=32|
00001740  0d 0a c8 13 21 69 25 3d  33 32 3a 69 25 21 34 3d  |....!i%=32:i%!4=|
00001750  31 31 32 0d 0a d2 16 69  25 21 38 3d 31 38 34 3a  |112....i%!8=184:|
00001760  69 25 21 31 32 3d 31 36  30 0d 0a dc 13 69 25 21  |i%!12=160....i%!|
00001770  31 36 3d 26 30 37 30 30  30 32 31 31 0d 0a e6 1a  |16=&07000211....|
00001780  24 28 69 25 2b 32 30 29  3d 22 50 75 72 70 6f 73  |$(i%+20)="Purpos|
00001790  65 3a 22 2b bd 30 0d 0a  f0 0a 69 25 2b 3d 33 32  |e:"+.0....i%+=32|
000017a0  0d 0a fa 14 21 69 25 3d  31 38 38 3a 69 25 21 34  |....!i%=188:i%!4|
000017b0  3d 31 31 32 0d 0b 04 16  69 25 21 38 3d 36 33 32  |=112....i%!8=632|
000017c0  3a 69 25 21 31 32 3d 31  36 30 0d 0b 0e 13 69 25  |:i%!12=160....i%|
000017d0  21 31 36 3d 26 30 37 30  30 30 31 33 44 0d 0b 18  |!16=&0700013D...|
000017e0  10 69 25 21 32 30 3d 73  25 2b 34 36 34 0d 0b 22  |.i%!20=s%+464.."|
000017f0  10 69 25 21 32 34 3d 73  25 2b 33 39 30 0d 0b 2c  |.i%!24=s%+390..,|
00001800  0c 69 25 21 32 38 3d 33  30 0d 0b 36 0a 69 25 2b  |.i%!28=30..6.i%+|
00001810  3d 33 32 0d 0b 40 13 21  69 25 3d 33 32 3a 69 25  |=32..@.!i%=32:i%|
00001820  21 34 3d 31 36 34 0d 0b  4a 16 69 25 21 38 3d 31  |!4=164..J.i%!8=1|
00001830  38 34 3a 69 25 21 31 32  3d 32 31 32 0d 0b 54 13  |84:i%!12=212..T.|
00001840  69 25 21 31 36 3d 26 30  37 30 30 30 32 31 31 0d  |i%!16=&07000211.|
00001850  0b 5e 17 24 28 69 25 2b  32 30 29 3d 22 4e 61 6d  |.^.$(i%+20)="Nam|
00001860  65 3a 22 2b bd 30 0d 0b  68 0a 69 25 2b 3d 33 32  |e:"+.0..h.i%+=32|
00001870  0d 0b 72 14 21 69 25 3d  31 38 38 3a 69 25 21 34  |..r.!i%=188:i%!4|
00001880  3d 31 36 34 0d 0b 7c 16  69 25 21 38 3d 36 33 32  |=164..|.i%!8=632|
00001890  3a 69 25 21 31 32 3d 32  31 32 0d 0b 86 13 69 25  |:i%!12=212....i%|
000018a0  21 31 36 3d 26 30 37 30  30 30 31 33 44 0d 0b 90  |!16=&0700013D...|
000018b0  10 69 25 21 32 30 3d 73  25 2b 34 39 36 0d 0b 9a  |.i%!20=s%+496...|
000018c0  10 69 25 21 32 34 3d 73  25 2b 33 39 30 0d 0b a4  |.i%!24=s%+390...|
000018d0  0c 69 25 21 32 38 3d 33  30 0d 0b ae 0c 73 25 21  |.i%!28=30....s%!|
000018e0  33 39 30 3d 30 0d 0b b8  22 24 28 73 25 2b 34 30  |390=0..."$(s%+40|
000018f0  30 29 3d 22 31 2e 30 30  20 28 38 2d 41 75 67 2d  |0)="1.00 (8-Aug-|
00001900  39 39 29 22 2b bd 30 0d  0b c2 27 24 28 73 25 2b  |99)"+.0...'$(s%+|
00001910  34 33 32 29 3d 22 a9 20  44 6f 6d 69 6e 69 63 20  |432)=". Dominic |
00001920  46 6f 72 64 2c 20 31 39  39 39 22 2b bd 30 0d 0b  |Ford, 1999"+.0..|
00001930  cc 22 24 28 73 25 2b 34  36 34 29 3d 22 4d 61 65  |."$(s%+464)="Mae|
00001940  73 74 72 6f 20 74 6f 20  4d 49 44 49 22 2b bd 30  |stro to MIDI"+.0|
00001950  0d 0b d6 1d 24 28 73 25  2b 34 39 36 29 3d 22 4d  |....$(s%+496)="M|
00001960  49 44 49 20 4d 61 6b 65  72 22 2b bd 30 0d 0b e0  |IDI Maker"+.0...|
00001970  25 24 28 73 25 2b 35 32  38 29 3d 22 41 62 6f 75  |%$(s%+528)="Abou|
00001980  74 20 74 68 69 73 20 70  72 6f 67 72 61 6d 22 2b  |t this program"+|
00001990  bd 30 0d 0b ea 26 c8 99  20 22 57 69 6d 70 5f 43  |.0...&.. "Wimp_C|
000019a0  72 65 61 74 65 57 69 6e  64 6f 77 22 2c 2c 73 25  |reateWindow",,s%|
000019b0  20 b8 20 69 6e 66 6f 25  0d 0b f4 05 e1 0d 0b fe  | . info%........|
000019c0  05 3a 0d 0c 08 0f dd f2  6f 70 65 6e 5f 6d 65 6e  |.:......open_men|
000019d0  75 0d 0c 12 31 20 c8 99  20 22 57 69 6d 70 5f 43  |u...1 .. "Wimp_C|
000019e0  72 65 61 74 65 4d 65 6e  75 22 2c 2c 6d 61 69 6e  |reateMenu",,main|
000019f0  6d 65 6e 75 25 2c 28 21  71 25 29 2d 36 34 2c 31  |menu%,(!q%)-64,1|
00001a00  36 30 0d 0c 1c 05 e1 0d  0c 26 05 3a 0d 0c 30 12  |60.......&.:..0.|
00001a10  dd f2 69 63 6f 6e 28 72  65 64 72 61 77 29 0d 0c  |..icon(redraw)..|
00001a20  3a 0f 73 70 25 3d 69 63  6f 6e 73 70 25 0d 0c 44  |:.sp%=iconsp%..D|
00001a30  0e e7 20 72 65 64 72 61  77 20 8c 0d 0c 4e 18 20  |.. redraw ...N. |
00001a40  21 73 70 25 3d 2d 31 3a  73 70 25 21 34 3d 69 63  |!sp%=-1:sp%!4=ic|
00001a50  6f 6e 25 0d 0c 58 1e 20  c8 99 20 22 57 69 6d 70  |on%..X. .. "Wimp|
00001a60  5f 44 65 6c 65 74 65 49  63 6f 6e 22 2c 2c 73 70  |_DeleteIcon",,sp|
00001a70  25 0d 0c 62 05 cd 0d 0c  6c 0b 21 73 70 25 3d 2d  |%..b....l.!sp%=-|
00001a80  31 0d 0c 76 0b 73 70 25  21 34 3d 30 0d 0c 80 0d  |1..v.sp%!4=0....|
00001a90  73 70 25 21 38 3d 2d 31  36 0d 0c 8a 18 73 70 25  |sp%!8=-16....sp%|
00001aa0  21 31 32 3d 31 32 38 3a  73 70 25 21 31 36 3d 38  |!12=128:sp%!16=8|
00001ab0  34 0d 0c 94 14 73 70 25  21 32 30 3d 26 31 37 30  |4....sp%!20=&170|
00001ac0  30 33 31 30 42 0d 0c 9e  11 73 70 25 21 32 34 3d  |0310B....sp%!24=|
00001ad0  73 70 25 2b 34 30 0d 0c  a8 11 73 70 25 21 32 38  |sp%+40....sp%!28|
00001ae0  3d 73 70 25 2b 38 30 0d  0c b2 0d 73 70 25 21 33  |=sp%+80....sp%!3|
00001af0  32 3d 33 32 0d 0c bc 23  e7 20 70 61 67 65 73 3d  |2=32...#. pages=|
00001b00  30 20 8c 20 24 28 73 70  25 2b 34 30 29 3d 22 49  |0 . $(sp%+40)="I|
00001b10  64 6c 65 22 2b bd 30 0d  0c c6 25 e7 20 70 61 67  |dle"+.0...%. pag|
00001b20  65 73 3d 31 20 8c 20 24  28 73 70 25 2b 34 30 29  |es=1 . $(sp%+40)|
00001b30  3d 22 31 20 70 61 67 65  22 2b bd 30 0d 0c d0 2c  |="1 page"+.0...,|
00001b40  e7 20 70 61 67 65 73 3e  31 20 8c 20 24 28 73 70  |. pages>1 . $(sp|
00001b50  25 2b 34 30 29 3d c3 70  61 67 65 73 2b 22 20 70  |%+40)=.pages+" p|
00001b60  61 67 65 73 22 2b bd 30  0d 0c da 1d 24 28 73 70  |ages"+.0....$(sp|
00001b70  25 2b 38 30 29 3d 22 53  21 6d 61 6b 65 6d 69 64  |%+80)="S!makemid|
00001b80  69 22 2b bd 30 0d 0c e4  25 c8 99 20 22 57 69 6d  |i"+.0...%.. "Wim|
00001b90  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 73  |p_CreateIcon",,s|
00001ba0  70 25 20 b8 20 69 63 6f  6e 25 0d 0c ee 05 e1 0d  |p% . icon%......|
00001bb0  0c f8 05 3a 0d 0d 02 17  f4 20 43 4f 4e 56 45 52  |...:..... CONVER|
00001bc0  53 49 4f 4e 20 45 4e 47  49 4e 45 0d 0d 0c 05 3a  |SION ENGINE....:|
00001bd0  0d 0d 16 15 dd f2 64 6f  69 74 28 66 69 6c 65 6e  |......doit(filen|
00001be0  61 6d 65 24 29 0d 0d 20  14 c8 99 22 48 6f 75 72  |ame$).. ..."Hour|
00001bf0  67 6c 61 73 73 5f 4f 6e  22 0d 0d 2a 0e f2 6c 6f  |glass_On"..*..lo|
00001c00  61 64 6d 75 73 69 63 0d  0d 34 11 f2 64 6f 63 6f  |admusic..4..doco|
00001c10  6e 76 65 72 73 69 6f 6e  0d 0d 3e 15 c8 99 22 48  |nversion..>..."H|
00001c20  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 0d 48  |ourglass_Off"..H|
00001c30  05 e1 0d 0d 52 05 3a 0d  0d 5c 12 dd f2 73 65 74  |....R.:..\...set|
00001c40  75 70 63 6f 6e 76 65 72  74 0d 0d 66 0d de 20 53  |upconvert..f.. S|
00001c50  20 26 39 30 30 30 0d 0d  70 50 de 20 71 75 65 75  | &9000..pP. queu|
00001c60  65 25 28 37 29 2c 63 6c  65 66 25 28 37 29 2c 6e  |e%(7),clef%(7),n|
00001c70  6f 74 65 25 28 37 29 2c  63 6f 75 6e 74 25 28 37  |ote%(7),count%(7|
00001c80  29 2c 70 6f 73 25 28 37  29 2c 6d 69 64 69 25 28  |),pos%(7),midi%(|
00001c90  37 2c 37 29 2c 6d 69 64  69 73 65 6e 64 25 28 31  |7,7),midisend%(1|
00001ca0  2c 33 31 2c 31 29 0d 0d  7a 2b de 61 63 63 73 74  |,31,1)..z+.accst|
00001cb0  61 74 75 73 25 28 37 29  2c 73 68 61 72 70 73 65  |atus%(7),sharpse|
00001cc0  71 25 28 36 29 2c 66 6c  61 74 73 65 71 25 28 36  |q%(6),flatseq%(6|
00001cd0  29 0d 0d 84 0d f2 72 65  61 64 64 61 74 61 0d 0d  |).....readdata..|
00001ce0  8e 05 e1 0d 0d 98 05 3a  0d 0d a2 0f dd f2 6c 6f  |.......:......lo|
00001cf0  61 64 6d 75 73 69 63 0d  0d ac 15 46 49 4c 45 25  |admusic....FILE%|
00001d00  3d 8e 20 66 69 6c 65 6e  61 6d 65 24 0d 0d b6 20  |=. filename$... |
00001d10  4d 24 3d 22 22 3a e3 52  25 3d 31 b8 37 3a 4d 24  |M$="":.R%=1.7:M$|
00001d20  2b 3d bd 9a 23 46 49 4c  45 25 3a ed 0d 0d c0 2f  |+=..#FILE%:..../|
00001d30  e7 4d 24 3c 3e 22 4d 61  65 73 74 72 6f 22 8c f1  |.M$<>"Maestro"..|
00001d40  22 4d 61 65 73 74 72 6f  20 66 69 6c 65 20 69 73  |"Maestro file is|
00001d50  20 63 6f 72 72 75 70 74  22 3a e0 0d 0d ca 26 42  | corrupt":....&B|
00001d60  25 3d 9a 23 46 49 4c 45  25 3a 42 32 25 3d 9a 23  |%=.#FILE%:B2%=.#|
00001d70  46 49 4c 45 25 3a 42 33  25 3d 9a 23 46 49 4c 45  |FILE%:B3%=.#FILE|
00001d80  25 0d 0d d4 83 e7 42 25  3c 3e 26 41 20 84 42 32  |%.....B%<>&A .B2|
00001d90  25 3c 3e 32 20 84 42 33  25 3c 3e 31 8c f1 22 54  |%<>2 .B3%<>1.."T|
00001da0  68 69 73 20 4d 61 65 73  74 72 6f 20 66 69 6c 65  |his Maestro file|
00001db0  20 69 73 20 69 6e 20 61  20 6e 6f 6e 2d 73 74 61  | is in a non-sta|
00001dc0  6e 64 61 72 64 20 66 6f  72 6d 61 74 2e 20 50 6c  |ndard format. Pl|
00001dd0  65 61 73 65 20 6c 6f 61  64 20 69 74 20 69 6e 74  |ease load it int|
00001de0  6f 20 4d 61 65 73 74 72  6f 20 61 6e 64 20 20 72  |o Maestro and  r|
00001df0  65 73 61 76 65 20 69 74  2e 22 3a d9 23 46 49 4c  |esave it.":.#FIL|
00001e00  45 25 3a e0 0d 0d de 2f  e8 23 46 49 4c 45 25 2c  |E%:..../.#FILE%,|
00001e10  67 61 74 65 73 25 3a e3  52 25 3d 30 b8 37 3a e8  |gates%:.R%=0.7:.|
00001e20  23 46 49 4c 45 25 2c 71  75 65 75 65 25 28 52 25  |#FILE%,queue%(R%|
00001e30  29 3a ed 0d 0d e8 22 e3  52 25 3d 31 b8 67 61 74  |):....".R%=1.gat|
00001e40  65 73 25 3a 3f 28 53 2b  52 25 29 3d 9a 23 46 49  |es%:?(S+R%)=.#FI|
00001e50  4c 45 25 3a ed 0d 0d f2  0b e3 56 25 3d 30 b8 37  |LE%:......V%=0.7|
00001e60  0d 0d fc 45 20 e7 71 75  65 75 65 25 28 56 25 29  |...E .queue%(V%)|
00001e70  3c 3e 30 8c e3 52 25 3d  31 b8 71 75 65 75 65 25  |<>0..R%=1.queue%|
00001e80  28 56 25 29 3a 3f 28 53  2b 52 25 2b 26 31 30 30  |(V%):?(S+R%+&100|
00001e90  30 2a 56 25 2b 26 31 30  30 30 29 3d 9a 23 46 49  |0*V%+&1000)=.#FI|
00001ea0  4c 45 25 3a ed 0d 0e 06  05 ed 0d 0e 10 7e 42 25  |LE%:.........~B%|
00001eb0  3d 9a 23 46 49 4c 45 25  3a e7 42 25 3c 3e 32 20  |=.#FILE%:.B%<>2 |
00001ec0  8c f1 22 54 68 69 73 20  4d 61 65 73 74 72 6f 20  |.."This Maestro |
00001ed0  66 69 6c 65 20 69 73 20  69 6e 20 61 20 6e 6f 6e  |file is in a non|
00001ee0  2d 73 74 61 6e 64 61 72  64 20 66 6f 72 6d 61 74  |-standard format|
00001ef0  2e 20 50 6c 65 61 73 65  20 6c 6f 61 64 20 69 74  |. Please load it|
00001f00  20 69 6e 74 6f 20 4d 61  65 73 74 72 6f 20 61 6e  | into Maestro an|
00001f10  64 20 20 72 65 73 61 76  65 20 69 74 2e 22 3a d9  |d  resave it.":.|
00001f20  23 46 49 4c 45 25 3a e0  0d 0e 1a 1d 73 74 61 76  |#FILE%:.....stav|
00001f30  65 73 25 3d 9a 23 46 49  4c 45 25 2b 34 2a 9a 23  |es%=.#FILE%+4*.#|
00001f40  46 49 4c 45 25 0d 0e 24  0b d9 23 46 49 4c 45 25  |FILE%..$..#FILE%|
00001f50  0d 0e 2e 05 e1 0d 0e 38  05 3a 0d 0e 42 12 dd f2  |.......8.:..B...|
00001f60  64 6f 63 6f 6e 76 65 72  73 69 6f 6e 0d 0e 4c 51  |doconversion..LQ|
00001f70  e3 52 25 3d 30 b8 37 3a  70 6f 73 25 28 52 25 29  |.R%=0.7:pos%(R%)|
00001f80  3d 53 2b 26 31 30 30 30  2a 52 25 2b 26 31 30 30  |=S+&1000*R%+&100|
00001f90  31 3a 63 6c 65 66 25 28  52 25 29 3d 30 3a 63 6f  |1:clef%(R%)=0:co|
00001fa0  75 6e 74 25 28 52 25 29  3d 30 3a 61 63 63 73 74  |unt%(R%)=0:accst|
00001fb0  61 74 75 73 25 28 52 25  29 3d 30 3a ed 0d 0e 56  |atus%(R%)=0:...V|
00001fc0  25 6b 65 79 66 6c 61 74  3d a3 3a 6e 6f 61 63 63  |%keyflat=.:noacc|
00001fd0  69 64 65 6e 74 73 25 3d  30 3a f2 62 61 72 6c 69  |idents%=0:.barli|
00001fe0  6e 65 0d 0e 60 28 70 6f  73 69 74 69 6f 6e 25 3d  |ne..`(position%=|
00001ff0  53 2b 31 3a 74 69 6d 65  72 25 3d 30 3a f2 72 65  |S+1:timer%=0:.re|
00002000  61 64 67 61 74 65 73 3a  eb 30 0d 0e 6a 05 f5 0d  |adgates:.0..j...|
00002010  0e 74 0d 20 74 69 6d 65  72 25 3d 30 0d 0e 7e 06  |.t. timer%=0..~.|
00002020  20 f5 0d 0e 88 1e 20 20  6d 6f 76 65 6f 6e 3d a3  | .....  moveon=.|
00002030  3a 74 69 6d 65 72 25 3d  74 69 6d 65 72 25 2b 31  |:timer%=timer%+1|
00002040  0d 0e 92 0d 20 20 e3 52  25 3d 30 b8 37 0d 0e 9c  |....  .R%=0.7...|
00002050  15 20 20 20 e7 63 6f 75  6e 74 25 28 52 25 29 3d  |.   .count%(R%)=|
00002060  31 8c 0d 0e a6 10 20 20  20 20 6d 6f 76 65 6f 6e  |1.....    moveon|
00002070  3d b9 0d 0e b0 36 20 20  20 20 f2 73 65 6e 64 6d  |=....6    .sendm|
00002080  69 64 69 28 33 2c 26 38  30 2b 6d 69 64 69 25 28  |idi(3,&80+midi%(|
00002090  73 74 61 76 65 73 25 2c  52 25 29 2c 6e 6f 74 65  |staves%,R%),note|
000020a0  25 28 52 25 29 2c 30 29  0d 0e ba 08 20 20 20 cd  |%(R%),0)....   .|
000020b0  0d 0e c4 2d 20 20 20 e7  63 6f 75 6e 74 25 28 52  |...-   .count%(R|
000020c0  25 29 3c 3e 30 8c 63 6f  75 6e 74 25 28 52 25 29  |%)<>0.count%(R%)|
000020d0  3d 63 6f 75 6e 74 25 28  52 25 29 2d 31 0d 0e ce  |=count%(R%)-1...|
000020e0  07 20 20 ed 0d 0e d8 1a  20 20 f4 46 4f 52 77 61  |.  .....  .FORwa|
000020f0  69 74 3d 30 54 4f 31 32  35 3a 4e 45 58 54 0d 0e  |it=0TO125:NEXT..|
00002100  e2 0d 20 fd 20 6d 6f 76  65 6f 6e 0d 0e ec 0f 20  |.. . moveon.... |
00002110  f2 72 65 61 64 67 61 74  65 73 0d 0e f6 39 20 c8  |.readgates...9 .|
00002120  99 22 48 6f 75 72 67 6c  61 73 73 5f 50 65 72 63  |."Hourglass_Perc|
00002130  65 6e 74 61 67 65 22 2c  a8 28 28 70 6f 73 69 74  |entage",.((posit|
00002140  69 6f 6e 25 2d 53 29 2f  67 61 74 65 73 25 2a 31  |ion%-S)/gates%*1|
00002150  30 30 29 0d 0f 00 19 fd  70 6f 73 69 74 69 6f 6e  |00).....position|
00002160  25 3e 28 67 61 74 65 73  25 2b 53 29 0d 0f 0a 05  |%>(gates%+S)....|
00002170  e1 0d 0f 14 05 3a 0d 0f  1e 0f dd f2 72 65 61 64  |.....:......read|
00002180  67 61 74 65 73 0d 0f 28  0a ea 74 79 70 65 25 0d  |gates..(..type%.|
00002190  0f 32 15 20 74 79 70 65  25 3d 3f 70 6f 73 69 74  |.2. type%=?posit|
000021a0  69 6f 6e 25 0d 0f 3c 0f  20 e7 20 74 79 70 65 25  |ion%..<. . type%|
000021b0  3d 30 8c 0d 0f 46 34 20  20 f2 73 70 65 63 69 61  |=0...F4  .specia|
000021c0  6c 28 3f 28 70 6f 73 69  74 69 6f 6e 25 2b 31 29  |l(?(position%+1)|
000021d0  29 3a 70 6f 73 69 74 69  6f 6e 25 3d 70 6f 73 69  |):position%=posi|
000021e0  74 69 6f 6e 25 2b 32 0d  0f 50 29 20 20 e7 ac 28  |tion%+2..P)  ..(|
000021f0  70 6f 73 69 74 69 6f 6e  25 3e 28 67 61 74 65 73  |position%>(gates|
00002200  25 2b 53 29 29 8c f2 72  65 61 64 67 61 74 65 73  |%+S))..readgates|
00002210  0d 0f 5a 06 20 cc 0d 0f  64 2c 20 20 f2 61 64 64  |..Z. ...d,  .add|
00002220  6e 6f 74 65 73 28 74 79  70 65 25 29 3a 70 6f 73  |notes(type%):pos|
00002230  69 74 69 6f 6e 25 3d 70  6f 73 69 74 69 6f 6e 25  |ition%=position%|
00002240  2b 31 0d 0f 6e 06 20 cd  0d 0f 78 05 e1 0d 0f 82  |+1..n. ...x.....|
00002250  05 3a 0d 0f 8c 17 dd f2  61 64 64 6e 6f 74 65 73  |.:......addnotes|
00002260  28 71 75 65 75 65 73 25  29 0d 0f 96 07 ea 52 25  |(queues%).....R%|
00002270  0d 0f a0 0c 20 e3 52 25  3d 30 b8 37 0d 0f aa 22  |.... .R%=0.7..."|
00002280  20 20 e7 28 71 75 65 75  65 73 25 83 32 29 3d 31  |  .(queues%.2)=1|
00002290  8c f2 67 65 74 71 75 65  75 65 28 52 25 29 0d 0f  |..getqueue(R%)..|
000022a0  b4 17 20 20 71 75 65 75  65 73 25 3d 71 75 65 75  |..  queues%=queu|
000022b0  65 73 25 81 32 0d 0f be  06 20 ed 0d 0f c8 05 e1  |es%.2.... ......|
000022c0  0d 0f d2 05 3a 0d 0f dc  12 dd f2 67 65 74 71 75  |....:......getqu|
000022d0  65 75 65 28 71 25 29 0d  0f e6 2f ea 6e 6f 74 65  |eue(q%).../.note|
000022e0  70 6f 73 25 2c 6e 6f 74  65 25 2c 61 63 63 69 64  |pos%,note%,accid|
000022f0  65 6e 74 61 6c 73 25 2c  6c 65 6e 62 69 74 73 25  |entals%,lenbits%|
00002300  2c 64 6f 74 73 25 0d 0f  f0 14 20 e7 63 6f 75 6e  |,dots%.... .coun|
00002310  74 25 28 71 25 29 3c 3e  30 8c 0d 0f fa 34 20 20  |t%(q%)<>0....4  |
00002320  f2 73 65 6e 64 6d 69 64  69 28 33 2c 26 38 30 2b  |.sendmidi(3,&80+|
00002330  6d 69 64 69 25 28 73 74  61 76 65 73 25 2c 71 25  |midi%(staves%,q%|
00002340  29 2c 6e 6f 74 65 25 28  71 25 29 2c 30 29 0d 10  |),note%(q%),0)..|
00002350  04 06 20 cd 0d 10 0e 1b  20 6e 6f 74 65 70 6f 73  |.. ..... notepos|
00002360  25 3d 28 3f 70 6f 73 25  28 71 25 29 29 81 38 0d  |%=(?pos%(q%)).8.|
00002370  10 18 2d 20 61 63 63 69  64 65 6e 74 61 6c 73 25  |..- accidentals%|
00002380  3d a4 72 65 76 62 69 74  73 28 3f 28 70 6f 73 25  |=.revbits(?(pos%|
00002390  28 71 25 29 2b 31 29 2c  30 2c 33 29 0d 10 22 54  |(q%)+1),0,3).."T|
000023a0  20 e7 61 63 63 69 64 65  6e 74 61 6c 73 25 3c 3e  | .accidentals%<>|
000023b0  30 8c f2 63 68 61 6e 67  65 61 63 63 73 74 61 74  |0..changeaccstat|
000023c0  75 73 28 6d 69 64 69 73  65 6e 64 25 28 63 6c 65  |us(midisend%(cle|
000023d0  66 25 28 71 25 29 2c 6e  6f 74 65 70 6f 73 25 2c  |f%(q%),notepos%,|
000023e0  31 29 2c 61 63 63 69 64  65 6e 74 61 6c 73 25 29  |1),accidentals%)|
000023f0  0d 10 2c 56 20 6e 6f 74  65 25 3d 6d 69 64 69 73  |..,V note%=midis|
00002400  65 6e 64 25 28 63 6c 65  66 25 28 71 25 29 2c 6e  |end%(clef%(q%),n|
00002410  6f 74 65 70 6f 73 25 2c  30 29 2b 61 63 63 73 74  |otepos%,0)+accst|
00002420  61 74 75 73 25 28 6d 69  64 69 73 65 6e 64 25 28  |atus%(midisend%(|
00002430  63 6c 65 66 25 28 71 25  29 2c 6e 6f 74 65 70 6f  |clef%(q%),notepo|
00002440  73 25 2c 31 29 29 0d 10  36 31 20 f2 73 65 6e 64  |s%,1))..61 .send|
00002450  6d 69 64 69 28 33 2c 26  39 30 2b 6d 69 64 69 25  |midi(3,&90+midi%|
00002460  28 73 74 61 76 65 73 25  2c 71 25 29 2c 6e 6f 74  |(staves%,q%),not|
00002470  65 25 2c 26 33 46 29 0d  10 40 14 20 6e 6f 74 65  |e%,&3F)..@. note|
00002480  25 28 71 25 29 3d 6e 6f  74 65 25 0d 10 4a 29 20  |%(q%)=note%..J) |
00002490  6c 65 6e 62 69 74 73 25  3d a4 72 65 76 62 69 74  |lenbits%=.revbit|
000024a0  73 28 3f 28 70 6f 73 25  28 71 25 29 2b 31 29 2c  |s(?(pos%(q%)+1),|
000024b0  35 2c 33 29 0d 10 54 26  20 64 6f 74 73 25 3d a4  |5,3)..T& dots%=.|
000024c0  72 65 76 62 69 74 73 28  3f 28 70 6f 73 25 28 71  |revbits(?(pos%(q|
000024d0  25 29 2b 31 29 2c 33 2c  32 29 0d 10 5e 31 20 63  |%)+1),3,2)..^1 c|
000024e0  6f 75 6e 74 25 28 71 25  29 3d a8 28 28 32 5e 28  |ount%(q%)=.((2^(|
000024f0  38 2d 6c 65 6e 62 69 74  73 25 29 29 2a 34 2a 28  |8-lenbits%))*4*(|
00002500  31 2e 35 5e 64 6f 74 73  25 29 29 0d 10 68 18 20  |1.5^dots%))..h. |
00002510  70 6f 73 25 28 71 25 29  3d 70 6f 73 25 28 71 25  |pos%(q%)=pos%(q%|
00002520  29 2b 32 0d 10 72 05 e1  0d 10 7c 05 3a 0d 10 86  |)+2..r....|.:...|
00002530  1f dd a4 72 65 76 62 69  74 73 28 62 69 74 73 25  |...revbits(bits%|
00002540  2c 66 69 72 73 74 25 2c  6e 6f 25 29 0d 10 90 0d  |,first%,no%)....|
00002550  20 ea 52 25 2c 6f 75 74  25 0d 10 9a 0b 20 6f 75  | .R%,out%.... ou|
00002560  74 25 3d 30 0d 10 a4 10  20 e3 52 25 3d 30 b8 6e  |t%=0.... .R%=0.n|
00002570  6f 25 2d 31 0d 10 ae 33  20 20 6f 75 74 25 3d 6f  |o%-1...3  out%=o|
00002580  75 74 25 2d 28 32 5e 52  25 29 2a 28 28 62 69 74  |ut%-(2^R%)*((bit|
00002590  73 25 80 28 32 5e 28 66  69 72 73 74 25 2b 52 25  |s%.(2^(first%+R%|
000025a0  29 29 29 3c 3e 30 29 0d  10 b8 06 20 ed 0d 10 c2  |)))<>0).... ....|
000025b0  09 3d 6f 75 74 25 0d 10  cc 05 3a 0d 10 d6 14 dd  |.=out%....:.....|
000025c0  f2 73 70 65 63 69 61 6c  28 74 79 70 65 25 29 0d  |.special(type%).|
000025d0  10 e0 19 20 e7 28 74 79  70 65 25 80 31 29 3d 31  |... .(type%.1)=1|
000025e0  8c f2 74 69 6d 73 69 67  0d 10 ea 19 20 e7 28 74  |..timsig.... .(t|
000025f0  79 70 65 25 80 33 29 3d  32 8c f2 6b 65 79 73 69  |ype%.3)=2..keysi|
00002600  67 0d 10 f4 1a 20 e7 28  74 79 70 65 25 80 37 29  |g.... .(type%.7)|
00002610  3d 34 8c f2 63 6c 65 66  73 65 74 0d 10 fe 1c 20  |=4..clefset.... |
00002620  e7 28 74 79 70 65 25 80  36 33 29 3d 33 32 8c f2  |.(type%.63)=32..|
00002630  62 61 72 6c 69 6e 65 0d  11 08 05 e1 0d 11 12 05  |barline.........|
00002640  3a 0d 11 1c 0c dd f2 74  69 6d 73 69 67 0d 11 26  |:......timsig..&|
00002650  05 e1 0d 11 30 05 3a 0d  11 3a 0c dd f2 6b 65 79  |....0.:..:...key|
00002660  73 69 67 0d 11 44 1a 20  6b 65 79 66 6c 61 74 3d  |sig..D. keyflat=|
00002670  28 28 74 79 70 65 25 80  34 29 3d 34 29 0d 11 4e  |((type%.4)=4)..N|
00002680  25 20 6e 6f 61 63 63 69  64 65 6e 74 73 25 3d a4  |% noaccidents%=.|
00002690  72 65 76 62 69 74 73 28  74 79 70 65 25 2c 33 2c  |revbits(type%,3,|
000026a0  33 29 0d 11 58 0d 20 f2  62 61 72 6c 69 6e 65 0d  |3)..X. .barline.|
000026b0  11 62 05 e1 0d 11 6c 05  3a 0d 11 76 0d dd f2 63  |.b....l.:..v...c|
000026c0  6c 65 66 73 65 74 0d 11  80 12 20 ea 63 6c 65 66  |lefset.... .clef|
000026d0  25 2c 73 74 61 76 65 25  0d 11 8a 18 20 63 6c 65  |%,stave%.... cle|
000026e0  66 25 3d 28 74 79 70 65  25 80 31 36 29 81 31 36  |f%=(type%.16).16|
000026f0  0d 11 94 2d 20 73 74 61  76 65 25 3d 28 28 74 79  |...- stave%=((ty|
00002700  70 65 25 80 33 32 29 81  33 32 29 2a 32 2b 28 28  |pe%.32).32)*2+((|
00002710  74 79 70 65 25 80 36 34  29 81 36 34 29 0d 11 9e  |type%.64).64)...|
00002720  0c 20 e3 52 25 3d 30 b8  37 0d 11 a8 30 20 20 e7  |. .R%=0.7...0  .|
00002730  6d 69 64 69 25 28 73 74  61 76 65 73 25 2c 52 25  |midi%(staves%,R%|
00002740  29 3d 73 74 61 76 65 25  20 8c 63 6c 65 66 25 28  |)=stave% .clef%(|
00002750  52 25 29 3d 63 6c 65 66  25 0d 11 b2 06 20 ed 0d  |R%)=clef%.... ..|
00002760  11 bc 05 e1 0d 11 c6 05  3a 0d 11 d0 0d dd f2 62  |........:......b|
00002770  61 72 6c 69 6e 65 0d 11  da 10 20 e7 20 6b 65 79  |arline.... . key|
00002780  66 6c 61 74 20 8c 0d 11  e4 0d 20 20 e3 52 25 3d  |flat .....  .R%=|
00002790  30 b8 36 0d 11 ee 45 20  20 20 e7 66 6c 61 74 73  |0.6...E   .flats|
000027a0  65 71 25 28 52 25 29 3c  6e 6f 61 63 63 69 64 65  |eq%(R%)<noaccide|
000027b0  6e 74 73 25 8c 61 63 63  73 74 61 74 75 73 25 28  |nts%.accstatus%(|
000027c0  52 25 29 3d 2d 31 20 8b  61 63 63 73 74 61 74 75  |R%)=-1 .accstatu|
000027d0  73 25 28 52 25 29 3d 30  0d 11 f8 07 20 20 ed 0d  |s%(R%)=0....  ..|
000027e0  12 02 06 20 cc 0d 12 0c  0d 20 20 e3 52 25 3d 30  |... .....  .R%=0|
000027f0  b8 36 0d 12 16 45 20 20  20 e7 73 68 61 72 70 73  |.6...E   .sharps|
00002800  65 71 25 28 52 25 29 3c  6e 6f 61 63 63 69 64 65  |eq%(R%)<noaccide|
00002810  6e 74 73 25 8c 61 63 63  73 74 61 74 75 73 25 28  |nts%.accstatus%(|
00002820  52 25 29 3d 31 20 8b 61  63 63 73 74 61 74 75 73  |R%)=1 .accstatus|
00002830  25 28 52 25 29 3d 30 0d  12 20 07 20 20 ed 0d 12  |%(R%)=0.. .  ...|
00002840  2a 06 20 cd 0d 12 34 05  e1 0d 12 3e 05 3a 0d 12  |*. ...4....>.:..|
00002850  48 21 dd f2 63 68 61 6e  67 65 61 63 63 73 74 61  |H!..changeaccsta|
00002860  74 75 73 28 6b 65 79 25  2c 74 79 70 65 25 29 0d  |tus(key%,type%).|
00002870  12 52 0f 20 c8 8e 20 74  79 70 65 25 20 ca 0d 12  |.R. .. type% ...|
00002880  5c 1c 20 20 c9 20 31 3a  61 63 63 73 74 61 74 75  |\.  . 1:accstatu|
00002890  73 25 28 6b 65 79 25 29  3d 30 0d 12 66 1c 20 20  |s%(key%)=0..f.  |
000028a0  c9 20 32 3a 61 63 63 73  74 61 74 75 73 25 28 6b  |. 2:accstatus%(k|
000028b0  65 79 25 29 3d 31 0d 12  70 1d 20 20 c9 20 33 3a  |ey%)=1..p.  . 3:|
000028c0  61 63 63 73 74 61 74 75  73 25 28 6b 65 79 25 29  |accstatus%(key%)|
000028d0  3d 2d 31 0d 12 7a 06 20  cb 0d 12 84 05 e1 0d 12  |=-1..z. ........|
000028e0  8e 05 3a 0d 12 98 13 dd  f2 64 65 6c 74 61 74 69  |..:......deltati|
000028f0  6d 65 28 6e 25 29 0d 12  a2 17 ea 62 79 74 65 73  |me(n%).....bytes|
00002900  25 2c 61 25 2c 62 25 2c  63 25 2c 64 25 0d 12 ac  |%,a%,b%,c%,d%...|
00002910  20 64 25 3d a4 72 65 76  62 69 74 73 28 6e 25 2c  | d%=.revbits(n%,|
00002920  30 2c 37 29 3a 62 79 74  65 73 25 3d 31 0d 12 b6  |0,7):bytes%=1...|
00002930  2d 63 25 3d a4 72 65 76  62 69 74 73 28 6e 25 2c  |-c%=.revbits(n%,|
00002940  37 2c 37 29 2b 31 32 38  3a e7 63 25 3c 3e 31 32  |7,7)+128:.c%<>12|
00002950  38 8c 62 79 74 65 73 25  3d 32 0d 12 c0 2e 62 25  |8.bytes%=2....b%|
00002960  3d a4 72 65 76 62 69 74  73 28 6e 25 2c 31 34 2c  |=.revbits(n%,14,|
00002970  37 29 2b 31 32 38 3a e7  62 25 3c 3e 31 32 38 8c  |7)+128:.b%<>128.|
00002980  62 79 74 65 73 25 3d 33  0d 12 ca 2e 61 25 3d a4  |bytes%=3....a%=.|
00002990  72 65 76 62 69 74 73 28  6e 25 2c 32 31 2c 37 29  |revbits(n%,21,7)|
000029a0  2b 31 32 38 3a e7 61 25  3c 3e 31 32 38 8c 62 79  |+128:.a%<>128.by|
000029b0  74 65 73 25 3d 34 0d 12  d4 2e e7 62 79 74 65 73  |tes%=4.....bytes|
000029c0  25 3e 33 8c 3f 6d 69 64  69 74 6f 70 25 3d 61 25  |%>3.?miditop%=a%|
000029d0  3a 6d 69 64 69 74 6f 70  25 3d 6d 69 64 69 74 6f  |:miditop%=midito|
000029e0  70 25 2b 31 0d 12 de 2e  e7 62 79 74 65 73 25 3e  |p%+1.....bytes%>|
000029f0  32 8c 3f 6d 69 64 69 74  6f 70 25 3d 62 25 3a 6d  |2.?miditop%=b%:m|
00002a00  69 64 69 74 6f 70 25 3d  6d 69 64 69 74 6f 70 25  |iditop%=miditop%|
00002a10  2b 31 0d 12 e8 2e e7 62  79 74 65 73 25 3e 31 8c  |+1.....bytes%>1.|
00002a20  3f 6d 69 64 69 74 6f 70  25 3d 63 25 3a 6d 69 64  |?miditop%=c%:mid|
00002a30  69 74 6f 70 25 3d 6d 69  64 69 74 6f 70 25 2b 31  |itop%=miditop%+1|
00002a40  0d 12 f2 24 3f 6d 69 64  69 74 6f 70 25 3d 64 25  |...$?miditop%=d%|
00002a50  3a 6d 69 64 69 74 6f 70  25 3d 6d 69 64 69 74 6f  |:miditop%=midito|
00002a60  70 25 2b 31 0d 12 fc 05  e1 0d 13 06 05 3a 0d 13  |p%+1.........:..|
00002a70  10 17 dd f2 73 65 6e 64  6d 69 64 69 28 6e 2c 78  |....sendmidi(n,x|
00002a80  2c 79 2c 7a 29 0d 13 1a  20 20 f2 64 65 6c 74 61  |,y,z)...  .delta|
00002a90  74 69 6d 65 28 74 69 6d  65 72 25 29 3a 74 69 6d  |time(timer%):tim|
00002aa0  65 72 25 3d 30 0d 13 24  10 20 3f 6d 69 64 69 74  |er%=0..$. ?midit|
00002ab0  6f 70 25 3d 78 0d 13 2e  1b 20 e7 6e 3e 31 20 8c  |op%=x.... .n>1 .|
00002ac0  20 3f 28 6d 69 64 69 74  6f 70 25 2b 31 29 3d 79  | ?(miditop%+1)=y|
00002ad0  0d 13 38 1b 20 e7 6e 3e  32 20 8c 20 3f 28 6d 69  |..8. .n>2 . ?(mi|
00002ae0  64 69 74 6f 70 25 2b 32  29 3d 7a 0d 13 42 18 20  |ditop%+2)=z..B. |
00002af0  6d 69 64 69 74 6f 70 25  3d 6d 69 64 69 74 6f 70  |miditop%=miditop|
00002b00  25 2b 6e 0d 13 4c 05 e1  0d 13 56 05 3a 0d 13 60  |%+n..L....V.:..`|
00002b10  0e dd f2 72 65 61 64 64  61 74 61 0d 13 6a 06 20  |...readdata..j. |
00002b20  f7 0d 13 74 11 20 e3 73  74 61 76 65 73 25 3d 30  |...t. .staves%=0|
00002b30  b8 37 0d 13 7e 22 20 20  e3 52 25 3d 30 b8 37 3a  |.7..~"  .R%=0.7:|
00002b40  f3 6d 69 64 69 25 28 73  74 61 76 65 73 25 2c 52  |.midi%(staves%,R|
00002b50  25 29 3a ed 0d 13 88 06  20 ed 0d 13 92 0f 20 e3  |%):..... ..... .|
00002b60  63 6c 65 66 25 3d 30 b8  31 0d 13 9c 11 20 20 e3  |clef%=0.1....  .|
00002b70  6e 6f 74 65 25 3d 30 b8  33 31 0d 13 a6 11 20 20  |note%=0.31....  |
00002b80  20 e3 64 61 74 61 25 3d  30 b8 31 0d 13 b0 25 20  | .data%=0.1...% |
00002b90  20 20 20 f3 6d 69 64 69  73 65 6e 64 25 28 63 6c  |   .midisend%(cl|
00002ba0  65 66 25 2c 6e 6f 74 65  25 2c 64 61 74 61 25 29  |ef%,note%,data%)|
00002bb0  0d 13 ba 08 20 20 20 ed  0d 13 c4 07 20 20 ed 0d  |....   .....  ..|
00002bc0  13 ce 06 20 ed 0d 13 d8  4e 20 f4 20 42 65 6c 6f  |... ....N . Belo|
00002bd0  77 20 72 65 70 72 65 73  65 6e 74 73 20 22 46 61  |w represents "Fa|
00002be0  74 68 65 72 20 43 68 72  69 73 74 6d 61 73 20 47  |ther Christmas G|
00002bf0  6f 65 73 20 44 6f 77 6e  20 41 6c 6c 20 45 73 63  |oes Down All Esc|
00002c00  61 6c 61 74 6f 72 73 20  42 61 63 6b 77 61 72 64  |alators Backward|
00002c10  73 21 22 0d 13 e2 25 20  73 68 61 72 70 73 65 71  |s!"...% sharpseq|
00002c20  25 28 30 29 3d 34 3a 66  6c 61 74 73 65 71 25 28  |%(0)=4:flatseq%(|
00002c30  30 29 3d 32 3a f4 20 41  0d 13 ec 25 20 73 68 61  |0)=2:. A...% sha|
00002c40  72 70 73 65 71 25 28 31  29 3d 36 3a 66 6c 61 74  |rpseq%(1)=6:flat|
00002c50  73 65 71 25 28 31 29 3d  30 3a f4 20 42 0d 13 f6  |seq%(1)=0:. B...|
00002c60  25 20 73 68 61 72 70 73  65 71 25 28 32 29 3d 31  |% sharpseq%(2)=1|
00002c70  3a 66 6c 61 74 73 65 71  25 28 32 29 3d 35 3a f4  |:flatseq%(2)=5:.|
00002c80  20 43 0d 14 00 25 20 73  68 61 72 70 73 65 71 25  | C...% sharpseq%|
00002c90  28 33 29 3d 33 3a 66 6c  61 74 73 65 71 25 28 33  |(3)=3:flatseq%(3|
00002ca0  29 3d 33 3a f4 20 44 0d  14 0a 25 20 73 68 61 72  |)=3:. D...% shar|
00002cb0  70 73 65 71 25 28 34 29  3d 35 3a 66 6c 61 74 73  |pseq%(4)=5:flats|
00002cc0  65 71 25 28 34 29 3d 31  3a f4 20 45 0d 14 14 25  |eq%(4)=1:. E...%|
00002cd0  20 73 68 61 72 70 73 65  71 25 28 35 29 3d 30 3a  | sharpseq%(5)=0:|
00002ce0  66 6c 61 74 73 65 71 25  28 35 29 3d 36 3a f4 20  |flatseq%(5)=6:. |
00002cf0  46 0d 14 1e 25 20 73 68  61 72 70 73 65 71 25 28  |F...% sharpseq%(|
00002d00  36 29 3d 32 3a 66 6c 61  74 73 65 71 25 28 36 29  |6)=2:flatseq%(6)|
00002d10  3d 34 3a f4 20 47 0d 14  28 05 e1 0d 14 32 05 e1  |=4:. G..(....2..|
00002d20  0d 14 3c 05 3a 0d 14 46  2a f4 20 4d 49 44 49 20  |..<.:..F*. MIDI |
00002d30  56 6f 69 63 65 20 61 6c  6c 6f 63 61 74 69 6f 6e  |Voice allocation|
00002d40  73 20 74 6f 20 65 61 63  68 20 71 75 65 75 65 0d  |s to each queue.|
00002d50  14 50 14 dc 30 2c 30 2c  30 2c 30 2c 30 2c 30 2c  |.P..0,0,0,0,0,0,|
00002d60  30 2c 30 0d 14 5a 14 dc  30 2c 30 2c 30 2c 30 2c  |0,0..Z..0,0,0,0,|
00002d70  31 2c 31 2c 31 2c 31 0d  14 64 14 dc 30 2c 31 2c  |1,1,1,1..d..0,1,|
00002d80  31 2c 31 2c 31 2c 32 2c  32 2c 32 0d 14 6e 14 dc  |1,1,1,2,2,2..n..|
00002d90  30 2c 30 2c 31 2c 31 2c  32 2c 32 2c 33 2c 33 0d  |0,0,1,1,2,2,3,3.|
00002da0  14 78 14 dc 30 2c 30 2c  30 2c 30 2c 30 2c 30 2c  |.x..0,0,0,0,0,0,|
00002db0  30 2c 39 0d 14 82 14 dc  30 2c 30 2c 30 2c 30 2c  |0,9.....0,0,0,0,|
00002dc0  31 2c 31 2c 31 2c 39 0d  14 8c 14 dc 30 2c 31 2c  |1,1,1,9.....0,1,|
00002dd0  31 2c 31 2c 31 2c 32 2c  32 2c 39 0d 14 96 14 dc  |1,1,1,2,2,9.....|
00002de0  30 2c 30 2c 31 2c 31 2c  32 2c 32 2c 33 2c 39 0d  |0,0,1,1,2,2,3,9.|
00002df0  14 a0 05 3a 0d 14 aa 3c  f4 20 54 72 65 62 6c 65  |...:...<. Treble|
00002e00  20 43 6c 65 66 20 28 4d  61 65 73 74 72 6f 20 6c  | Clef (Maestro l|
00002e10  69 6e 65 20 6e 6f 2f 61  63 63 69 64 65 6e 74 61  |ine no/accidenta|
00002e20  6c 20 2d 2d 3e 20 4d 49  44 49 20 4e 6f 74 65 29  |l --> MIDI Note)|
00002e30  0d 14 b4 08 dc 30 2c 37  0d 14 be 09 dc 34 35 2c  |.....0,7.....45,|
00002e40  30 0d 14 c8 09 dc 34 37  2c 31 0d 14 d2 09 dc 34  |0.....47,1.....4|
00002e50  38 2c 32 0d 14 dc 09 dc  35 30 2c 33 0d 14 e6 09  |8,2.....50,3....|
00002e60  dc 35 32 2c 34 0d 14 f0  09 dc 35 33 2c 35 0d 14  |.52,4.....53,5..|
00002e70  fa 09 dc 35 35 2c 36 0d  15 04 09 dc 35 37 2c 30  |...55,6.....57,0|
00002e80  0d 15 0e 09 dc 35 39 2c  31 0d 15 18 09 dc 36 30  |.....59,1.....60|
00002e90  2c 32 0d 15 22 09 dc 36  32 2c 33 0d 15 2c 09 dc  |,2.."..62,3..,..|
00002ea0  36 34 2c 34 0d 15 36 09  dc 36 35 2c 35 0d 15 40  |64,4..6..65,5..@|
00002eb0  09 dc 36 37 2c 36 0d 15  4a 09 dc 36 39 2c 30 0d  |..67,6..J..69,0.|
00002ec0  15 54 09 dc 37 31 2c 31  0d 15 5e 09 dc 37 32 2c  |.T..71,1..^..72,|
00002ed0  32 0d 15 68 09 dc 37 34  2c 33 0d 15 72 09 dc 37  |2..h..74,3..r..7|
00002ee0  36 2c 34 0d 15 7c 09 dc  37 37 2c 35 0d 15 86 09  |6,4..|..77,5....|
00002ef0  dc 37 39 2c 36 0d 15 90  09 dc 38 31 2c 30 0d 15  |.79,6.....81,0..|
00002f00  9a 09 dc 38 33 2c 31 0d  15 a4 09 dc 38 34 2c 32  |...83,1.....84,2|
00002f10  0d 15 ae 09 dc 38 36 2c  33 0d 15 b8 09 dc 38 38  |.....86,3.....88|
00002f20  2c 34 0d 15 c2 09 dc 38  39 2c 35 0d 15 cc 09 dc  |,4.....89,5.....|
00002f30  39 31 2c 36 0d 15 d6 09  dc 39 33 2c 30 0d 15 e0  |91,6.....93,0...|
00002f40  09 dc 39 35 2c 31 0d 15  ea 09 dc 39 36 2c 32 0d  |..95,1.....96,2.|
00002f50  15 f4 05 3a 0d 15 fe 3a  f4 20 42 61 73 73 20 43  |...:...:. Bass C|
00002f60  6c 65 66 20 28 4d 61 65  73 74 72 6f 20 6c 69 6e  |lef (Maestro lin|
00002f70  65 20 6e 6f 2f 61 63 63  69 64 65 6e 74 61 6c 20  |e no/accidental |
00002f80  2d 2d 3e 20 4d 49 44 49  20 4e 6f 74 65 29 0d 16  |--> MIDI Note)..|
00002f90  08 08 dc 30 2c 37 0d 16  12 09 dc 32 34 2c 32 0d  |...0,7.....24,2.|
00002fa0  16 1c 09 dc 32 36 2c 33  0d 16 26 09 dc 32 38 2c  |....26,3..&..28,|
00002fb0  34 0d 16 30 09 dc 32 39  2c 35 0d 16 3a 09 dc 33  |4..0..29,5..:..3|
00002fc0  31 2c 36 0d 16 44 09 dc  33 33 2c 30 0d 16 4e 09  |1,6..D..33,0..N.|
00002fd0  dc 33 35 2c 31 0d 16 58  09 dc 33 36 2c 32 0d 16  |.35,1..X..36,2..|
00002fe0  62 09 dc 33 38 2c 33 0d  16 6c 09 dc 34 30 2c 34  |b..38,3..l..40,4|
00002ff0  0d 16 76 09 dc 34 31 2c  35 0d 16 80 09 dc 34 33  |..v..41,5.....43|
00003000  2c 36 0d 16 8a 09 dc 34  35 2c 30 0d 16 94 09 dc  |,6.....45,0.....|
00003010  34 37 2c 31 0d 16 9e 09  dc 34 38 2c 32 0d 16 a8  |47,1.....48,2...|
00003020  09 dc 35 30 2c 33 0d 16  b2 09 dc 35 32 2c 34 0d  |..50,3.....52,4.|
00003030  16 bc 09 dc 35 33 2c 35  0d 16 c6 09 dc 35 35 2c  |....53,5.....55,|
00003040  36 0d 16 d0 09 dc 35 37  2c 30 0d 16 da 09 dc 35  |6.....57,0.....5|
00003050  39 2c 31 0d 16 e4 09 dc  36 30 2c 32 0d 16 ee 09  |9,1.....60,2....|
00003060  dc 36 32 2c 33 0d 16 f8  09 dc 36 34 2c 34 0d 17  |.62,3.....64,4..|
00003070  02 09 dc 36 35 2c 35 0d  17 0c 09 dc 36 37 2c 36  |...65,5.....67,6|
00003080  0d 17 16 09 dc 36 39 2c  30 0d 17 20 09 dc 37 31  |.....69,0.. ..71|
00003090  2c 31 0d 17 2a 09 dc 37  32 2c 32 0d 17 34 09 dc  |,1..*..72,2..4..|
000030a0  37 34 2c 33 0d 17 3e 09  dc 37 36 2c 34 0d ff     |74,3..>..76,4..|
000030af