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

!MakeMIDI/old/!RI090899

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

$(e%+4)=m$+�0
3ș "Wimp_ReportError",e%,&13,"MIDI Maker" � ,r%
=r%
(:
2��fault(err%,err$)
<!e%=err%
F$(e%+4)=err$+�0
P)�err%=220 � $(e%+4)="Bad filename"+�0
Z+ș "Wimp_ReportError",e%,0,"MIDI Maker"
d�
n:
x
��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
��
��
�:
�ݤget_str(q%)
� fn$,p%
p%=0:fn$=""
�
" fn$=fn$+�(q%?p%)
, p%=p%+1
6� (q%?p%)<32
@=fn$
J:
T��menus
^
 �infobox
h
 �savebox
r �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
� $(m%+72)="Save as:"+�0
� m%!84=3
 m%!88=15:m%!92=10
 m%!96=185:m%!100=55
 m%!104=&0700F13D
& m%!108=m%+250
0 m%!112=m%+192
: m%!116=100
D m%!120=80:m%!124=80
N m%!128=145:m%!132=145
X m%!136=&0700611A
b m%!140=m%+200
l
 m%!144=1
v
 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
�  p%=menusp%+512:mainmenu%=p%
/ $p%="MIDI Maker"+�0:p%!12=&70207:p%!16=200
 p%!20=40:p%!24=0:f%=p%+28
> !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
*4 !f%=0:f%!4=save%:$(f%+12)="Make MIDI"+�0:f%+=24
41 �pages=0�f%!8=2^22+&07000011 �f%!8=&07003011
>- !f%=0:f%!4=-1:$(f%+12)="Clear"+�0:f%+=24
H= !f%=&80:f%!4=-1:f%!8=&07003011:$(f%+12)="Quit"+�0:f%+=24
R�
\:
f��handlemenu
p � a%,l%
z
 Ȏ !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%
�s%=infosp%
	s%!28=&84000012
	s%!32=&1070207
	s%!36=&20103
	$s%!40=20:s%!44=0
	.s%!48=636:s%!52=216
	8s%!56=&00000119
	Bs%!60=&00000000
	Ls%!64=1
	V
s%!68=616
	`
s%!70=216
	js%!72=s%+528
	ts%!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
	�i%!24=s%+390
i%!28=30


i%+=32
!i%=32:i%!4=60
i%!8=184:i%!12=108
(i%!16=&07000211
2$(i%+20)="Author:"+�0
<
i%+=32
F!i%=188:i%!4=60
Pi%!8=632:i%!12=108
Zi%!16=&0700013D
di%!20=s%+432
ni%!24=s%+390
x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
�
i%+=32
!i%=32:i%!4=164
i%!8=184:i%!12=212
i%!16=&07000211
"$(i%+20)="Name:"+�0
,
i%+=32
6!i%=188:i%!4=164
@i%!8=632:i%!12=212
Ji%!16=&0700013D
Ti%!20=s%+496
^i%!24=s%+390
hi%!28=30
r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
��
�:
���icon(redraw)
�sp%=iconsp%
� redraw �
 !sp%=-1:sp%!4=icon%
 ș "Wimp_DeleteIcon",,sp%
&�
0!sp%=-1
:sp%!4=0
D
sp%!8=-16
Nsp%!12=128:sp%!16=84
Xsp%!20=&1700310B
bsp%!24=sp%+40
lsp%!28=sp%+80
v
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
��doconversion

ș"Hourglass_Off"

�

:

 ��setupconvert

*
� S &9000

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

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

H
�readdata

R�

\:

f��loadmusic

pFILE%=� filename$

z 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%

��

�:
��doconversion
Q�R%=0�7:pos%(R%)=S+&1000*R%+&1001:clef%(R%)=0:count%(R%)=0:accstatus%(R%)=0:�
%keyflat=�:noaccidents%=0:�barline
$%position%=S+1:timer%=0:�readgates
.�
8
 timer%=0
B �
L  moveon=�:timer%=timer%+1
V
  �R%=0�7
`   �count%(R%)=1�
j    moveon=�
tD    �note%(R%)<>0��sendmidi(3,&80+midi%(staves%,R%),note%(R%),0)
~   �
�-   �count%(R%)<>0�count%(R%)=count%(R%)-1
�  �
�  �wait=0�125:�
�
 � moveon
� �readgates
�9 ș"Hourglass_Percentage",�((position%-S)/gates%*100)
��position%>(gates%+S)
��
�:
���readgates
�
�type%
� type%=?position%
 � type%=0�

4  �special(?(position%+1)):position%=position%+2
)  �(position%>(gates%+S))��readgates
 �
(,  �addnotes(type%):position%=position%+1
2 �
<�
F:
P��addnotes(queues%)
Z�R%
d �R%=0�7
n"  �(queues%�2)=1��getqueue(R%)
x  queues%=queues%�2
� �
��
�:
���getqueue(q%)
�/�notepos%,note%,accidentals%,lenbits%,dots%
� 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))
�< � note%<>0��sendmidi(3,&90+midi%(staves%,q%),note%,&3F)
� note%(q%)=note%
�) lenbits%=�revbits(?(pos%(q%)+1),5,3)
�& dots%=�revbits(?(pos%(q%)+1),3,2)
1 count%(q%)=�((2^(8-lenbits%))*4*(1.5^dots%))
 pos%(q%)=pos%(q%)+2
�
":
,ݤrevbits(bits%,first%,no%)
6
 �R%,out%
@ out%=0
J �R%=0�no%-1
T3  out%=out%-(2^R%)*((bits%�(2^(first%+R%)))<>0)
^ �
h	=out%
r:
|��special(type%)
� �(type%�1)=1��timsig
� �(type%�3)=2��keysig
� �(type%�7)=4��clefset
� �(type%�63)=32��barline
��
�:
���timsig
��
�:
���keysig
� keyflat=((type%�4)=4)
�% noaccidents%=�revbits(type%,3,3)
�
 �barline
�
:

��clefset
& �clef%,stave%
0 clef%=(type%�16)�16
:- stave%=((type%�32)�32)*2+((type%�64)�64)
D �R%=0�7
N0  �midi%(staves%,R%)=stave% �clef%(R%)=clef%
X �
b�
l:
v
��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
�  �
� �
��
�:
�!��changeaccstatus(key%,type%)
� Ȏ type% �
  � 1:accstatus%(key%)=0
  � 2:accstatus%(key%)=1
  � 3:accstatus%(key%)=-1
  �
*�
4:
>��sendmidi(n,x,y,z)
H ș "MIDI_TxByte",x
R �n>1 �ș "MIDI_TxByte",y
\ �n>2 �ș "MIDI_TxByte",z
f�
p:
z��readdata
� �
� �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
8% sharpseq%(6)=2:flatseq%(6)=4:� G
B�
L�
V:
`*� MIDI Voice allocations to each queue
j�0,0,0,0,0,0,0,0
t�0,0,0,0,1,1,1,1
~�0,1,1,1,1,2,2,2
��0,0,1,1,2,2,3,3
��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
2	�60,2
<	�62,3
F	�64,4
P	�65,5
Z	�67,6
d	�69,0
n	�71,1
x	�72,2
�	�74,3
�	�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
6	�26,3
@	�28,4
J	�29,5
T	�31,6
^	�33,0
h	�35,1
r	�36,2
|	�38,3
�	�40,4
�	�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
0	�69,0
:	�71,1
D	�72,2
N	�74,3
X	�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 0a f2 63 6c 65 61 72  |~space..P..clear|
00000120  0d 00 5a 11 f2 73 65 74  75 70 63 6f 6e 76 65 72  |..Z..setupconver|
00000130  74 0d 00 64 05 3a 0d 00  6e 33 c8 99 20 22 57 69  |t..d.:..n3.. "Wi|
00000140  6d 70 5f 49 6e 69 74 69  61 6c 69 73 65 22 2c 32  |mp_Initialise",2|
00000150  30 30 2c 26 34 42 35 33  34 31 35 34 2c 22 4d 49  |00,&4B534154,"MI|
00000160  44 49 20 4d 61 6b 65 72  22 0d 00 78 0c f2 69 63  |DI Maker"..x..ic|
00000170  6f 6e 28 a3 29 0d 00 82  0a f2 6d 65 6e 75 73 0d  |on(.).....menus.|
00000180  00 8c 06 20 f5 0d 00 96  1e 20 20 c8 99 20 22 57  |... .....  .. "W|
00000190  69 6d 70 5f 50 6f 6c 6c  22 2c 30 2c 71 25 20 b8  |imp_Poll",0,q% .|
000001a0  20 61 25 0d 00 a0 0d 20  20 c8 8e 20 61 25 20 ca  | a%....  .. a% .|
000001b0  0d 00 aa 0a 20 20 20 c9  20 36 0d 00 b4 12 20 20  |....   . 6....  |
000001c0  20 20 c8 8e 20 71 25 21  31 32 20 ca 0d 00 be 0d  |  .. q%!12 .....|
000001d0  20 20 20 20 20 c9 20 2d  32 0d 00 c8 2d 20 20 20  |     . -2...-   |
000001e0  20 20 20 e7 20 71 25 21  31 36 3d 69 63 6f 6e 25  |   . q%!16=icon%|
000001f0  20 80 20 71 25 21 38 3d  32 20 8c 20 f2 6f 70 65  | . q%!8=2 . .ope|
00000200  6e 5f 6d 65 6e 75 0d 00  d2 10 20 20 20 20 20 c9  |n_menu....     .|
00000210  20 73 61 76 65 25 0d 00  dc 14 20 20 20 20 20 20  | save%....      |
00000220  c8 8e 20 71 25 21 31 36  20 ca 0d 00 e6 0e 20 20  |.. q%!16 .....  |
00000230  20 20 20 20 20 c9 20 31  0d 00 f0 1a 20 20 20 20  |     . 1....    |
00000240  20 20 20 20 20 e7 20 28  71 25 21 38 29 3e 31 36  |     . (q%!8)>16|
00000250  20 8c 0d 00 fa 19 20 20  20 20 20 20 20 20 20 20  | .....          |
00000260  20 21 71 32 25 3d 73 61  76 65 25 0d 01 04 16 20  | !q2%=save%.... |
00000270  20 20 20 20 20 20 20 20  20 20 71 32 25 21 34 3d  |          q2%!4=|
00000280  31 0d 01 0e 2a 20 20 20  20 20 20 20 20 20 20 20  |1...*           |
00000290  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
000002a0  53 74 61 74 65 22 2c 2c  71 32 25 0d 01 18 1b 20  |State",,q2%.... |
000002b0  20 20 20 20 20 20 20 20  20 20 71 32 25 21 36 34  |          q2%!64|
000002c0  3d 73 61 76 65 25 0d 01  22 31 20 20 20 20 20 20  |=save%.."1      |
000002d0  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 47 65  |     .. "Wimp_Ge|
000002e0  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 28  |tWindowState",,(|
000002f0  71 32 25 2b 36 34 29 0d  01 2c 18 20 20 20 20 20  |q2%+64)..,.     |
00000300  20 20 20 20 20 20 21 72  25 3d 73 61 76 65 25 0d  |      !r%=save%.|
00000310  01 36 15 20 20 20 20 20  20 20 20 20 20 20 72 25  |.6.           r%|
00000320  21 34 3d 35 0d 01 40 24  20 20 20 20 20 20 20 20  |!4=5..@$        |
00000330  20 20 20 72 25 21 38 3d  28 71 32 25 21 36 38 29  |   r%!8=(q2%!68)|
00000340  2b 28 71 32 25 21 38 29  0d 01 4a 26 20 20 20 20  |+(q2%!8)..J&    |
00000350  20 20 20 20 20 20 20 72  25 21 31 32 3d 28 71 32  |       r%!12=(q2|
00000360  25 21 37 32 29 2b 28 71  32 25 21 31 32 29 0d 01  |%!72)+(q2%!12)..|
00000370  54 26 20 20 20 20 20 20  20 20 20 20 20 72 25 21  |T&           r%!|
00000380  31 36 3d 28 71 32 25 21  36 38 29 2b 28 71 32 25  |16=(q2%!68)+(q2%|
00000390  21 31 36 29 0d 01 5e 26  20 20 20 20 20 20 20 20  |!16)..^&        |
000003a0  20 20 20 72 25 21 32 30  3d 28 71 32 25 21 37 32  |   r%!20=(q2%!72|
000003b0  29 2b 28 71 32 25 21 32  30 29 0d 01 68 1e 20 20  |)+(q2%!20)..h.  |
000003c0  20 20 20 20 20 20 20 20  20 72 25 21 32 34 3d 26  |         r%!24=&|
000003d0  38 30 30 30 30 30 30 30  0d 01 72 1e 20 20 20 20  |80000000..r.    |
000003e0  20 20 20 20 20 20 20 72  25 21 32 38 3d 26 38 30  |       r%!28=&80|
000003f0  30 30 30 30 30 30 0d 01  7c 1e 20 20 20 20 20 20  |000000..|.      |
00000400  20 20 20 20 20 72 25 21  33 32 3d 26 37 46 46 46  |     r%!32=&7FFF|
00000410  46 46 46 46 0d 01 86 1e  20 20 20 20 20 20 20 20  |FFFF....        |
00000420  20 20 20 72 25 21 33 36  3d 26 37 46 46 46 46 46  |   r%!36=&7FFFFF|
00000430  46 46 0d 01 90 24 20 20  20 20 20 20 20 20 20 20  |FF...$          |
00000440  20 c8 99 20 22 57 69 6d  70 5f 44 72 61 67 42 6f  | .. "Wimp_DragBo|
00000450  78 22 2c 2c 72 25 0d 01  9a 0e 20 20 20 20 20 20  |x",,r%....      |
00000460  20 20 20 cd 0d 01 a4 0e  20 20 20 20 20 20 20 c9  |   .....       .|
00000470  20 32 0d 01 ae 26 20 20  20 20 20 20 20 20 20 f2  | 2...&         .|
00000480  73 61 76 65 28 a4 67 65  74 5f 73 74 72 28 73 61  |save(.get_str(sa|
00000490  76 65 74 78 74 25 29 29  0d 01 b8 25 20 20 20 20  |vetxt%))...%    |
000004a0  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 43 72  |     .. "Wimp_Cr|
000004b0  65 61 74 65 4d 65 6e 75  22 2c 2c 2d 31 0d 01 c2  |eateMenu",,-1...|
000004c0  0b 20 20 20 20 20 20 cb  0d 01 cc 09 20 20 20 20  |.      .....    |
000004d0  cb 0d 01 d6 0a 20 20 20  c9 20 37 0d 01 e0 25 20  |.....   . 7...% |
000004e0  20 20 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 50  |   .. "Wimp_GetP|
000004f0  6f 69 6e 74 65 72 49 6e  66 6f 22 2c 2c 71 32 25  |ointerInfo",,q2%|
00000500  0d 01 ea 0e 20 20 20 20  21 72 25 3d 33 36 0d 01  |....    !r%=36..|
00000510  f4 0f 20 20 20 20 72 25  21 31 36 3d 31 0d 01 fe  |..    r%!16=1...|
00000520  14 20 20 20 20 72 25 21  32 30 3d 71 32 25 21 31  |.    r%!20=q2%!1|
00000530  32 0d 02 08 14 20 20 20  20 72 25 21 32 34 3d 71  |2....    r%!24=q|
00000540  32 25 21 31 36 0d 02 12  12 20 20 20 20 72 25 21  |2%!16....    r%!|
00000550  32 38 3d 21 71 32 25 0d  02 1c 13 20 20 20 20 72  |28=!q2%....    r|
00000560  25 21 33 32 3d 71 32 25  21 34 0d 02 26 0f 20 20  |%!32=q2%!4..&.  |
00000570  20 20 72 25 21 31 32 3d  30 0d 02 30 1c 20 20 20  |  r%!12=0..0.   |
00000580  20 72 25 21 33 36 3d 6d  69 64 69 74 6f 70 25 2d  | r%!36=miditop%-|
00000590  73 70 61 63 65 0d 02 3a  25 20 20 20 20 20 73 61  |space..:%     sa|
000005a0  76 65 66 69 6c 65 24 3d  a4 67 65 74 5f 73 74 72  |vefile$=.get_str|
000005b0  28 73 61 76 65 74 78 74  25 29 0d 02 44 0d 20 20  |(savetxt%)..D.  |
000005c0  20 20 20 70 25 3d 30 0d  02 4e 20 20 20 20 20 20  |   p%=0..N      |
000005d0  c8 95 20 a7 73 61 76 65  66 69 6c 65 24 2c 22 2e  |.. .savefile$,".|
000005e0  22 2c 70 25 29 3e 30 0d  02 58 22 20 20 20 20 20  |",p%)>0..X"     |
000005f0  20 20 70 25 3d a7 73 61  76 65 66 69 6c 65 24 2c  |  p%=.savefile$,|
00000600  22 2e 22 2c 70 25 29 2b  31 0d 02 62 0a 20 20 20  |".",p%)+1..b.   |
00000610  20 20 ce 0d 02 6c 21 20  20 20 20 20 73 61 76 65  |  ...l!     save|
00000620  66 69 6c 65 24 3d c1 73  61 76 65 66 69 6c 65 24  |file$=.savefile$|
00000630  2c 70 25 29 0d 02 76 13  20 20 20 20 20 72 25 21  |,p%)..v.     r%!|
00000640  34 30 3d 26 46 44 34 0d  02 80 1e 20 20 20 20 20  |40=&FD4....     |
00000650  24 28 72 25 2b 34 34 29  3d 73 61 76 65 66 69 6c  |$(r%+44)=savefil|
00000660  65 24 2b bd 30 0d 02 8a  2c 20 20 20 20 20 21 72  |e$+.0...,     !r|
00000670  25 3d 28 28 28 28 34 35  2b a9 28 73 61 76 65 66  |%=((((45+.(savef|
00000680  69 6c 65 24 29 29 20 81  20 34 29 2b 31 29 2a 34  |ile$)) . 4)+1)*4|
00000690  29 0d 02 94 31 20 20 20  20 c8 99 20 22 57 69 6d  |)...1    .. "Wim|
000006a0  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 31  |p_SendMessage",1|
000006b0  38 2c 72 25 2c 71 32 25  21 31 32 2c 71 32 25 21  |8,r%,q2%!12,q2%!|
000006c0  31 36 0d 02 9e 20 20 20  20 20 c8 99 20 22 57 69  |16...     .. "Wi|
000006d0  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
000006e0  2d 31 0d 02 a8 0a 20 20  20 c9 20 38 0d 02 b2 2f  |-1....   . 8.../|
000006f0  20 20 20 20 e7 20 28 21  71 25 3d 73 61 76 65 25  |    . (!q%=save%|
00000700  29 20 80 20 28 71 25 21  34 3d 30 29 20 80 20 28  |) . (q%!4=0) . (|
00000710  71 25 21 32 34 3d 31 33  29 20 8c 0d 02 bc 22 20  |q%!24=13) ...." |
00000720  20 20 20 20 f2 73 61 76  65 28 a4 67 65 74 5f 73  |    .save(.get_s|
00000730  74 72 28 73 61 76 65 74  78 74 25 29 29 0d 02 c6  |tr(savetxt%))...|
00000740  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 43  |      .. "Wimp_C|
00000750  72 65 61 74 65 4d 65 6e  75 22 2c 2d 31 0d 02 d0  |reateMenu",-1...|
00000760  0f 20 20 20 20 20 f2 6d  65 6e 75 73 0d 02 da 09  |.     .menus....|
00000770  20 20 20 20 cc 0d 02 e4  23 20 20 20 20 20 c8 99  |    ....#     ..|
00000780  20 22 57 69 6d 70 5f 50  72 6f 63 65 73 73 4b 65  | "Wimp_ProcessKe|
00000790  79 22 2c 71 25 21 32 34  0d 02 ee 09 20 20 20 20  |y",q%!24....    |
000007a0  cd 0d 02 f8 0a 20 20 20  c9 20 39 0d 03 02 13 20  |.....   . 9.... |
000007b0  20 20 20 f2 68 61 6e 64  6c 65 6d 65 6e 75 0d 03  |   .handlemenu..|
000007c0  0c 0e 20 20 20 c9 20 31  37 2c 31 38 0d 03 16 12  |..   . 17,18....|
000007d0  20 20 20 20 c8 8e 20 71  25 21 31 36 20 ca 0d 03  |    .. q%!16 ...|
000007e0  20 0c 20 20 20 20 20 c9  20 30 0d 03 2a 0b 20 20  | .     . 0..*.  |
000007f0  20 20 20 20 e0 0d 03 34  0c 20 20 20 20 20 c9 20  |    ...4.     . |
00000800  32 0d 03 3e 42 20 20 20  20 20 20 24 28 73 61 76  |2..>B      $(sav|
00000810  65 74 78 74 25 29 3d a4  67 65 74 5f 73 74 72 28  |etxt%)=.get_str(|
00000820  71 25 2b 34 34 29 3a 21  73 61 76 65 6c 65 6e 25  |q%+44):!savelen%|
00000830  3d a9 28 a4 67 65 74 5f  73 74 72 28 71 25 2b 34  |=.(.get_str(q%+4|
00000840  34 29 29 0d 03 48 20 20  20 20 20 20 20 f2 73 61  |4))..H       .sa|
00000850  76 65 28 a4 67 65 74 5f  73 74 72 28 71 25 2b 34  |ve(.get_str(q%+4|
00000860  34 29 29 0d 03 52 14 20  20 20 20 20 20 71 25 21  |4))..R.      q%!|
00000870  31 32 3d 71 25 21 38 0d  03 5c 11 20 20 20 20 20  |12=q%!8..\.     |
00000880  20 71 25 21 31 36 3d 33  0d 03 66 2a 20 20 20 20  | q%!16=3..f*    |
00000890  20 20 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |  .. "Wimp_SendM|
000008a0  65 73 73 61 67 65 22 2c  31 38 2c 71 25 2c 71 25  |essage",18,q%,q%|
000008b0  21 34 0d 03 70 11 20 20  20 20 20 20 71 25 21 31  |!4..p.      q%!1|
000008c0  36 3d 32 0d 03 7a 0c 20  20 20 20 20 c9 20 33 0d  |6=2..z.     . 3.|
000008d0  03 84 24 20 20 20 20 20  20 e7 20 71 25 21 32 30  |..$      . q%!20|
000008e0  3d 2d 32 20 80 20 71 25  21 32 34 3d 69 63 6f 6e  |=-2 . q%!24=icon|
000008f0  25 20 8c 0d 03 8e 13 20  20 20 20 20 20 20 f2 63  |% .....       .c|
00000900  6f 6e 76 65 72 74 0d 03  98 22 20 20 20 20 20 20  |onvert..."      |
00000910  20 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  | .. "Wimp_Create|
00000920  4d 65 6e 75 22 2c 2d 31  0d 03 a2 12 20 20 20 20  |Menu",-1....    |
00000930  20 20 20 71 25 21 31 36  3d 33 0d 03 ac 0b 20 20  |   q%!16=3....  |
00000940  20 20 20 20 cd 0d 03 b6  09 20 20 20 20 cb 0d 03  |    .....    ...|
00000950  c0 0b 20 20 20 c9 20 31  39 0d 03 ca 12 20 20 20  |..   . 19....   |
00000960  20 c8 8e 20 71 25 21 31  36 20 ca 0d 03 d4 0c 20  | .. q%!16 ..... |
00000970  20 20 20 20 c9 20 31 0d  03 de 37 20 20 20 20 20  |    . 1...7     |
00000980  20 f2 65 72 72 6f 72 28  22 44 72 61 67 20 49 63  | .error("Drag Ic|
00000990  6f 6e 20 74 6f 20 61 20  46 69 6c 65 72 20 57 69  |on to a Filer Wi|
000009a0  6e 64 6f 77 20 74 6f 20  53 61 76 65 22 29 0d 03  |ndow to Save")..|
000009b0  e8 0c 20 20 20 20 20 c9  20 33 0d 03 f2 3c 20 20  |..     . 3...<  |
000009c0  20 20 20 20 f2 65 72 72  6f 72 28 22 57 61 72 6e  |    .error("Warn|
000009d0  69 6e 67 20 2d 20 44 61  74 61 20 4d 61 79 20 62  |ing - Data May b|
000009e0  65 20 53 61 76 65 64 20  49 6e 63 6f 72 72 65 63  |e Saved Incorrec|
000009f0  74 6c 79 21 22 29 0d 03  fc 09 20 20 20 20 cb 0d  |tly!")....    ..|
00000a00  04 06 07 20 20 cb 0d 04  10 08 20 fd 20 a3 0d 04  |...  ..... . ...|
00000a10  1a 05 3a 0d 04 24 0b dd  f2 63 6c 65 61 72 0d 04  |..:..$...clear..|
00000a20  2e 28 66 69 6c 65 24 3d  22 22 3a 70 61 67 65 73  |.(file$="":pages|
00000a30  3d 30 3a 6d 69 64 69 74  6f 70 25 3d 73 70 61 63  |=0:miditop%=spac|
00000a40  65 2b 26 31 30 34 0d 04  38 22 6c 65 6e 57 3d 73  |e+&104..8"lenW=s|
00000a50  70 61 63 65 2b 26 45 31  3a 73 74 61 72 74 3d 73  |pace+&E1:start=s|
00000a60  70 61 63 65 2b 26 45 35  0d 04 42 05 e1 0d 04 4c  |pace+&E5..B....L|
00000a70  05 3a 0d 04 56 11 dd f2  73 61 76 65 28 66 69 6c  |.:..V...save(fil|
00000a80  65 24 29 0d 04 60 08 ea  20 66 25 0d 04 6a 07 ea  |e$)..`.. f%..j..|
00000a90  20 85 0d 04 74 1c ee 20  85 20 ea 20 f7 20 85 3a  | ...t.. . . . .:|
00000aa0  f2 66 61 75 6c 74 28 9f  2c f6 24 29 3a e1 0d 04  |.fault(.,.$):...|
00000ab0  7e 2d ff 22 53 41 56 45  20 22 2b 66 69 6c 65 24  |~-."SAVE "+file$|
00000ac0  2b 22 20 22 2b c3 7e 73  70 61 63 65 2b 22 20 22  |+" "+.~space+" "|
00000ad0  2b c3 7e 6d 69 64 69 74  6f 70 25 0d 04 88 1c ff  |+.~miditop%.....|
00000ae0  22 53 45 54 54 59 50 45  20 22 2b 66 69 6c 65 24  |"SETTYPE "+file$|
00000af0  2b 22 20 46 44 34 22 0d  04 92 07 f7 20 85 0d 04  |+" FD4"..... ...|
00000b00  9c 05 e1 0d 04 a6 05 3a  0d 04 b0 0f dd f2 65 72  |.......:......er|
00000b10  72 6f 72 28 65 24 29 0d  04 ba 09 21 65 25 3d 30  |ror(e$)....!e%=0|
00000b20  0d 04 c4 11 24 28 65 25  2b 34 29 3d 65 24 2b bd  |....$(e%+4)=e$+.|
00000b30  30 0d 04 ce 2b c8 99 20  22 57 69 6d 70 5f 52 65  |0...+.. "Wimp_Re|
00000b40  70 6f 72 74 45 72 72 6f  72 22 2c 65 25 2c 30 2c  |portError",e%,0,|
00000b50  22 4d 49 44 49 20 4d 61  6b 65 72 22 0d 04 d8 05  |"MIDI Maker"....|
00000b60  e1 0d 04 e2 05 3a 0d 04  ec 11 dd a4 63 6f 6e 66  |.....:......conf|
00000b70  69 72 6d 28 6d 24 29 0d  04 f6 08 ea 20 72 25 0d  |irm(m$)..... r%.|
00000b80  05 00 09 21 65 25 3d 30  0d 05 0a 11 24 28 65 25  |...!e%=0....$(e%|
00000b90  2b 34 29 3d 6d 24 2b bd  30 0d 05 14 33 c8 99 20  |+4)=m$+.0...3.. |
00000ba0  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
00000bb0  72 22 2c 65 25 2c 26 31  33 2c 22 4d 49 44 49 20  |r",e%,&13,"MIDI |
00000bc0  4d 61 6b 65 72 22 20 b8  20 2c 72 25 0d 05 1e 07  |Maker" . ,r%....|
00000bd0  3d 72 25 0d 05 28 05 3a  0d 05 32 16 dd f2 66 61  |=r%..(.:..2...fa|
00000be0  75 6c 74 28 65 72 72 25  2c 65 72 72 24 29 0d 05  |ult(err%,err$)..|
00000bf0  3c 0c 21 65 25 3d 65 72  72 25 0d 05 46 13 24 28  |<.!e%=err%..F.$(|
00000c00  65 25 2b 34 29 3d 65 72  72 24 2b bd 30 0d 05 50  |e%+4)=err$+.0..P|
00000c10  29 e7 65 72 72 25 3d 32  32 30 20 8c 20 24 28 65  |).err%=220 . $(e|
00000c20  25 2b 34 29 3d 22 42 61  64 20 66 69 6c 65 6e 61  |%+4)="Bad filena|
00000c30  6d 65 22 2b bd 30 0d 05  5a 2b c8 99 20 22 57 69  |me"+.0..Z+.. "Wi|
00000c40  6d 70 5f 52 65 70 6f 72  74 45 72 72 6f 72 22 2c  |mp_ReportError",|
00000c50  65 25 2c 30 2c 22 4d 49  44 49 20 4d 61 6b 65 72  |e%,0,"MIDI Maker|
00000c60  22 0d 05 64 05 e1 0d 05  6e 05 3a 0d 05 78 0d dd  |"..d....n.:..x..|
00000c70  f2 63 6f 6e 76 65 72 74  0d 05 82 19 66 69 6c 65  |.convert....file|
00000c80  24 3d a4 67 65 74 5f 73  74 72 28 71 25 2b 34 34  |$=.get_str(q%+44|
00000c90  29 0d 05 8c 0f 74 79 70  65 25 3d 71 25 21 34 30  |)....type%=q%!40|
00000ca0  0d 05 96 13 e7 20 74 79  70 65 25 3c 3e 26 41 46  |..... type%<>&AF|
00000cb0  31 20 8c 0d 05 a0 59 20  21 74 78 74 25 3d 30 3a  |1 ....Y !txt%=0:|
00000cc0  24 28 74 78 74 25 2b 34  29 3d 22 50 6c 65 61 73  |$(txt%+4)="Pleas|
00000cd0  65 20 63 6f 6e 76 65 72  74 20 74 6f 20 61 20 4d  |e convert to a M|
00000ce0  61 65 73 74 72 6f 20 66  69 6c 65 20 62 65 66 6f  |aestro file befo|
00000cf0  72 65 20 61 74 74 65 6d  70 74 69 6e 67 20 63 6f  |re attempting co|
00000d00  6e 76 65 72 73 69 6f 6e  22 2b bd 30 0d 05 aa 2e  |nversion"+.0....|
00000d10  20 c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  | .. "Wimp_Report|
00000d20  45 72 72 6f 72 22 2c 74  78 74 25 2c 30 2c 22 4d  |Error",txt%,0,"M|
00000d30  49 44 49 20 4d 61 6b 65  72 22 0d 05 b4 05 cc 0d  |IDI Maker"......|
00000d40  05 be 11 20 f2 64 6f 69  74 28 66 69 6c 65 24 29  |... .doit(file$)|
00000d50  0d 05 c8 12 20 70 61 67  65 73 3d 70 61 67 65 73  |.... pages=pages|
00000d60  2b 31 0d 05 d2 14 20 f2  69 63 6f 6e 28 b9 29 3a  |+1.... .icon(.):|
00000d70  f2 6d 65 6e 75 73 0d 05  dc 05 cd 0d 05 e6 05 e1  |.menus..........|
00000d80  0d 05 f0 05 3a 0d 05 fa  11 dd a4 67 65 74 5f 73  |....:......get_s|
00000d90  74 72 28 71 25 29 0d 06  04 0c ea 20 66 6e 24 2c  |tr(q%)..... fn$,|
00000da0  70 25 0d 06 0e 0f 70 25  3d 30 3a 66 6e 24 3d 22  |p%....p%=0:fn$="|
00000db0  22 0d 06 18 05 f5 0d 06  22 15 20 66 6e 24 3d 66  |".......". fn$=f|
00000dc0  6e 24 2b bd 28 71 25 3f  70 25 29 0d 06 2c 0c 20  |n$+.(q%?p%)..,. |
00000dd0  70 25 3d 70 25 2b 31 0d  06 36 10 fd 20 28 71 25  |p%=p%+1..6.. (q%|
00000de0  3f 70 25 29 3c 33 32 0d  06 40 08 3d 66 6e 24 0d  |?p%)<32..@.=fn$.|
00000df0  06 4a 05 3a 0d 06 54 0b  dd f2 6d 65 6e 75 73 0d  |.J.:..T...menus.|
00000e00  06 5e 0d 20 f2 69 6e 66  6f 62 6f 78 0d 06 68 0d  |.^. .infobox..h.|
00000e10  20 f2 73 61 76 65 62 6f  78 0d 06 72 0e 20 f2 6d  | .savebox..r. .m|
00000e20  61 69 6e 6d 65 6e 75 0d  06 7c 05 e1 0d 06 86 05  |ainmenu..|......|
00000e30  3a 0d 06 90 0d dd f2 73  61 76 65 62 6f 78 0d 06  |:......savebox..|
00000e40  9a 0f 20 6d 25 3d 6d 65  6e 75 73 70 25 0d 06 a4  |.. m%=menusp%...|
00000e50  14 20 6d 25 21 32 38 3d  26 38 34 30 30 30 30 31  |. m%!28=&8400001|
00000e60  32 0d 06 ae 14 20 6d 25  21 33 32 3d 26 30 31 30  |2.... m%!32=&010|
00000e70  37 30 32 30 37 0d 06 b8  14 20 6d 25 21 33 36 3d  |70207.... m%!36=|
00000e80  26 30 30 30 43 30 31 30  33 0d 06 c2 14 20 6d 25  |&000C0103.... m%|
00000e90  21 34 30 3d 30 3a 6d 25  21 34 34 3d 30 0d 06 cc  |!40=0:m%!44=0...|
00000ea0  18 20 6d 25 21 34 38 3d  32 35 30 3a 6d 25 21 35  |. m%!48=250:m%!5|
00000eb0  32 3d 31 36 30 0d 06 d6  14 20 6d 25 21 35 36 3d  |2=160.... m%!56=|
00000ec0  26 30 30 30 30 30 30 31  39 0d 06 e0 14 20 6d 25  |&00000019.... m%|
00000ed0  21 36 30 3d 26 30 30 30  30 30 30 30 30 0d 06 ea  |!60=&00000000...|
00000ee0  20 20 6d 25 21 36 34 3d  31 3a 6d 25 21 36 38 3d  |  m%!64=1:m%!68=|
00000ef0  32 35 30 3a 6d 25 21 37  30 3d 31 36 30 0d 06 f4  |250:m%!70=160...|
00000f00  1b 20 24 28 6d 25 2b 37  32 29 3d 22 53 61 76 65  |. $(m%+72)="Save|
00000f10  20 61 73 3a 22 2b bd 30  0d 06 fe 0c 20 6d 25 21  | as:"+.0.... m%!|
00000f20  38 34 3d 33 0d 07 08 16  20 6d 25 21 38 38 3d 31  |84=3.... m%!88=1|
00000f30  35 3a 6d 25 21 39 32 3d  31 30 0d 07 12 18 20 6d  |5:m%!92=10.... m|
00000f40  25 21 39 36 3d 31 38 35  3a 6d 25 21 31 30 30 3d  |%!96=185:m%!100=|
00000f50  35 35 0d 07 1c 15 20 6d  25 21 31 30 34 3d 26 30  |55.... m%!104=&0|
00000f60  37 30 30 46 31 33 44 0d  07 26 12 20 6d 25 21 31  |700F13D..&. m%!1|
00000f70  30 38 3d 6d 25 2b 32 35  30 0d 07 30 12 20 6d 25  |08=m%+250..0. m%|
00000f80  21 31 31 32 3d 6d 25 2b  31 39 32 0d 07 3a 0f 20  |!112=m%+192..:. |
00000f90  6d 25 21 31 31 36 3d 31  30 30 0d 07 44 18 20 6d  |m%!116=100..D. m|
00000fa0  25 21 31 32 30 3d 38 30  3a 6d 25 21 31 32 34 3d  |%!120=80:m%!124=|
00000fb0  38 30 0d 07 4e 1a 20 6d  25 21 31 32 38 3d 31 34  |80..N. m%!128=14|
00000fc0  35 3a 6d 25 21 31 33 32  3d 31 34 35 0d 07 58 15  |5:m%!132=145..X.|
00000fd0  20 6d 25 21 31 33 36 3d  26 30 37 30 30 36 31 31  | m%!136=&0700611|
00000fe0  41 0d 07 62 12 20 6d 25  21 31 34 30 3d 6d 25 2b  |A..b. m%!140=m%+|
00000ff0  32 30 30 0d 07 6c 0d 20  6d 25 21 31 34 34 3d 31  |200..l. m%!144=1|
00001000  0d 07 76 0d 20 6d 25 21  31 34 38 3d 31 0d 07 80  |..v. m%!148=1...|
00001010  19 20 6d 25 21 31 35 32  3d 31 39 35 3a 6d 25 21  |. m%!152=195:m%!|
00001020  31 35 36 3d 31 30 0d 07  8a 19 20 6d 25 21 31 36  |156=10.... m%!16|
00001030  30 3d 32 34 30 3a 6d 25  21 31 36 34 3d 35 35 0d  |0=240:m%!164=55.|
00001040  07 94 15 20 6d 25 21 31  36 38 3d 26 43 37 30 31  |... m%!168=&C701|
00001050  39 30 33 44 0d 07 9e 16  20 24 28 6d 25 2b 31 37  |903D.... $(m%+17|
00001060  32 29 3d 22 4f 4b 22 2b  bd 30 0d 07 a8 19 20 24  |2)="OK"+.0.... $|
00001070  28 6d 25 2b 32 30 30 29  3d 22 66 69 6c 65 5f 66  |(m%+200)="file_f|
00001080  64 34 22 0d 07 b2 24 20  24 28 6d 25 2b 32 35 30  |d4"...$ $(m%+250|
00001090  29 3d 66 69 6c 65 24 3a  73 61 76 65 74 78 74 25  |)=file$:savetxt%|
000010a0  3d 6d 25 2b 32 35 30 0d  07 bc 20 20 21 28 6d 25  |=m%+250...  !(m%|
000010b0  2b 31 34 38 29 3d 38 3a  73 61 76 65 6c 65 6e 25  |+148)=8:savelen%|
000010c0  3d 6d 25 2b 31 34 38 0d  07 c6 0d 20 6d 25 21 31  |=m%+148.... m%!1|
000010d0  39 32 3d 30 0d 07 d0 27  20 c8 99 20 22 57 69 6d  |92=0...' .. "Wim|
000010e0  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
000010f0  2c 6d 25 20 b8 20 73 61  76 65 25 0d 07 da 05 e1  |,m% . save%.....|
00001100  0d 07 e4 05 3a 0d 07 ee  0e dd f2 6d 61 69 6e 6d  |....:......mainm|
00001110  65 6e 75 0d 07 f8 20 20  70 25 3d 6d 65 6e 75 73  |enu...  p%=menus|
00001120  70 25 2b 35 31 32 3a 6d  61 69 6e 6d 65 6e 75 25  |p%+512:mainmenu%|
00001130  3d 70 25 0d 08 02 2f 20  24 70 25 3d 22 4d 49 44  |=p%.../ $p%="MID|
00001140  49 20 4d 61 6b 65 72 22  2b bd 30 3a 70 25 21 31  |I Maker"+.0:p%!1|
00001150  32 3d 26 37 30 32 30 37  3a 70 25 21 31 36 3d 32  |2=&70207:p%!16=2|
00001160  30 30 0d 08 0c 1e 20 70  25 21 32 30 3d 34 30 3a  |00.... p%!20=40:|
00001170  70 25 21 32 34 3d 30 3a  66 25 3d 70 25 2b 32 38  |p%!24=0:f%=p%+28|
00001180  0d 08 16 3e 20 21 66 25  3d 30 3a 66 25 21 34 3d  |...> !f%=0:f%!4=|
00001190  69 6e 66 6f 25 3a 66 25  21 38 3d 26 30 37 30 30  |info%:f%!8=&0700|
000011a0  30 30 31 31 3a 24 28 66  25 2b 31 32 29 3d 22 49  |0011:$(f%+12)="I|
000011b0  6e 66 6f 22 2b bd 30 3a  66 25 2b 3d 32 34 0d 08  |nfo"+.0:f%+=24..|
000011c0  20 31 20 e7 70 61 67 65  73 3d 30 8c 66 25 21 38  | 1 .pages=0.f%!8|
000011d0  3d 32 5e 32 32 2b 26 30  37 30 30 30 30 31 31 20  |=2^22+&07000011 |
000011e0  8b 66 25 21 38 3d 26 30  37 30 30 30 30 31 31 0d  |.f%!8=&07000011.|
000011f0  08 2a 34 20 21 66 25 3d  30 3a 66 25 21 34 3d 73  |.*4 !f%=0:f%!4=s|
00001200  61 76 65 25 3a 24 28 66  25 2b 31 32 29 3d 22 4d  |ave%:$(f%+12)="M|
00001210  61 6b 65 20 4d 49 44 49  22 2b bd 30 3a 66 25 2b  |ake MIDI"+.0:f%+|
00001220  3d 32 34 0d 08 34 31 20  e7 70 61 67 65 73 3d 30  |=24..41 .pages=0|
00001230  8c 66 25 21 38 3d 32 5e  32 32 2b 26 30 37 30 30  |.f%!8=2^22+&0700|
00001240  30 30 31 31 20 8b 66 25  21 38 3d 26 30 37 30 30  |0011 .f%!8=&0700|
00001250  33 30 31 31 0d 08 3e 2d  20 21 66 25 3d 30 3a 66  |3011..>- !f%=0:f|
00001260  25 21 34 3d 2d 31 3a 24  28 66 25 2b 31 32 29 3d  |%!4=-1:$(f%+12)=|
00001270  22 43 6c 65 61 72 22 2b  bd 30 3a 66 25 2b 3d 32  |"Clear"+.0:f%+=2|
00001280  34 0d 08 48 3d 20 21 66  25 3d 26 38 30 3a 66 25  |4..H= !f%=&80:f%|
00001290  21 34 3d 2d 31 3a 66 25  21 38 3d 26 30 37 30 30  |!4=-1:f%!8=&0700|
000012a0  33 30 31 31 3a 24 28 66  25 2b 31 32 29 3d 22 51  |3011:$(f%+12)="Q|
000012b0  75 69 74 22 2b bd 30 3a  66 25 2b 3d 32 34 0d 08  |uit"+.0:f%+=24..|
000012c0  52 05 e1 0d 08 5c 05 3a  0d 08 66 10 dd f2 68 61  |R....\.:..f...ha|
000012d0  6e 64 6c 65 6d 65 6e 75  0d 08 70 0c 20 ea 20 61  |ndlemenu..p. . a|
000012e0  25 2c 6c 25 0d 08 7a 0d  20 c8 8e 20 21 71 25 20  |%,l%..z. .. !q% |
000012f0  ca 0d 08 84 0a 20 20 20  c9 20 32 0d 08 8e 3c 20  |.....   . 2...< |
00001300  20 20 20 61 25 3d a4 63  6f 6e 66 69 72 6d 28 22  |   a%=.confirm("|
00001310  57 69 70 65 20 70 72 6f  63 65 73 73 65 64 20 6d  |Wipe processed m|
00001320  75 73 69 63 2e 2e 2e 20  41 72 65 20 79 6f 75 20  |usic... Are you |
00001330  73 75 72 65 3f 22 29 0d  08 98 27 20 20 20 20 e7  |sure?")...'    .|
00001340  20 61 25 3d 31 20 8c 20  f2 63 6c 65 61 72 3a f2  | a%=1 . .clear:.|
00001350  69 63 6f 6e 28 b9 29 3a  f2 6d 65 6e 75 73 0d 08  |icon(.):.menus..|
00001360  a2 0a 20 20 20 c9 20 33  0d 08 ac 08 20 20 20 e0  |..   . 3....   .|
00001370  0d 08 b6 06 20 cb 0d 08  c0 21 20 c8 99 20 22 57  |.... ....! .. "W|
00001380  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00001390  66 6f 22 2c 2c 71 25 0d  08 ca 22 20 e7 20 28 28  |fo",,q%..." . ((|
000013a0  71 25 21 38 29 20 80 20  31 29 3d 31 20 8c 20 f2  |q%!8) . 1)=1 . .|
000013b0  6f 70 65 6e 5f 6d 65 6e  75 0d 08 d4 05 e1 0d 08  |open_menu.......|
000013c0  de 05 3a 0d 08 e8 0d dd  f2 69 6e 66 6f 62 6f 78  |..:......infobox|
000013d0  0d 08 f2 0b ea 20 73 25  2c 69 25 0d 08 fc 0e 73  |..... s%,i%....s|
000013e0  25 3d 69 6e 66 6f 73 70  25 0d 09 06 13 73 25 21  |%=infosp%....s%!|
000013f0  32 38 3d 26 38 34 30 30  30 30 31 32 0d 09 10 12  |28=&84000012....|
00001400  73 25 21 33 32 3d 26 31  30 37 30 32 30 37 0d 09  |s%!32=&1070207..|
00001410  1a 10 73 25 21 33 36 3d  26 32 30 31 30 33 0d 09  |..s%!36=&20103..|
00001420  24 14 73 25 21 34 30 3d  32 30 3a 73 25 21 34 34  |$.s%!40=20:s%!44|
00001430  3d 30 0d 09 2e 17 73 25  21 34 38 3d 36 33 36 3a  |=0....s%!48=636:|
00001440  73 25 21 35 32 3d 32 31  36 0d 09 38 13 73 25 21  |s%!52=216..8.s%!|
00001450  35 36 3d 26 30 30 30 30  30 31 31 39 0d 09 42 13  |56=&00000119..B.|
00001460  73 25 21 36 30 3d 26 30  30 30 30 30 30 30 30 0d  |s%!60=&00000000.|
00001470  09 4c 0b 73 25 21 36 34  3d 31 0d 09 56 0d 73 25  |.L.s%!64=1..V.s%|
00001480  21 36 38 3d 36 31 36 0d  09 60 0d 73 25 21 37 30  |!68=616..`.s%!70|
00001490  3d 32 31 36 0d 09 6a 10  73 25 21 37 32 3d 73 25  |=216..j.s%!72=s%|
000014a0  2b 35 32 38 0d 09 74 10  73 25 21 37 36 3d 73 25  |+528..t.s%!76=s%|
000014b0  2b 33 39 30 0d 09 7e 0c  73 25 21 38 30 3d 33 32  |+390..~.s%!80=32|
000014c0  0d 09 88 0b 73 25 21 38  34 3d 38 0d 09 92 0c 69  |....s%!84=8....i|
000014d0  25 3d 73 25 2b 38 38 0d  09 9c 11 21 69 25 3d 33  |%=s%+88....!i%=3|
000014e0  32 3a 69 25 21 34 3d 38  0d 09 a6 15 69 25 21 38  |2:i%!4=8....i%!8|
000014f0  3d 31 38 34 3a 69 25 21  31 32 3d 35 36 0d 09 b0  |=184:i%!12=56...|
00001500  13 69 25 21 31 36 3d 26  30 37 30 30 30 32 31 31  |.i%!16=&07000211|
00001510  0d 09 ba 1a 24 28 69 25  2b 32 30 29 3d 22 56 65  |....$(i%+20)="Ve|
00001520  72 73 69 6f 6e 3a 22 2b  bd 30 0d 09 c4 0a 69 25  |rsion:"+.0....i%|
00001530  2b 3d 33 32 0d 09 ce 12  21 69 25 3d 31 38 38 3a  |+=32....!i%=188:|
00001540  69 25 21 34 3d 38 0d 09  d8 15 69 25 21 38 3d 36  |i%!4=8....i%!8=6|
00001550  33 32 3a 69 25 21 31 32  3d 35 36 0d 09 e2 13 69  |32:i%!12=56....i|
00001560  25 21 31 36 3d 26 30 37  30 30 30 31 33 44 0d 09  |%!16=&0700013D..|
00001570  ec 10 69 25 21 32 30 3d  73 25 2b 34 30 30 0d 09  |..i%!20=s%+400..|
00001580  f6 10 69 25 21 32 34 3d  73 25 2b 33 39 30 0d 0a  |..i%!24=s%+390..|
00001590  00 0c 69 25 21 32 38 3d  33 30 0d 0a 0a 0a 69 25  |..i%!28=30....i%|
000015a0  2b 3d 33 32 0d 0a 14 12  21 69 25 3d 33 32 3a 69  |+=32....!i%=32:i|
000015b0  25 21 34 3d 36 30 0d 0a  1e 16 69 25 21 38 3d 31  |%!4=60....i%!8=1|
000015c0  38 34 3a 69 25 21 31 32  3d 31 30 38 0d 0a 28 13  |84:i%!12=108..(.|
000015d0  69 25 21 31 36 3d 26 30  37 30 30 30 32 31 31 0d  |i%!16=&07000211.|
000015e0  0a 32 19 24 28 69 25 2b  32 30 29 3d 22 41 75 74  |.2.$(i%+20)="Aut|
000015f0  68 6f 72 3a 22 2b bd 30  0d 0a 3c 0a 69 25 2b 3d  |hor:"+.0..<.i%+=|
00001600  33 32 0d 0a 46 13 21 69  25 3d 31 38 38 3a 69 25  |32..F.!i%=188:i%|
00001610  21 34 3d 36 30 0d 0a 50  16 69 25 21 38 3d 36 33  |!4=60..P.i%!8=63|
00001620  32 3a 69 25 21 31 32 3d  31 30 38 0d 0a 5a 13 69  |2:i%!12=108..Z.i|
00001630  25 21 31 36 3d 26 30 37  30 30 30 31 33 44 0d 0a  |%!16=&0700013D..|
00001640  64 10 69 25 21 32 30 3d  73 25 2b 34 33 32 0d 0a  |d.i%!20=s%+432..|
00001650  6e 10 69 25 21 32 34 3d  73 25 2b 33 39 30 0d 0a  |n.i%!24=s%+390..|
00001660  78 0c 69 25 21 32 38 3d  33 30 0d 0a 82 0a 69 25  |x.i%!28=30....i%|
00001670  2b 3d 33 32 0d 0a 8c 13  21 69 25 3d 33 32 3a 69  |+=32....!i%=32:i|
00001680  25 21 34 3d 31 31 32 0d  0a 96 16 69 25 21 38 3d  |%!4=112....i%!8=|
00001690  31 38 34 3a 69 25 21 31  32 3d 31 36 30 0d 0a a0  |184:i%!12=160...|
000016a0  13 69 25 21 31 36 3d 26  30 37 30 30 30 32 31 31  |.i%!16=&07000211|
000016b0  0d 0a aa 1a 24 28 69 25  2b 32 30 29 3d 22 50 75  |....$(i%+20)="Pu|
000016c0  72 70 6f 73 65 3a 22 2b  bd 30 0d 0a b4 0a 69 25  |rpose:"+.0....i%|
000016d0  2b 3d 33 32 0d 0a be 14  21 69 25 3d 31 38 38 3a  |+=32....!i%=188:|
000016e0  69 25 21 34 3d 31 31 32  0d 0a c8 16 69 25 21 38  |i%!4=112....i%!8|
000016f0  3d 36 33 32 3a 69 25 21  31 32 3d 31 36 30 0d 0a  |=632:i%!12=160..|
00001700  d2 13 69 25 21 31 36 3d  26 30 37 30 30 30 31 33  |..i%!16=&0700013|
00001710  44 0d 0a dc 10 69 25 21  32 30 3d 73 25 2b 34 36  |D....i%!20=s%+46|
00001720  34 0d 0a e6 10 69 25 21  32 34 3d 73 25 2b 33 39  |4....i%!24=s%+39|
00001730  30 0d 0a f0 0c 69 25 21  32 38 3d 33 30 0d 0a fa  |0....i%!28=30...|
00001740  0a 69 25 2b 3d 33 32 0d  0b 04 13 21 69 25 3d 33  |.i%+=32....!i%=3|
00001750  32 3a 69 25 21 34 3d 31  36 34 0d 0b 0e 16 69 25  |2:i%!4=164....i%|
00001760  21 38 3d 31 38 34 3a 69  25 21 31 32 3d 32 31 32  |!8=184:i%!12=212|
00001770  0d 0b 18 13 69 25 21 31  36 3d 26 30 37 30 30 30  |....i%!16=&07000|
00001780  32 31 31 0d 0b 22 17 24  28 69 25 2b 32 30 29 3d  |211..".$(i%+20)=|
00001790  22 4e 61 6d 65 3a 22 2b  bd 30 0d 0b 2c 0a 69 25  |"Name:"+.0..,.i%|
000017a0  2b 3d 33 32 0d 0b 36 14  21 69 25 3d 31 38 38 3a  |+=32..6.!i%=188:|
000017b0  69 25 21 34 3d 31 36 34  0d 0b 40 16 69 25 21 38  |i%!4=164..@.i%!8|
000017c0  3d 36 33 32 3a 69 25 21  31 32 3d 32 31 32 0d 0b  |=632:i%!12=212..|
000017d0  4a 13 69 25 21 31 36 3d  26 30 37 30 30 30 31 33  |J.i%!16=&0700013|
000017e0  44 0d 0b 54 10 69 25 21  32 30 3d 73 25 2b 34 39  |D..T.i%!20=s%+49|
000017f0  36 0d 0b 5e 10 69 25 21  32 34 3d 73 25 2b 33 39  |6..^.i%!24=s%+39|
00001800  30 0d 0b 68 0c 69 25 21  32 38 3d 33 30 0d 0b 72  |0..h.i%!28=30..r|
00001810  0c 73 25 21 33 39 30 3d  30 0d 0b 7c 22 24 28 73  |.s%!390=0..|"$(s|
00001820  25 2b 34 30 30 29 3d 22  31 2e 30 30 20 28 38 2d  |%+400)="1.00 (8-|
00001830  41 75 67 2d 39 39 29 22  2b bd 30 0d 0b 86 27 24  |Aug-99)"+.0...'$|
00001840  28 73 25 2b 34 33 32 29  3d 22 a9 20 44 6f 6d 69  |(s%+432)=". Domi|
00001850  6e 69 63 20 46 6f 72 64  2c 20 31 39 39 39 22 2b  |nic Ford, 1999"+|
00001860  bd 30 0d 0b 90 22 24 28  73 25 2b 34 36 34 29 3d  |.0..."$(s%+464)=|
00001870  22 4d 61 65 73 74 72 6f  20 74 6f 20 4d 49 44 49  |"Maestro to MIDI|
00001880  22 2b bd 30 0d 0b 9a 1d  24 28 73 25 2b 34 39 36  |"+.0....$(s%+496|
00001890  29 3d 22 4d 49 44 49 20  4d 61 6b 65 72 22 2b bd  |)="MIDI Maker"+.|
000018a0  30 0d 0b a4 25 24 28 73  25 2b 35 32 38 29 3d 22  |0...%$(s%+528)="|
000018b0  41 62 6f 75 74 20 74 68  69 73 20 70 72 6f 67 72  |About this progr|
000018c0  61 6d 22 2b bd 30 0d 0b  ae 26 c8 99 20 22 57 69  |am"+.0...&.. "Wi|
000018d0  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
000018e0  2c 2c 73 25 20 b8 20 69  6e 66 6f 25 0d 0b b8 05  |,,s% . info%....|
000018f0  e1 0d 0b c2 05 3a 0d 0b  cc 0f dd f2 6f 70 65 6e  |.....:......open|
00001900  5f 6d 65 6e 75 0d 0b d6  31 20 c8 99 20 22 57 69  |_menu...1 .. "Wi|
00001910  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
00001920  6d 61 69 6e 6d 65 6e 75  25 2c 28 21 71 25 29 2d  |mainmenu%,(!q%)-|
00001930  36 34 2c 31 36 30 0d 0b  e0 05 e1 0d 0b ea 05 3a  |64,160.........:|
00001940  0d 0b f4 12 dd f2 69 63  6f 6e 28 72 65 64 72 61  |......icon(redra|
00001950  77 29 0d 0b fe 0f 73 70  25 3d 69 63 6f 6e 73 70  |w)....sp%=iconsp|
00001960  25 0d 0c 08 0e e7 20 72  65 64 72 61 77 20 8c 0d  |%..... redraw ..|
00001970  0c 12 18 20 21 73 70 25  3d 2d 31 3a 73 70 25 21  |... !sp%=-1:sp%!|
00001980  34 3d 69 63 6f 6e 25 0d  0c 1c 1e 20 c8 99 20 22  |4=icon%.... .. "|
00001990  57 69 6d 70 5f 44 65 6c  65 74 65 49 63 6f 6e 22  |Wimp_DeleteIcon"|
000019a0  2c 2c 73 70 25 0d 0c 26  05 cd 0d 0c 30 0b 21 73  |,,sp%..&....0.!s|
000019b0  70 25 3d 2d 31 0d 0c 3a  0b 73 70 25 21 34 3d 30  |p%=-1..:.sp%!4=0|
000019c0  0d 0c 44 0d 73 70 25 21  38 3d 2d 31 36 0d 0c 4e  |..D.sp%!8=-16..N|
000019d0  18 73 70 25 21 31 32 3d  31 32 38 3a 73 70 25 21  |.sp%!12=128:sp%!|
000019e0  31 36 3d 38 34 0d 0c 58  14 73 70 25 21 32 30 3d  |16=84..X.sp%!20=|
000019f0  26 31 37 30 30 33 31 30  42 0d 0c 62 11 73 70 25  |&1700310B..b.sp%|
00001a00  21 32 34 3d 73 70 25 2b  34 30 0d 0c 6c 11 73 70  |!24=sp%+40..l.sp|
00001a10  25 21 32 38 3d 73 70 25  2b 38 30 0d 0c 76 0d 73  |%!28=sp%+80..v.s|
00001a20  70 25 21 33 32 3d 33 32  0d 0c 80 23 e7 20 70 61  |p%!32=32...#. pa|
00001a30  67 65 73 3d 30 20 8c 20  24 28 73 70 25 2b 34 30  |ges=0 . $(sp%+40|
00001a40  29 3d 22 49 64 6c 65 22  2b bd 30 0d 0c 8a 25 e7  |)="Idle"+.0...%.|
00001a50  20 70 61 67 65 73 3d 31  20 8c 20 24 28 73 70 25  | pages=1 . $(sp%|
00001a60  2b 34 30 29 3d 22 31 20  70 61 67 65 22 2b bd 30  |+40)="1 page"+.0|
00001a70  0d 0c 94 2c e7 20 70 61  67 65 73 3e 31 20 8c 20  |...,. pages>1 . |
00001a80  24 28 73 70 25 2b 34 30  29 3d c3 70 61 67 65 73  |$(sp%+40)=.pages|
00001a90  2b 22 20 70 61 67 65 73  22 2b bd 30 0d 0c 9e 1d  |+" pages"+.0....|
00001aa0  24 28 73 70 25 2b 38 30  29 3d 22 53 21 6d 61 6b  |$(sp%+80)="S!mak|
00001ab0  65 6d 69 64 69 22 2b bd  30 0d 0c a8 25 c8 99 20  |emidi"+.0...%.. |
00001ac0  22 57 69 6d 70 5f 43 72  65 61 74 65 49 63 6f 6e  |"Wimp_CreateIcon|
00001ad0  22 2c 2c 73 70 25 20 b8  20 69 63 6f 6e 25 0d 0c  |",,sp% . icon%..|
00001ae0  b2 05 e1 0d 0c bc 05 3a  0d 0c c6 17 f4 20 43 4f  |.......:..... CO|
00001af0  4e 56 45 52 53 49 4f 4e  20 45 4e 47 49 4e 45 0d  |NVERSION ENGINE.|
00001b00  0c d0 05 3a 0d 0c da 15  dd f2 64 6f 69 74 28 66  |...:......doit(f|
00001b10  69 6c 65 6e 61 6d 65 24  29 0d 0c e4 14 c8 99 22  |ilename$)......"|
00001b20  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 0c ee  |Hourglass_On"...|
00001b30  0e f2 6c 6f 61 64 6d 75  73 69 63 0d 0c f8 11 f2  |..loadmusic.....|
00001b40  64 6f 63 6f 6e 76 65 72  73 69 6f 6e 0d 0d 02 15  |doconversion....|
00001b50  c8 99 22 48 6f 75 72 67  6c 61 73 73 5f 4f 66 66  |.."Hourglass_Off|
00001b60  22 0d 0d 0c 05 e1 0d 0d  16 05 3a 0d 0d 20 12 dd  |".........:.. ..|
00001b70  f2 73 65 74 75 70 63 6f  6e 76 65 72 74 0d 0d 2a  |.setupconvert..*|
00001b80  0d de 20 53 20 26 39 30  30 30 0d 0d 34 50 de 20  |.. S &9000..4P. |
00001b90  71 75 65 75 65 25 28 37  29 2c 63 6c 65 66 25 28  |queue%(7),clef%(|
00001ba0  37 29 2c 6e 6f 74 65 25  28 37 29 2c 63 6f 75 6e  |7),note%(7),coun|
00001bb0  74 25 28 37 29 2c 70 6f  73 25 28 37 29 2c 6d 69  |t%(7),pos%(7),mi|
00001bc0  64 69 25 28 37 2c 37 29  2c 6d 69 64 69 73 65 6e  |di%(7,7),midisen|
00001bd0  64 25 28 31 2c 33 31 2c  31 29 0d 0d 3e 2b de 61  |d%(1,31,1)..>+.a|
00001be0  63 63 73 74 61 74 75 73  25 28 37 29 2c 73 68 61  |ccstatus%(7),sha|
00001bf0  72 70 73 65 71 25 28 36  29 2c 66 6c 61 74 73 65  |rpseq%(6),flatse|
00001c00  71 25 28 36 29 0d 0d 48  0d f2 72 65 61 64 64 61  |q%(6)..H..readda|
00001c10  74 61 0d 0d 52 05 e1 0d  0d 5c 05 3a 0d 0d 66 0f  |ta..R....\.:..f.|
00001c20  dd f2 6c 6f 61 64 6d 75  73 69 63 0d 0d 70 15 46  |..loadmusic..p.F|
00001c30  49 4c 45 25 3d 8e 20 66  69 6c 65 6e 61 6d 65 24  |ILE%=. filename$|
00001c40  0d 0d 7a 20 4d 24 3d 22  22 3a e3 52 25 3d 31 b8  |..z M$="":.R%=1.|
00001c50  37 3a 4d 24 2b 3d bd 9a  23 46 49 4c 45 25 3a ed  |7:M$+=..#FILE%:.|
00001c60  0d 0d 84 2f e7 4d 24 3c  3e 22 4d 61 65 73 74 72  |.../.M$<>"Maestr|
00001c70  6f 22 8c f1 22 4d 61 65  73 74 72 6f 20 66 69 6c  |o".."Maestro fil|
00001c80  65 20 69 73 20 63 6f 72  72 75 70 74 22 3a e0 0d  |e is corrupt":..|
00001c90  0d 8e 26 42 25 3d 9a 23  46 49 4c 45 25 3a 42 32  |..&B%=.#FILE%:B2|
00001ca0  25 3d 9a 23 46 49 4c 45  25 3a 42 33 25 3d 9a 23  |%=.#FILE%:B3%=.#|
00001cb0  46 49 4c 45 25 0d 0d 98  83 e7 42 25 3c 3e 26 41  |FILE%.....B%<>&A|
00001cc0  20 84 42 32 25 3c 3e 32  20 84 42 33 25 3c 3e 31  | .B2%<>2 .B3%<>1|
00001cd0  8c f1 22 54 68 69 73 20  4d 61 65 73 74 72 6f 20  |.."This Maestro |
00001ce0  66 69 6c 65 20 69 73 20  69 6e 20 61 20 6e 6f 6e  |file is in a non|
00001cf0  2d 73 74 61 6e 64 61 72  64 20 66 6f 72 6d 61 74  |-standard format|
00001d00  2e 20 50 6c 65 61 73 65  20 6c 6f 61 64 20 69 74  |. Please load it|
00001d10  20 69 6e 74 6f 20 4d 61  65 73 74 72 6f 20 61 6e  | into Maestro an|
00001d20  64 20 20 72 65 73 61 76  65 20 69 74 2e 22 3a d9  |d  resave it.":.|
00001d30  23 46 49 4c 45 25 3a e0  0d 0d a2 2f e8 23 46 49  |#FILE%:..../.#FI|
00001d40  4c 45 25 2c 67 61 74 65  73 25 3a e3 52 25 3d 30  |LE%,gates%:.R%=0|
00001d50  b8 37 3a e8 23 46 49 4c  45 25 2c 71 75 65 75 65  |.7:.#FILE%,queue|
00001d60  25 28 52 25 29 3a ed 0d  0d ac 22 e3 52 25 3d 31  |%(R%):....".R%=1|
00001d70  b8 67 61 74 65 73 25 3a  3f 28 53 2b 52 25 29 3d  |.gates%:?(S+R%)=|
00001d80  9a 23 46 49 4c 45 25 3a  ed 0d 0d b6 0b e3 56 25  |.#FILE%:......V%|
00001d90  3d 30 b8 37 0d 0d c0 45  20 e7 71 75 65 75 65 25  |=0.7...E .queue%|
00001da0  28 56 25 29 3c 3e 30 8c  e3 52 25 3d 31 b8 71 75  |(V%)<>0..R%=1.qu|
00001db0  65 75 65 25 28 56 25 29  3a 3f 28 53 2b 52 25 2b  |eue%(V%):?(S+R%+|
00001dc0  26 31 30 30 30 2a 56 25  2b 26 31 30 30 30 29 3d  |&1000*V%+&1000)=|
00001dd0  9a 23 46 49 4c 45 25 3a  ed 0d 0d ca 05 ed 0d 0d  |.#FILE%:........|
00001de0  d4 7e 42 25 3d 9a 23 46  49 4c 45 25 3a e7 42 25  |.~B%=.#FILE%:.B%|
00001df0  3c 3e 32 20 8c f1 22 54  68 69 73 20 4d 61 65 73  |<>2 .."This Maes|
00001e00  74 72 6f 20 66 69 6c 65  20 69 73 20 69 6e 20 61  |tro file is in a|
00001e10  20 6e 6f 6e 2d 73 74 61  6e 64 61 72 64 20 66 6f  | non-standard fo|
00001e20  72 6d 61 74 2e 20 50 6c  65 61 73 65 20 6c 6f 61  |rmat. Please loa|
00001e30  64 20 69 74 20 69 6e 74  6f 20 4d 61 65 73 74 72  |d it into Maestr|
00001e40  6f 20 61 6e 64 20 20 72  65 73 61 76 65 20 69 74  |o and  resave it|
00001e50  2e 22 3a d9 23 46 49 4c  45 25 3a e0 0d 0d de 1d  |.":.#FILE%:.....|
00001e60  73 74 61 76 65 73 25 3d  9a 23 46 49 4c 45 25 2b  |staves%=.#FILE%+|
00001e70  34 2a 9a 23 46 49 4c 45  25 0d 0d e8 0b d9 23 46  |4*.#FILE%.....#F|
00001e80  49 4c 45 25 0d 0d f2 05  e1 0d 0d fc 05 3a 0d 0e  |ILE%.........:..|
00001e90  06 12 dd f2 64 6f 63 6f  6e 76 65 72 73 69 6f 6e  |....doconversion|
00001ea0  0d 0e 10 51 e3 52 25 3d  30 b8 37 3a 70 6f 73 25  |...Q.R%=0.7:pos%|
00001eb0  28 52 25 29 3d 53 2b 26  31 30 30 30 2a 52 25 2b  |(R%)=S+&1000*R%+|
00001ec0  26 31 30 30 31 3a 63 6c  65 66 25 28 52 25 29 3d  |&1001:clef%(R%)=|
00001ed0  30 3a 63 6f 75 6e 74 25  28 52 25 29 3d 30 3a 61  |0:count%(R%)=0:a|
00001ee0  63 63 73 74 61 74 75 73  25 28 52 25 29 3d 30 3a  |ccstatus%(R%)=0:|
00001ef0  ed 0d 0e 1a 25 6b 65 79  66 6c 61 74 3d a3 3a 6e  |....%keyflat=.:n|
00001f00  6f 61 63 63 69 64 65 6e  74 73 25 3d 30 3a f2 62  |oaccidents%=0:.b|
00001f10  61 72 6c 69 6e 65 0d 0e  24 25 70 6f 73 69 74 69  |arline..$%positi|
00001f20  6f 6e 25 3d 53 2b 31 3a  74 69 6d 65 72 25 3d 30  |on%=S+1:timer%=0|
00001f30  3a f2 72 65 61 64 67 61  74 65 73 0d 0e 2e 05 f5  |:.readgates.....|
00001f40  0d 0e 38 0d 20 74 69 6d  65 72 25 3d 30 0d 0e 42  |..8. timer%=0..B|
00001f50  06 20 f5 0d 0e 4c 1e 20  20 6d 6f 76 65 6f 6e 3d  |. ...L.  moveon=|
00001f60  a3 3a 74 69 6d 65 72 25  3d 74 69 6d 65 72 25 2b  |.:timer%=timer%+|
00001f70  31 0d 0e 56 0d 20 20 e3  52 25 3d 30 b8 37 0d 0e  |1..V.  .R%=0.7..|
00001f80  60 15 20 20 20 e7 63 6f  75 6e 74 25 28 52 25 29  |`.   .count%(R%)|
00001f90  3d 31 8c 0d 0e 6a 10 20  20 20 20 6d 6f 76 65 6f  |=1...j.    moveo|
00001fa0  6e 3d b9 0d 0e 74 44 20  20 20 20 e7 6e 6f 74 65  |n=...tD    .note|
00001fb0  25 28 52 25 29 3c 3e 30  8c f2 73 65 6e 64 6d 69  |%(R%)<>0..sendmi|
00001fc0  64 69 28 33 2c 26 38 30  2b 6d 69 64 69 25 28 73  |di(3,&80+midi%(s|
00001fd0  74 61 76 65 73 25 2c 52  25 29 2c 6e 6f 74 65 25  |taves%,R%),note%|
00001fe0  28 52 25 29 2c 30 29 0d  0e 7e 08 20 20 20 cd 0d  |(R%),0)..~.   ..|
00001ff0  0e 88 2d 20 20 20 e7 63  6f 75 6e 74 25 28 52 25  |..-   .count%(R%|
00002000  29 3c 3e 30 8c 63 6f 75  6e 74 25 28 52 25 29 3d  |)<>0.count%(R%)=|
00002010  63 6f 75 6e 74 25 28 52  25 29 2d 31 0d 0e 92 07  |count%(R%)-1....|
00002020  20 20 ed 0d 0e 9c 13 20  20 e3 77 61 69 74 3d 30  |  .....  .wait=0|
00002030  b8 31 32 35 3a ed 0d 0e  a6 0d 20 fd 20 6d 6f 76  |.125:..... . mov|
00002040  65 6f 6e 0d 0e b0 0f 20  f2 72 65 61 64 67 61 74  |eon.... .readgat|
00002050  65 73 0d 0e ba 39 20 c8  99 22 48 6f 75 72 67 6c  |es...9 .."Hourgl|
00002060  61 73 73 5f 50 65 72 63  65 6e 74 61 67 65 22 2c  |ass_Percentage",|
00002070  a8 28 28 70 6f 73 69 74  69 6f 6e 25 2d 53 29 2f  |.((position%-S)/|
00002080  67 61 74 65 73 25 2a 31  30 30 29 0d 0e c4 19 fd  |gates%*100).....|
00002090  70 6f 73 69 74 69 6f 6e  25 3e 28 67 61 74 65 73  |position%>(gates|
000020a0  25 2b 53 29 0d 0e ce 05  e1 0d 0e d8 05 3a 0d 0e  |%+S).........:..|
000020b0  e2 0f dd f2 72 65 61 64  67 61 74 65 73 0d 0e ec  |....readgates...|
000020c0  0a ea 74 79 70 65 25 0d  0e f6 15 20 74 79 70 65  |..type%.... type|
000020d0  25 3d 3f 70 6f 73 69 74  69 6f 6e 25 0d 0f 00 0f  |%=?position%....|
000020e0  20 e7 20 74 79 70 65 25  3d 30 8c 0d 0f 0a 34 20  | . type%=0....4 |
000020f0  20 f2 73 70 65 63 69 61  6c 28 3f 28 70 6f 73 69  | .special(?(posi|
00002100  74 69 6f 6e 25 2b 31 29  29 3a 70 6f 73 69 74 69  |tion%+1)):positi|
00002110  6f 6e 25 3d 70 6f 73 69  74 69 6f 6e 25 2b 32 0d  |on%=position%+2.|
00002120  0f 14 29 20 20 e7 ac 28  70 6f 73 69 74 69 6f 6e  |..)  ..(position|
00002130  25 3e 28 67 61 74 65 73  25 2b 53 29 29 8c f2 72  |%>(gates%+S))..r|
00002140  65 61 64 67 61 74 65 73  0d 0f 1e 06 20 cc 0d 0f  |eadgates.... ...|
00002150  28 2c 20 20 f2 61 64 64  6e 6f 74 65 73 28 74 79  |(,  .addnotes(ty|
00002160  70 65 25 29 3a 70 6f 73  69 74 69 6f 6e 25 3d 70  |pe%):position%=p|
00002170  6f 73 69 74 69 6f 6e 25  2b 31 0d 0f 32 06 20 cd  |osition%+1..2. .|
00002180  0d 0f 3c 05 e1 0d 0f 46  05 3a 0d 0f 50 17 dd f2  |..<....F.:..P...|
00002190  61 64 64 6e 6f 74 65 73  28 71 75 65 75 65 73 25  |addnotes(queues%|
000021a0  29 0d 0f 5a 07 ea 52 25  0d 0f 64 0c 20 e3 52 25  |)..Z..R%..d. .R%|
000021b0  3d 30 b8 37 0d 0f 6e 22  20 20 e7 28 71 75 65 75  |=0.7..n"  .(queu|
000021c0  65 73 25 83 32 29 3d 31  8c f2 67 65 74 71 75 65  |es%.2)=1..getque|
000021d0  75 65 28 52 25 29 0d 0f  78 17 20 20 71 75 65 75  |ue(R%)..x.  queu|
000021e0  65 73 25 3d 71 75 65 75  65 73 25 81 32 0d 0f 82  |es%=queues%.2...|
000021f0  06 20 ed 0d 0f 8c 05 e1  0d 0f 96 05 3a 0d 0f a0  |. ..........:...|
00002200  12 dd f2 67 65 74 71 75  65 75 65 28 71 25 29 0d  |...getqueue(q%).|
00002210  0f aa 2f ea 6e 6f 74 65  70 6f 73 25 2c 6e 6f 74  |../.notepos%,not|
00002220  65 25 2c 61 63 63 69 64  65 6e 74 61 6c 73 25 2c  |e%,accidentals%,|
00002230  6c 65 6e 62 69 74 73 25  2c 64 6f 74 73 25 0d 0f  |lenbits%,dots%..|
00002240  b4 1b 20 6e 6f 74 65 70  6f 73 25 3d 28 3f 70 6f  |.. notepos%=(?po|
00002250  73 25 28 71 25 29 29 81  38 0d 0f be 2d 20 61 63  |s%(q%)).8...- ac|
00002260  63 69 64 65 6e 74 61 6c  73 25 3d a4 72 65 76 62  |cidentals%=.revb|
00002270  69 74 73 28 3f 28 70 6f  73 25 28 71 25 29 2b 31  |its(?(pos%(q%)+1|
00002280  29 2c 30 2c 33 29 0d 0f  c8 54 20 e7 61 63 63 69  |),0,3)...T .acci|
00002290  64 65 6e 74 61 6c 73 25  3c 3e 30 8c f2 63 68 61  |dentals%<>0..cha|
000022a0  6e 67 65 61 63 63 73 74  61 74 75 73 28 6d 69 64  |ngeaccstatus(mid|
000022b0  69 73 65 6e 64 25 28 63  6c 65 66 25 28 71 25 29  |isend%(clef%(q%)|
000022c0  2c 6e 6f 74 65 70 6f 73  25 2c 31 29 2c 61 63 63  |,notepos%,1),acc|
000022d0  69 64 65 6e 74 61 6c 73  25 29 0d 0f d2 56 20 6e  |identals%)...V n|
000022e0  6f 74 65 25 3d 6d 69 64  69 73 65 6e 64 25 28 63  |ote%=midisend%(c|
000022f0  6c 65 66 25 28 71 25 29  2c 6e 6f 74 65 70 6f 73  |lef%(q%),notepos|
00002300  25 2c 30 29 2b 61 63 63  73 74 61 74 75 73 25 28  |%,0)+accstatus%(|
00002310  6d 69 64 69 73 65 6e 64  25 28 63 6c 65 66 25 28  |midisend%(clef%(|
00002320  71 25 29 2c 6e 6f 74 65  70 6f 73 25 2c 31 29 29  |q%),notepos%,1))|
00002330  0d 0f dc 3c 20 e7 20 6e  6f 74 65 25 3c 3e 30 8c  |...< . note%<>0.|
00002340  f2 73 65 6e 64 6d 69 64  69 28 33 2c 26 39 30 2b  |.sendmidi(3,&90+|
00002350  6d 69 64 69 25 28 73 74  61 76 65 73 25 2c 71 25  |midi%(staves%,q%|
00002360  29 2c 6e 6f 74 65 25 2c  26 33 46 29 0d 0f e6 14  |),note%,&3F)....|
00002370  20 6e 6f 74 65 25 28 71  25 29 3d 6e 6f 74 65 25  | note%(q%)=note%|
00002380  0d 0f f0 29 20 6c 65 6e  62 69 74 73 25 3d a4 72  |...) lenbits%=.r|
00002390  65 76 62 69 74 73 28 3f  28 70 6f 73 25 28 71 25  |evbits(?(pos%(q%|
000023a0  29 2b 31 29 2c 35 2c 33  29 0d 0f fa 26 20 64 6f  |)+1),5,3)...& do|
000023b0  74 73 25 3d a4 72 65 76  62 69 74 73 28 3f 28 70  |ts%=.revbits(?(p|
000023c0  6f 73 25 28 71 25 29 2b  31 29 2c 33 2c 32 29 0d  |os%(q%)+1),3,2).|
000023d0  10 04 31 20 63 6f 75 6e  74 25 28 71 25 29 3d a8  |..1 count%(q%)=.|
000023e0  28 28 32 5e 28 38 2d 6c  65 6e 62 69 74 73 25 29  |((2^(8-lenbits%)|
000023f0  29 2a 34 2a 28 31 2e 35  5e 64 6f 74 73 25 29 29  |)*4*(1.5^dots%))|
00002400  0d 10 0e 18 20 70 6f 73  25 28 71 25 29 3d 70 6f  |.... pos%(q%)=po|
00002410  73 25 28 71 25 29 2b 32  0d 10 18 05 e1 0d 10 22  |s%(q%)+2......."|
00002420  05 3a 0d 10 2c 1f dd a4  72 65 76 62 69 74 73 28  |.:..,...revbits(|
00002430  62 69 74 73 25 2c 66 69  72 73 74 25 2c 6e 6f 25  |bits%,first%,no%|
00002440  29 0d 10 36 0d 20 ea 52  25 2c 6f 75 74 25 0d 10  |)..6. .R%,out%..|
00002450  40 0b 20 6f 75 74 25 3d  30 0d 10 4a 10 20 e3 52  |@. out%=0..J. .R|
00002460  25 3d 30 b8 6e 6f 25 2d  31 0d 10 54 33 20 20 6f  |%=0.no%-1..T3  o|
00002470  75 74 25 3d 6f 75 74 25  2d 28 32 5e 52 25 29 2a  |ut%=out%-(2^R%)*|
00002480  28 28 62 69 74 73 25 80  28 32 5e 28 66 69 72 73  |((bits%.(2^(firs|
00002490  74 25 2b 52 25 29 29 29  3c 3e 30 29 0d 10 5e 06  |t%+R%)))<>0)..^.|
000024a0  20 ed 0d 10 68 09 3d 6f  75 74 25 0d 10 72 05 3a  | ...h.=out%..r.:|
000024b0  0d 10 7c 14 dd f2 73 70  65 63 69 61 6c 28 74 79  |..|...special(ty|
000024c0  70 65 25 29 0d 10 86 19  20 e7 28 74 79 70 65 25  |pe%).... .(type%|
000024d0  80 31 29 3d 31 8c f2 74  69 6d 73 69 67 0d 10 90  |.1)=1..timsig...|
000024e0  19 20 e7 28 74 79 70 65  25 80 33 29 3d 32 8c f2  |. .(type%.3)=2..|
000024f0  6b 65 79 73 69 67 0d 10  9a 1a 20 e7 28 74 79 70  |keysig.... .(typ|
00002500  65 25 80 37 29 3d 34 8c  f2 63 6c 65 66 73 65 74  |e%.7)=4..clefset|
00002510  0d 10 a4 1c 20 e7 28 74  79 70 65 25 80 36 33 29  |.... .(type%.63)|
00002520  3d 33 32 8c f2 62 61 72  6c 69 6e 65 0d 10 ae 05  |=32..barline....|
00002530  e1 0d 10 b8 05 3a 0d 10  c2 0c dd f2 74 69 6d 73  |.....:......tims|
00002540  69 67 0d 10 cc 05 e1 0d  10 d6 05 3a 0d 10 e0 0c  |ig.........:....|
00002550  dd f2 6b 65 79 73 69 67  0d 10 ea 1a 20 6b 65 79  |..keysig.... key|
00002560  66 6c 61 74 3d 28 28 74  79 70 65 25 80 34 29 3d  |flat=((type%.4)=|
00002570  34 29 0d 10 f4 25 20 6e  6f 61 63 63 69 64 65 6e  |4)...% noacciden|
00002580  74 73 25 3d a4 72 65 76  62 69 74 73 28 74 79 70  |ts%=.revbits(typ|
00002590  65 25 2c 33 2c 33 29 0d  10 fe 0d 20 f2 62 61 72  |e%,3,3).... .bar|
000025a0  6c 69 6e 65 0d 11 08 05  e1 0d 11 12 05 3a 0d 11  |line.........:..|
000025b0  1c 0d dd f2 63 6c 65 66  73 65 74 0d 11 26 12 20  |....clefset..&. |
000025c0  ea 63 6c 65 66 25 2c 73  74 61 76 65 25 0d 11 30  |.clef%,stave%..0|
000025d0  18 20 63 6c 65 66 25 3d  28 74 79 70 65 25 80 31  |. clef%=(type%.1|
000025e0  36 29 81 31 36 0d 11 3a  2d 20 73 74 61 76 65 25  |6).16..:- stave%|
000025f0  3d 28 28 74 79 70 65 25  80 33 32 29 81 33 32 29  |=((type%.32).32)|
00002600  2a 32 2b 28 28 74 79 70  65 25 80 36 34 29 81 36  |*2+((type%.64).6|
00002610  34 29 0d 11 44 0c 20 e3  52 25 3d 30 b8 37 0d 11  |4)..D. .R%=0.7..|
00002620  4e 30 20 20 e7 6d 69 64  69 25 28 73 74 61 76 65  |N0  .midi%(stave|
00002630  73 25 2c 52 25 29 3d 73  74 61 76 65 25 20 8c 63  |s%,R%)=stave% .c|
00002640  6c 65 66 25 28 52 25 29  3d 63 6c 65 66 25 0d 11  |lef%(R%)=clef%..|
00002650  58 06 20 ed 0d 11 62 05  e1 0d 11 6c 05 3a 0d 11  |X. ...b....l.:..|
00002660  76 0d dd f2 62 61 72 6c  69 6e 65 0d 11 80 10 20  |v...barline.... |
00002670  e7 20 6b 65 79 66 6c 61  74 20 8c 0d 11 8a 0d 20  |. keyflat ..... |
00002680  20 e3 52 25 3d 30 b8 36  0d 11 94 45 20 20 20 e7  | .R%=0.6...E   .|
00002690  66 6c 61 74 73 65 71 25  28 52 25 29 3c 6e 6f 61  |flatseq%(R%)<noa|
000026a0  63 63 69 64 65 6e 74 73  25 8c 61 63 63 73 74 61  |ccidents%.accsta|
000026b0  74 75 73 25 28 52 25 29  3d 2d 31 20 8b 61 63 63  |tus%(R%)=-1 .acc|
000026c0  73 74 61 74 75 73 25 28  52 25 29 3d 30 0d 11 9e  |status%(R%)=0...|
000026d0  07 20 20 ed 0d 11 a8 06  20 cc 0d 11 b2 0d 20 20  |.  ..... .....  |
000026e0  e3 52 25 3d 30 b8 36 0d  11 bc 45 20 20 20 e7 73  |.R%=0.6...E   .s|
000026f0  68 61 72 70 73 65 71 25  28 52 25 29 3c 6e 6f 61  |harpseq%(R%)<noa|
00002700  63 63 69 64 65 6e 74 73  25 8c 61 63 63 73 74 61  |ccidents%.accsta|
00002710  74 75 73 25 28 52 25 29  3d 31 20 8b 61 63 63 73  |tus%(R%)=1 .accs|
00002720  74 61 74 75 73 25 28 52  25 29 3d 30 0d 11 c6 07  |tatus%(R%)=0....|
00002730  20 20 ed 0d 11 d0 06 20  cd 0d 11 da 05 e1 0d 11  |  ..... ........|
00002740  e4 05 3a 0d 11 ee 21 dd  f2 63 68 61 6e 67 65 61  |..:...!..changea|
00002750  63 63 73 74 61 74 75 73  28 6b 65 79 25 2c 74 79  |ccstatus(key%,ty|
00002760  70 65 25 29 0d 11 f8 0f  20 c8 8e 20 74 79 70 65  |pe%).... .. type|
00002770  25 20 ca 0d 12 02 1c 20  20 c9 20 31 3a 61 63 63  |% .....  . 1:acc|
00002780  73 74 61 74 75 73 25 28  6b 65 79 25 29 3d 30 0d  |status%(key%)=0.|
00002790  12 0c 1c 20 20 c9 20 32  3a 61 63 63 73 74 61 74  |...  . 2:accstat|
000027a0  75 73 25 28 6b 65 79 25  29 3d 31 0d 12 16 1d 20  |us%(key%)=1.... |
000027b0  20 c9 20 33 3a 61 63 63  73 74 61 74 75 73 25 28  | . 3:accstatus%(|
000027c0  6b 65 79 25 29 3d 2d 31  0d 12 20 06 20 cb 0d 12  |key%)=-1.. . ...|
000027d0  2a 05 e1 0d 12 34 05 3a  0d 12 3e 17 dd f2 73 65  |*....4.:..>...se|
000027e0  6e 64 6d 69 64 69 28 6e  2c 78 2c 79 2c 7a 29 0d  |ndmidi(n,x,y,z).|
000027f0  12 48 17 20 c8 99 20 22  4d 49 44 49 5f 54 78 42  |.H. .. "MIDI_TxB|
00002800  79 74 65 22 2c 78 0d 12  52 1d 20 e7 6e 3e 31 20  |yte",x..R. .n>1 |
00002810  8c c8 99 20 22 4d 49 44  49 5f 54 78 42 79 74 65  |... "MIDI_TxByte|
00002820  22 2c 79 0d 12 5c 1d 20  e7 6e 3e 32 20 8c c8 99  |",y..\. .n>2 ...|
00002830  20 22 4d 49 44 49 5f 54  78 42 79 74 65 22 2c 7a  | "MIDI_TxByte",z|
00002840  0d 12 66 05 e1 0d 12 70  05 3a 0d 12 7a 0e dd f2  |..f....p.:..z...|
00002850  72 65 61 64 64 61 74 61  0d 12 84 06 20 f7 0d 12  |readdata.... ...|
00002860  8e 11 20 e3 73 74 61 76  65 73 25 3d 30 b8 37 0d  |.. .staves%=0.7.|
00002870  12 98 22 20 20 e3 52 25  3d 30 b8 37 3a f3 6d 69  |.."  .R%=0.7:.mi|
00002880  64 69 25 28 73 74 61 76  65 73 25 2c 52 25 29 3a  |di%(staves%,R%):|
00002890  ed 0d 12 a2 06 20 ed 0d  12 ac 0f 20 e3 63 6c 65  |..... ..... .cle|
000028a0  66 25 3d 30 b8 31 0d 12  b6 11 20 20 e3 6e 6f 74  |f%=0.1....  .not|
000028b0  65 25 3d 30 b8 33 31 0d  12 c0 11 20 20 20 e3 64  |e%=0.31....   .d|
000028c0  61 74 61 25 3d 30 b8 31  0d 12 ca 25 20 20 20 20  |ata%=0.1...%    |
000028d0  f3 6d 69 64 69 73 65 6e  64 25 28 63 6c 65 66 25  |.midisend%(clef%|
000028e0  2c 6e 6f 74 65 25 2c 64  61 74 61 25 29 0d 12 d4  |,note%,data%)...|
000028f0  08 20 20 20 ed 0d 12 de  07 20 20 ed 0d 12 e8 06  |.   .....  .....|
00002900  20 ed 0d 12 f2 4e 20 f4  20 42 65 6c 6f 77 20 72  | ....N . Below r|
00002910  65 70 72 65 73 65 6e 74  73 20 22 46 61 74 68 65  |epresents "Fathe|
00002920  72 20 43 68 72 69 73 74  6d 61 73 20 47 6f 65 73  |r Christmas Goes|
00002930  20 44 6f 77 6e 20 41 6c  6c 20 45 73 63 61 6c 61  | Down All Escala|
00002940  74 6f 72 73 20 42 61 63  6b 77 61 72 64 73 21 22  |tors Backwards!"|
00002950  0d 12 fc 25 20 73 68 61  72 70 73 65 71 25 28 30  |...% sharpseq%(0|
00002960  29 3d 34 3a 66 6c 61 74  73 65 71 25 28 30 29 3d  |)=4:flatseq%(0)=|
00002970  32 3a f4 20 41 0d 13 06  25 20 73 68 61 72 70 73  |2:. A...% sharps|
00002980  65 71 25 28 31 29 3d 36  3a 66 6c 61 74 73 65 71  |eq%(1)=6:flatseq|
00002990  25 28 31 29 3d 30 3a f4  20 42 0d 13 10 25 20 73  |%(1)=0:. B...% s|
000029a0  68 61 72 70 73 65 71 25  28 32 29 3d 31 3a 66 6c  |harpseq%(2)=1:fl|
000029b0  61 74 73 65 71 25 28 32  29 3d 35 3a f4 20 43 0d  |atseq%(2)=5:. C.|
000029c0  13 1a 25 20 73 68 61 72  70 73 65 71 25 28 33 29  |..% sharpseq%(3)|
000029d0  3d 33 3a 66 6c 61 74 73  65 71 25 28 33 29 3d 33  |=3:flatseq%(3)=3|
000029e0  3a f4 20 44 0d 13 24 25  20 73 68 61 72 70 73 65  |:. D..$% sharpse|
000029f0  71 25 28 34 29 3d 35 3a  66 6c 61 74 73 65 71 25  |q%(4)=5:flatseq%|
00002a00  28 34 29 3d 31 3a f4 20  45 0d 13 2e 25 20 73 68  |(4)=1:. E...% sh|
00002a10  61 72 70 73 65 71 25 28  35 29 3d 30 3a 66 6c 61  |arpseq%(5)=0:fla|
00002a20  74 73 65 71 25 28 35 29  3d 36 3a f4 20 46 0d 13  |tseq%(5)=6:. F..|
00002a30  38 25 20 73 68 61 72 70  73 65 71 25 28 36 29 3d  |8% sharpseq%(6)=|
00002a40  32 3a 66 6c 61 74 73 65  71 25 28 36 29 3d 34 3a  |2:flatseq%(6)=4:|
00002a50  f4 20 47 0d 13 42 05 e1  0d 13 4c 05 e1 0d 13 56  |. G..B....L....V|
00002a60  05 3a 0d 13 60 2a f4 20  4d 49 44 49 20 56 6f 69  |.:..`*. MIDI Voi|
00002a70  63 65 20 61 6c 6c 6f 63  61 74 69 6f 6e 73 20 74  |ce allocations t|
00002a80  6f 20 65 61 63 68 20 71  75 65 75 65 0d 13 6a 14  |o each queue..j.|
00002a90  dc 30 2c 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |.0,0,0,0,0,0,0,0|
00002aa0  0d 13 74 14 dc 30 2c 30  2c 30 2c 30 2c 31 2c 31  |..t..0,0,0,0,1,1|
00002ab0  2c 31 2c 31 0d 13 7e 14  dc 30 2c 31 2c 31 2c 31  |,1,1..~..0,1,1,1|
00002ac0  2c 31 2c 32 2c 32 2c 32  0d 13 88 14 dc 30 2c 30  |,1,2,2,2.....0,0|
00002ad0  2c 31 2c 31 2c 32 2c 32  2c 33 2c 33 0d 13 92 14  |,1,1,2,2,3,3....|
00002ae0  dc 30 2c 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 39  |.0,0,0,0,0,0,0,9|
00002af0  0d 13 9c 14 dc 30 2c 30  2c 30 2c 30 2c 31 2c 31  |.....0,0,0,0,1,1|
00002b00  2c 31 2c 39 0d 13 a6 14  dc 30 2c 31 2c 31 2c 31  |,1,9.....0,1,1,1|
00002b10  2c 31 2c 32 2c 32 2c 39  0d 13 b0 14 dc 30 2c 30  |,1,2,2,9.....0,0|
00002b20  2c 31 2c 31 2c 32 2c 32  2c 33 2c 39 0d 13 ba 05  |,1,1,2,2,3,9....|
00002b30  3a 0d 13 c4 3c f4 20 54  72 65 62 6c 65 20 43 6c  |:...<. Treble Cl|
00002b40  65 66 20 28 4d 61 65 73  74 72 6f 20 6c 69 6e 65  |ef (Maestro line|
00002b50  20 6e 6f 2f 61 63 63 69  64 65 6e 74 61 6c 20 2d  | no/accidental -|
00002b60  2d 3e 20 4d 49 44 49 20  4e 6f 74 65 29 0d 13 ce  |-> MIDI Note)...|
00002b70  08 dc 30 2c 37 0d 13 d8  09 dc 34 35 2c 30 0d 13  |..0,7.....45,0..|
00002b80  e2 09 dc 34 37 2c 31 0d  13 ec 09 dc 34 38 2c 32  |...47,1.....48,2|
00002b90  0d 13 f6 09 dc 35 30 2c  33 0d 14 00 09 dc 35 32  |.....50,3.....52|
00002ba0  2c 34 0d 14 0a 09 dc 35  33 2c 35 0d 14 14 09 dc  |,4.....53,5.....|
00002bb0  35 35 2c 36 0d 14 1e 09  dc 35 37 2c 30 0d 14 28  |55,6.....57,0..(|
00002bc0  09 dc 35 39 2c 31 0d 14  32 09 dc 36 30 2c 32 0d  |..59,1..2..60,2.|
00002bd0  14 3c 09 dc 36 32 2c 33  0d 14 46 09 dc 36 34 2c  |.<..62,3..F..64,|
00002be0  34 0d 14 50 09 dc 36 35  2c 35 0d 14 5a 09 dc 36  |4..P..65,5..Z..6|
00002bf0  37 2c 36 0d 14 64 09 dc  36 39 2c 30 0d 14 6e 09  |7,6..d..69,0..n.|
00002c00  dc 37 31 2c 31 0d 14 78  09 dc 37 32 2c 32 0d 14  |.71,1..x..72,2..|
00002c10  82 09 dc 37 34 2c 33 0d  14 8c 09 dc 37 36 2c 34  |...74,3.....76,4|
00002c20  0d 14 96 09 dc 37 37 2c  35 0d 14 a0 09 dc 37 39  |.....77,5.....79|
00002c30  2c 36 0d 14 aa 09 dc 38  31 2c 30 0d 14 b4 09 dc  |,6.....81,0.....|
00002c40  38 33 2c 31 0d 14 be 09  dc 38 34 2c 32 0d 14 c8  |83,1.....84,2...|
00002c50  09 dc 38 36 2c 33 0d 14  d2 09 dc 38 38 2c 34 0d  |..86,3.....88,4.|
00002c60  14 dc 09 dc 38 39 2c 35  0d 14 e6 09 dc 39 31 2c  |....89,5.....91,|
00002c70  36 0d 14 f0 09 dc 39 33  2c 30 0d 14 fa 09 dc 39  |6.....93,0.....9|
00002c80  35 2c 31 0d 15 04 09 dc  39 36 2c 32 0d 15 0e 05  |5,1.....96,2....|
00002c90  3a 0d 15 18 3a f4 20 42  61 73 73 20 43 6c 65 66  |:...:. Bass Clef|
00002ca0  20 28 4d 61 65 73 74 72  6f 20 6c 69 6e 65 20 6e  | (Maestro line n|
00002cb0  6f 2f 61 63 63 69 64 65  6e 74 61 6c 20 2d 2d 3e  |o/accidental -->|
00002cc0  20 4d 49 44 49 20 4e 6f  74 65 29 0d 15 22 08 dc  | MIDI Note).."..|
00002cd0  30 2c 37 0d 15 2c 09 dc  32 34 2c 32 0d 15 36 09  |0,7..,..24,2..6.|
00002ce0  dc 32 36 2c 33 0d 15 40  09 dc 32 38 2c 34 0d 15  |.26,3..@..28,4..|
00002cf0  4a 09 dc 32 39 2c 35 0d  15 54 09 dc 33 31 2c 36  |J..29,5..T..31,6|
00002d00  0d 15 5e 09 dc 33 33 2c  30 0d 15 68 09 dc 33 35  |..^..33,0..h..35|
00002d10  2c 31 0d 15 72 09 dc 33  36 2c 32 0d 15 7c 09 dc  |,1..r..36,2..|..|
00002d20  33 38 2c 33 0d 15 86 09  dc 34 30 2c 34 0d 15 90  |38,3.....40,4...|
00002d30  09 dc 34 31 2c 35 0d 15  9a 09 dc 34 33 2c 36 0d  |..41,5.....43,6.|
00002d40  15 a4 09 dc 34 35 2c 30  0d 15 ae 09 dc 34 37 2c  |....45,0.....47,|
00002d50  31 0d 15 b8 09 dc 34 38  2c 32 0d 15 c2 09 dc 35  |1.....48,2.....5|
00002d60  30 2c 33 0d 15 cc 09 dc  35 32 2c 34 0d 15 d6 09  |0,3.....52,4....|
00002d70  dc 35 33 2c 35 0d 15 e0  09 dc 35 35 2c 36 0d 15  |.53,5.....55,6..|
00002d80  ea 09 dc 35 37 2c 30 0d  15 f4 09 dc 35 39 2c 31  |...57,0.....59,1|
00002d90  0d 15 fe 09 dc 36 30 2c  32 0d 16 08 09 dc 36 32  |.....60,2.....62|
00002da0  2c 33 0d 16 12 09 dc 36  34 2c 34 0d 16 1c 09 dc  |,3.....64,4.....|
00002db0  36 35 2c 35 0d 16 26 09  dc 36 37 2c 36 0d 16 30  |65,5..&..67,6..0|
00002dc0  09 dc 36 39 2c 30 0d 16  3a 09 dc 37 31 2c 31 0d  |..69,0..:..71,1.|
00002dd0  16 44 09 dc 37 32 2c 32  0d 16 4e 09 dc 37 34 2c  |.D..72,2..N..74,|
00002de0  33 0d 16 58 09 dc 37 36  2c 34 0d ff              |3..X..76,4..|
00002dec