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

!MakeMIDI/old/!RI100899

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/!RI100899
Read OK:
File size: 2F80 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%
 1180PROCdeltatime(&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
 3690REPEAT
 3700 timer%=0
 3710 REPEAT
 3720  moveon=FALSE:timer%=timer%+1
 3730  FORR%=0TO7
 3740   IFcount%(R%)=1THEN
 3750    moveon=TRUE
 3760    IFnote%(R%)<>0THENPROCsendmidi(3,&80+midi%(staves%,R%),note%(R%),0)
 3770   ENDIF
 3780   IFcount%(R%)<>0THENcount%(R%)=count%(R%)-1
 3790  NEXT
 3800  FORwait=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 notepos%=(?pos%(q%))DIV8
 4090 accidentals%=FNrevbits(?(pos%(q%)+1),0,3)
 4100 IFaccidentals%<>0THENPROCchangeaccstatus(midisend%(clef%(q%),notepos%,1),accidentals%)
 4110 note%=midisend%(clef%(q%),notepos%,0)+accstatus%(midisend%(clef%(q%),notepos%,1))
 4120 IF note%<>0THENPROCsendmidi(3,&90+midi%(staves%,q%),note%,&3F)
 4130 note%(q%)=note%
 4140 lenbits%=FNrevbits(?(pos%(q%)+1),5,3)
 4150 dots%=FNrevbits(?(pos%(q%)+1),3,2)
 4160 count%(q%)=INT((2^(8-lenbits%))*4*(1.5^dots%))
 4170 pos%(q%)=pos%(q%)+2
 4180ENDPROC
 4190:
 4200DEFFNrevbits(bits%,first%,no%)
 4210 LOCALR%,out%
 4220 out%=0
 4230 FORR%=0TOno%-1
 4240  out%=out%-(2^R%)*((bits%AND(2^(first%+R%)))<>0)
 4250 NEXT
 4260=out%
 4270:
 4280DEFPROCspecial(type%)
 4290 IF(type%AND1)=1THENPROCtimsig
 4300 IF(type%AND3)=2THENPROCkeysig
 4310 IF(type%AND7)=4THENPROCclefset
 4320 IF(type%AND63)=32THENPROCbarline
 4330ENDPROC
 4340:
 4350DEFPROCtimsig
 4360ENDPROC
 4370:
 4380DEFPROCkeysig
 4390 keyflat=((type%AND4)=4)
 4400 noaccidents%=FNrevbits(type%,3,3)
 4410 PROCbarline
 4420ENDPROC
 4430:
 4440DEFPROCclefset
 4450 LOCALclef%,stave%
 4460 clef%=(type%AND16)DIV16
 4470 stave%=((type%AND32)DIV32)*2+((type%AND64)DIV64)
 4480 FORR%=0TO7
 4490  IFmidi%(staves%,R%)=stave% THENclef%(R%)=clef%
 4500 NEXT
 4510ENDPROC
 4520:
 4530DEFPROCbarline
 4540 IF keyflat THEN
 4550  FORR%=0TO6
 4560   IFflatseq%(R%)<noaccidents%THENaccstatus%(R%)=-1 ELSEaccstatus%(R%)=0
 4570  NEXT
 4580 ELSE
 4590  FORR%=0TO6
 4600   IFsharpseq%(R%)<noaccidents%THENaccstatus%(R%)=1 ELSEaccstatus%(R%)=0
 4610  NEXT
 4620 ENDIF
 4630ENDPROC
 4640:
 4650DEFPROCchangeaccstatus(key%,type%)
 4660 CASE type% OF
 4670  WHEN 1:accstatus%(key%)=0
 4680  WHEN 2:accstatus%(key%)=1
 4690  WHEN 3:accstatus%(key%)=-1
 4700 ENDCASE
 4710ENDPROC
 4720:
 4730DEFPROCdeltatime(n%)
 4740LOCALstore%,bit
 4750REPEAT:store%=0
 4760 FORbit=0TO6
 4770  IF((n%MOD2)<>0)THENstore%=store%+2^bit
 4780  n%=n%DIV2
 4790 NEXT
 4800 ?miditop%=store%-128*(n%<>0):miditop%=miditop%+1
 4810UNTILn%=0
 4820ENDPROC
 4830:
 4840DEFPROCsendmidi(n,x,y,z)
 4850 ?miditop%=x
 4860 IFn>1 THEN ?miditop%=y
 4870 IFn>2 THEN ?miditop%=z
 4880 miditop%=miditop%+n
 4890ENDPROC
 4900:
 4910DEFPROCreaddata
 4920 RESTORE
 4930 FORstaves%=0TO7
 4940  FORR%=0TO7:READmidi%(staves%,R%):NEXT
 4950 NEXT
 4960 FORclef%=0TO1
 4970  FORnote%=0TO31
 4980   FORdata%=0TO1
 4990    READmidisend%(clef%,note%,data%)
 5000   NEXT
 5010  NEXT
 5020 NEXT
 5030 REM Below represents "Father Christmas Goes Down All Escalators Backwards!"
 5040 sharpseq%(0)=4:flatseq%(0)=2:REM A
 5050 sharpseq%(1)=6:flatseq%(1)=0:REM B
 5060 sharpseq%(2)=1:flatseq%(2)=5:REM C
 5070 sharpseq%(3)=3:flatseq%(3)=3:REM D
 5080 sharpseq%(4)=5:flatseq%(4)=1:REM E
 5090 sharpseq%(5)=0:flatseq%(5)=6:REM F
 5100 sharpseq%(6)=2:flatseq%(6)=4:REM G
 5110ENDPROC
 5120ENDPROC
 5130:
 5140REM MIDI Voice allocations to each queue
 5150DATA0,0,0,0,0,0,0,0
 5160DATA0,0,0,0,1,1,1,1
 5170DATA0,1,1,1,1,2,2,2
 5180DATA0,0,1,1,2,2,3,3
 5190DATA0,0,0,0,0,0,0,9
 5200DATA0,0,0,0,1,1,1,9
 5210DATA0,1,1,1,1,2,2,9
 5220DATA0,0,1,1,2,2,3,9
 5230:
 5240REM Treble Clef (Maestro line no/accidental --> MIDI Note)
 5250DATA0,7
 5260DATA45,0
 5270DATA47,1
 5280DATA48,2
 5290DATA50,3
 5300DATA52,4
 5310DATA53,5
 5320DATA55,6
 5330DATA57,0
 5340DATA59,1
 5350DATA60,2
 5360DATA62,3
 5370DATA64,4
 5380DATA65,5
 5390DATA67,6
 5400DATA69,0
 5410DATA71,1
 5420DATA72,2
 5430DATA74,3
 5440DATA76,4
 5450DATA77,5
 5460DATA79,6
 5470DATA81,0
 5480DATA83,1
 5490DATA84,2
 5500DATA86,3
 5510DATA88,4
 5520DATA89,5
 5530DATA91,6
 5540DATA93,0
 5550DATA95,1
 5560DATA96,2
 5570:
 5580REM Bass Clef (Maestro line no/accidental --> MIDI Note)
 5590DATA0,7
 5600DATA24,2
 5610DATA26,3
 5620DATA28,4
 5630DATA29,5
 5640DATA31,6
 5650DATA33,0
 5660DATA35,1
 5670DATA36,2
 5680DATA38,3
 5690DATA40,4
 5700DATA41,5
 5710DATA43,6
 5720DATA45,0
 5730DATA47,1
 5740DATA48,2
 5750DATA50,3
 5760DATA52,4
 5770DATA53,5
 5780DATA55,6
 5790DATA57,0
 5800DATA59,1
 5810DATA60,2
 5820DATA62,3
 5830DATA64,4
 5840DATA65,5
 5850DATA67,6
 5860DATA69,0
 5870DATA71,1
 5880DATA72,2
 5890DATA74,3
 5900DATA76,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%
�*�deltatime(&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
j�
t
 timer%=0
~ �
�  moveon=�:timer%=timer%+1
�
  �R%=0�7
�   �count%(R%)=1�
�    moveon=�
�D    �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%
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%
� 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)
6& dots%=�revbits(?(pos%(q%)+1),3,2)
@1 count%(q%)=�((2^(8-lenbits%))*4*(1.5^dots%))
J pos%(q%)=pos%(q%)+2
T�
^:
hݤrevbits(bits%,first%,no%)
r
 �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
�
:
��keysig
& keyflat=((type%�4)=4)
0% noaccidents%=�revbits(type%,3,3)
:
 �barline
D�
N:
X
��clefset
b �clef%,stave%
l clef%=(type%�16)�16
v- 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
  �
 �
�
 :
*!��changeaccstatus(key%,type%)
4 Ȏ type% �
>  � 1:accstatus%(key%)=0
H  � 2:accstatus%(key%)=1
R  � 3:accstatus%(key%)=-1
\ �
f�
p:
z��deltatime(n%)
��store%,bit
��:store%=0
�
 �bit=0�6
�&  �((n%�2)<>0)�store%=store%+2^bit
�
  n%=n%�2
� �
�5 ?miditop%=store%-128*(n%<>0):miditop%=miditop%+1
�	�n%=0
��
�:
���sendmidi(n,x,y,z)
� ?miditop%=x
� �n>1 � ?miditop%=y
 �n>2 � ?miditop%=z
 miditop%=miditop%+n
�
$:
.��readdata
8 �
B �staves%=0�7
L"  �R%=0�7:�midi%(staves%,R%):�
V �
` �clef%=0�1
j  �note%=0�31
t   �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
��
�

:
*� MIDI Voice allocations to each queue
�0,0,0,0,0,0,0,0
(�0,0,0,0,1,1,1,1
2�0,1,1,1,1,2,2,2
<�0,0,1,1,2,2,3,3
F�0,0,0,0,0,0,0,9
P�0,0,0,0,1,1,1,9
Z�0,1,1,1,1,2,2,9
d�0,0,1,1,2,2,3,9
n:
x<� 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
	�65,5
	�67,6
	�69,0
"	�71,1
,	�72,2
6	�74,3
@	�76,4
J	�77,5
T	�79,6
^	�81,0
h	�83,1
r	�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
�	�29,5
	�31,6
	�33,0
	�35,1
&	�36,2
0	�38,3
:	�40,4
D	�41,5
N	�43,6
X	�45,0
b	�47,1
l	�48,2
v	�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
	�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 53 50 41 43  |~space..P.?(SPAC|
00000120  45 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 2a f2 64  |%=miditop%...*.d|
00000af0  65 6c 74 61 74 69 6d 65  28 26 31 37 29 3a f2 73  |eltatime(&17):.s|
00000b00  65 6e 64 6d 69 64 69 28  33 2c 26 46 46 2c 26 32  |endmidi(3,&FF,&2|
00000b10  46 2c 30 29 0d 04 a6 53  6c 65 6e 67 74 68 3d 6d  |F,0)...Slength=m|
00000b20  69 64 69 74 6f 70 25 2d  73 74 61 72 74 3a 50 25  |iditop%-start:P%|
00000b30  3d 6c 65 6e 57 3a 5b 4f  50 54 30 3a 45 51 55 57  |=lenW:[OPT0:EQUW|
00000b40  30 3a 45 51 55 42 28 6c  65 6e 67 74 68 20 81 32  |0:EQUB(length .2|
00000b50  35 36 29 3a 45 51 55 42  28 6c 65 6e 67 74 68 20  |56):EQUB(length |
00000b60  80 32 35 35 29 3a 5d 0d  04 b0 2d ff 22 53 41 56  |.255):]...-."SAV|
00000b70  45 20 22 2b 66 69 6c 65  24 2b 22 20 22 2b c3 7e  |E "+file$+" "+.~|
00000b80  73 70 61 63 65 2b 22 20  22 2b c3 7e 6d 69 64 69  |space+" "+.~midi|
00000b90  74 6f 70 25 0d 04 ba 1c  ff 22 53 45 54 54 59 50  |top%....."SETTYP|
00000ba0  45 20 22 2b 66 69 6c 65  24 2b 22 20 46 44 34 22  |E "+file$+" FD4"|
00000bb0  0d 04 c4 18 6d 69 64 69  74 6f 70 25 3d 6d 69 64  |....miditop%=mid|
00000bc0  69 74 6f 70 6f 6c 64 25  0d 04 ce 07 f7 20 85 0d  |itopold%..... ..|
00000bd0  04 d8 05 e1 0d 04 e2 05  3a 0d 04 ec 0f dd f2 65  |........:......e|
00000be0  72 72 6f 72 28 65 24 29  0d 04 f6 09 21 65 25 3d  |rror(e$)....!e%=|
00000bf0  30 0d 05 00 11 24 28 65  25 2b 34 29 3d 65 24 2b  |0....$(e%+4)=e$+|
00000c00  bd 30 0d 05 0a 2b c8 99  20 22 57 69 6d 70 5f 52  |.0...+.. "Wimp_R|
00000c10  65 70 6f 72 74 45 72 72  6f 72 22 2c 65 25 2c 30  |eportError",e%,0|
00000c20  2c 22 4d 49 44 49 20 4d  61 6b 65 72 22 0d 05 14  |,"MIDI Maker"...|
00000c30  05 e1 0d 05 1e 05 3a 0d  05 28 11 dd a4 63 6f 6e  |......:..(...con|
00000c40  66 69 72 6d 28 6d 24 29  0d 05 32 08 ea 20 72 25  |firm(m$)..2.. r%|
00000c50  0d 05 3c 09 21 65 25 3d  30 0d 05 46 11 24 28 65  |..<.!e%=0..F.$(e|
00000c60  25 2b 34 29 3d 6d 24 2b  bd 30 0d 05 50 33 c8 99  |%+4)=m$+.0..P3..|
00000c70  20 22 57 69 6d 70 5f 52  65 70 6f 72 74 45 72 72  | "Wimp_ReportErr|
00000c80  6f 72 22 2c 65 25 2c 26  31 33 2c 22 4d 49 44 49  |or",e%,&13,"MIDI|
00000c90  20 4d 61 6b 65 72 22 20  b8 20 2c 72 25 0d 05 5a  | Maker" . ,r%..Z|
00000ca0  07 3d 72 25 0d 05 64 05  3a 0d 05 6e 16 dd f2 66  |.=r%..d.:..n...f|
00000cb0  61 75 6c 74 28 65 72 72  25 2c 65 72 72 24 29 0d  |ault(err%,err$).|
00000cc0  05 78 0c 21 65 25 3d 65  72 72 25 0d 05 82 13 24  |.x.!e%=err%....$|
00000cd0  28 65 25 2b 34 29 3d 65  72 72 24 2b bd 30 0d 05  |(e%+4)=err$+.0..|
00000ce0  8c 29 e7 65 72 72 25 3d  32 32 30 20 8c 20 24 28  |.).err%=220 . $(|
00000cf0  65 25 2b 34 29 3d 22 42  61 64 20 66 69 6c 65 6e  |e%+4)="Bad filen|
00000d00  61 6d 65 22 2b bd 30 0d  05 96 2b c8 99 20 22 57  |ame"+.0...+.. "W|
00000d10  69 6d 70 5f 52 65 70 6f  72 74 45 72 72 6f 72 22  |imp_ReportError"|
00000d20  2c 65 25 2c 30 2c 22 4d  49 44 49 20 4d 61 6b 65  |,e%,0,"MIDI Make|
00000d30  72 22 0d 05 a0 05 e1 0d  05 aa 05 3a 0d 05 b4 0d  |r".........:....|
00000d40  dd f2 63 6f 6e 76 65 72  74 0d 05 be 19 66 69 6c  |..convert....fil|
00000d50  65 24 3d a4 67 65 74 5f  73 74 72 28 71 25 2b 34  |e$=.get_str(q%+4|
00000d60  34 29 0d 05 c8 0f 74 79  70 65 25 3d 71 25 21 34  |4)....type%=q%!4|
00000d70  30 0d 05 d2 13 e7 20 74  79 70 65 25 3c 3e 26 41  |0..... type%<>&A|
00000d80  46 31 20 8c 0d 05 dc 59  20 21 74 78 74 25 3d 30  |F1 ....Y !txt%=0|
00000d90  3a 24 28 74 78 74 25 2b  34 29 3d 22 50 6c 65 61  |:$(txt%+4)="Plea|
00000da0  73 65 20 63 6f 6e 76 65  72 74 20 74 6f 20 61 20  |se convert to a |
00000db0  4d 61 65 73 74 72 6f 20  66 69 6c 65 20 62 65 66  |Maestro file bef|
00000dc0  6f 72 65 20 61 74 74 65  6d 70 74 69 6e 67 20 63  |ore attempting c|
00000dd0  6f 6e 76 65 72 73 69 6f  6e 22 2b bd 30 0d 05 e6  |onversion"+.0...|
00000de0  2e 20 c8 99 20 22 57 69  6d 70 5f 52 65 70 6f 72  |. .. "Wimp_Repor|
00000df0  74 45 72 72 6f 72 22 2c  74 78 74 25 2c 30 2c 22  |tError",txt%,0,"|
00000e00  4d 49 44 49 20 4d 61 6b  65 72 22 0d 05 f0 05 cc  |MIDI Maker".....|
00000e10  0d 05 fa 11 20 f2 64 6f  69 74 28 66 69 6c 65 24  |.... .doit(file$|
00000e20  29 0d 06 04 12 20 70 61  67 65 73 3d 70 61 67 65  |).... pages=page|
00000e30  73 2b 31 0d 06 0e 14 20  f2 69 63 6f 6e 28 b9 29  |s+1.... .icon(.)|
00000e40  3a f2 6d 65 6e 75 73 0d  06 18 05 cd 0d 06 22 05  |:.menus.......".|
00000e50  e1 0d 06 2c 05 3a 0d 06  36 11 dd a4 67 65 74 5f  |...,.:..6...get_|
00000e60  73 74 72 28 71 25 29 0d  06 40 0c ea 20 66 6e 24  |str(q%)..@.. fn$|
00000e70  2c 70 25 0d 06 4a 0f 70  25 3d 30 3a 66 6e 24 3d  |,p%..J.p%=0:fn$=|
00000e80  22 22 0d 06 54 05 f5 0d  06 5e 15 20 66 6e 24 3d  |""..T....^. fn$=|
00000e90  66 6e 24 2b bd 28 71 25  3f 70 25 29 0d 06 68 0c  |fn$+.(q%?p%)..h.|
00000ea0  20 70 25 3d 70 25 2b 31  0d 06 72 10 fd 20 28 71  | p%=p%+1..r.. (q|
00000eb0  25 3f 70 25 29 3c 33 32  0d 06 7c 08 3d 66 6e 24  |%?p%)<32..|.=fn$|
00000ec0  0d 06 86 05 3a 0d 06 90  0b dd f2 6d 65 6e 75 73  |....:......menus|
00000ed0  0d 06 9a 0d 20 f2 69 6e  66 6f 62 6f 78 0d 06 a4  |.... .infobox...|
00000ee0  0d 20 f2 73 61 76 65 62  6f 78 0d 06 ae 0e 20 f2  |. .savebox.... .|
00000ef0  6d 61 69 6e 6d 65 6e 75  0d 06 b8 05 e1 0d 06 c2  |mainmenu........|
00000f00  05 3a 0d 06 cc 0d dd f2  73 61 76 65 62 6f 78 0d  |.:......savebox.|
00000f10  06 d6 0f 20 6d 25 3d 6d  65 6e 75 73 70 25 0d 06  |... m%=menusp%..|
00000f20  e0 14 20 6d 25 21 32 38  3d 26 38 34 30 30 30 30  |.. m%!28=&840000|
00000f30  31 32 0d 06 ea 14 20 6d  25 21 33 32 3d 26 30 31  |12.... m%!32=&01|
00000f40  30 37 30 32 30 37 0d 06  f4 14 20 6d 25 21 33 36  |070207.... m%!36|
00000f50  3d 26 30 30 30 43 30 31  30 33 0d 06 fe 14 20 6d  |=&000C0103.... m|
00000f60  25 21 34 30 3d 30 3a 6d  25 21 34 34 3d 30 0d 07  |%!40=0:m%!44=0..|
00000f70  08 18 20 6d 25 21 34 38  3d 32 35 30 3a 6d 25 21  |.. m%!48=250:m%!|
00000f80  35 32 3d 31 36 30 0d 07  12 14 20 6d 25 21 35 36  |52=160.... m%!56|
00000f90  3d 26 30 30 30 30 30 30  31 39 0d 07 1c 14 20 6d  |=&00000019.... m|
00000fa0  25 21 36 30 3d 26 30 30  30 30 30 30 30 30 0d 07  |%!60=&00000000..|
00000fb0  26 20 20 6d 25 21 36 34  3d 31 3a 6d 25 21 36 38  |&  m%!64=1:m%!68|
00000fc0  3d 32 35 30 3a 6d 25 21  37 30 3d 31 36 30 0d 07  |=250:m%!70=160..|
00000fd0  30 1b 20 24 28 6d 25 2b  37 32 29 3d 22 53 61 76  |0. $(m%+72)="Sav|
00000fe0  65 20 61 73 3a 22 2b bd  30 0d 07 3a 0c 20 6d 25  |e as:"+.0..:. m%|
00000ff0  21 38 34 3d 33 0d 07 44  16 20 6d 25 21 38 38 3d  |!84=3..D. m%!88=|
00001000  31 35 3a 6d 25 21 39 32  3d 31 30 0d 07 4e 18 20  |15:m%!92=10..N. |
00001010  6d 25 21 39 36 3d 31 38  35 3a 6d 25 21 31 30 30  |m%!96=185:m%!100|
00001020  3d 35 35 0d 07 58 15 20  6d 25 21 31 30 34 3d 26  |=55..X. m%!104=&|
00001030  30 37 30 30 46 31 33 44  0d 07 62 12 20 6d 25 21  |0700F13D..b. m%!|
00001040  31 30 38 3d 6d 25 2b 32  35 30 0d 07 6c 12 20 6d  |108=m%+250..l. m|
00001050  25 21 31 31 32 3d 6d 25  2b 31 39 32 0d 07 76 0f  |%!112=m%+192..v.|
00001060  20 6d 25 21 31 31 36 3d  31 30 30 0d 07 80 18 20  | m%!116=100.... |
00001070  6d 25 21 31 32 30 3d 38  30 3a 6d 25 21 31 32 34  |m%!120=80:m%!124|
00001080  3d 38 30 0d 07 8a 1a 20  6d 25 21 31 32 38 3d 31  |=80.... m%!128=1|
00001090  34 35 3a 6d 25 21 31 33  32 3d 31 34 35 0d 07 94  |45:m%!132=145...|
000010a0  15 20 6d 25 21 31 33 36  3d 26 30 37 30 30 36 31  |. m%!136=&070061|
000010b0  31 41 0d 07 9e 12 20 6d  25 21 31 34 30 3d 6d 25  |1A.... m%!140=m%|
000010c0  2b 32 30 30 0d 07 a8 0d  20 6d 25 21 31 34 34 3d  |+200.... m%!144=|
000010d0  31 0d 07 b2 0d 20 6d 25  21 31 34 38 3d 31 0d 07  |1.... m%!148=1..|
000010e0  bc 19 20 6d 25 21 31 35  32 3d 31 39 35 3a 6d 25  |.. m%!152=195:m%|
000010f0  21 31 35 36 3d 31 30 0d  07 c6 19 20 6d 25 21 31  |!156=10.... m%!1|
00001100  36 30 3d 32 34 30 3a 6d  25 21 31 36 34 3d 35 35  |60=240:m%!164=55|
00001110  0d 07 d0 15 20 6d 25 21  31 36 38 3d 26 43 37 30  |.... m%!168=&C70|
00001120  31 39 30 33 44 0d 07 da  16 20 24 28 6d 25 2b 31  |1903D.... $(m%+1|
00001130  37 32 29 3d 22 4f 4b 22  2b bd 30 0d 07 e4 19 20  |72)="OK"+.0.... |
00001140  24 28 6d 25 2b 32 30 30  29 3d 22 66 69 6c 65 5f  |$(m%+200)="file_|
00001150  66 64 34 22 0d 07 ee 24  20 24 28 6d 25 2b 32 35  |fd4"...$ $(m%+25|
00001160  30 29 3d 66 69 6c 65 24  3a 73 61 76 65 74 78 74  |0)=file$:savetxt|
00001170  25 3d 6d 25 2b 32 35 30  0d 07 f8 20 20 21 28 6d  |%=m%+250...  !(m|
00001180  25 2b 31 34 38 29 3d 38  3a 73 61 76 65 6c 65 6e  |%+148)=8:savelen|
00001190  25 3d 6d 25 2b 31 34 38  0d 08 02 0d 20 6d 25 21  |%=m%+148.... m%!|
000011a0  31 39 32 3d 30 0d 08 0c  27 20 c8 99 20 22 57 69  |192=0...' .. "Wi|
000011b0  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
000011c0  2c 2c 6d 25 20 b8 20 73  61 76 65 25 0d 08 16 05  |,,m% . save%....|
000011d0  e1 0d 08 20 05 3a 0d 08  2a 0e dd f2 6d 61 69 6e  |... .:..*...main|
000011e0  6d 65 6e 75 0d 08 34 20  20 70 25 3d 6d 65 6e 75  |menu..4  p%=menu|
000011f0  73 70 25 2b 35 31 32 3a  6d 61 69 6e 6d 65 6e 75  |sp%+512:mainmenu|
00001200  25 3d 70 25 0d 08 3e 2f  20 24 70 25 3d 22 4d 49  |%=p%..>/ $p%="MI|
00001210  44 49 20 4d 61 6b 65 72  22 2b bd 30 3a 70 25 21  |DI Maker"+.0:p%!|
00001220  31 32 3d 26 37 30 32 30  37 3a 70 25 21 31 36 3d  |12=&70207:p%!16=|
00001230  32 30 30 0d 08 48 1e 20  70 25 21 32 30 3d 34 30  |200..H. p%!20=40|
00001240  3a 70 25 21 32 34 3d 30  3a 66 25 3d 70 25 2b 32  |:p%!24=0:f%=p%+2|
00001250  38 0d 08 52 3e 20 21 66  25 3d 30 3a 66 25 21 34  |8..R> !f%=0:f%!4|
00001260  3d 69 6e 66 6f 25 3a 66  25 21 38 3d 26 30 37 30  |=info%:f%!8=&070|
00001270  30 30 30 31 31 3a 24 28  66 25 2b 31 32 29 3d 22  |00011:$(f%+12)="|
00001280  49 6e 66 6f 22 2b bd 30  3a 66 25 2b 3d 32 34 0d  |Info"+.0:f%+=24.|
00001290  08 5c 31 20 e7 70 61 67  65 73 3d 30 8c 66 25 21  |.\1 .pages=0.f%!|
000012a0  38 3d 32 5e 32 32 2b 26  30 37 30 30 30 30 31 31  |8=2^22+&07000011|
000012b0  20 8b 66 25 21 38 3d 26  30 37 30 30 30 30 31 31  | .f%!8=&07000011|
000012c0  0d 08 66 34 20 21 66 25  3d 30 3a 66 25 21 34 3d  |..f4 !f%=0:f%!4=|
000012d0  73 61 76 65 25 3a 24 28  66 25 2b 31 32 29 3d 22  |save%:$(f%+12)="|
000012e0  4d 61 6b 65 20 4d 49 44  49 22 2b bd 30 3a 66 25  |Make MIDI"+.0:f%|
000012f0  2b 3d 32 34 0d 08 70 31  20 e7 70 61 67 65 73 3d  |+=24..p1 .pages=|
00001300  30 8c 66 25 21 38 3d 32  5e 32 32 2b 26 30 37 30  |0.f%!8=2^22+&070|
00001310  30 30 30 31 31 20 8b 66  25 21 38 3d 26 30 37 30  |00011 .f%!8=&070|
00001320  30 33 30 31 31 0d 08 7a  2d 20 21 66 25 3d 30 3a  |03011..z- !f%=0:|
00001330  66 25 21 34 3d 2d 31 3a  24 28 66 25 2b 31 32 29  |f%!4=-1:$(f%+12)|
00001340  3d 22 43 6c 65 61 72 22  2b bd 30 3a 66 25 2b 3d  |="Clear"+.0:f%+=|
00001350  32 34 0d 08 84 3d 20 21  66 25 3d 26 38 30 3a 66  |24...= !f%=&80:f|
00001360  25 21 34 3d 2d 31 3a 66  25 21 38 3d 26 30 37 30  |%!4=-1:f%!8=&070|
00001370  30 33 30 31 31 3a 24 28  66 25 2b 31 32 29 3d 22  |03011:$(f%+12)="|
00001380  51 75 69 74 22 2b bd 30  3a 66 25 2b 3d 32 34 0d  |Quit"+.0:f%+=24.|
00001390  08 8e 05 e1 0d 08 98 05  3a 0d 08 a2 10 dd f2 68  |........:......h|
000013a0  61 6e 64 6c 65 6d 65 6e  75 0d 08 ac 0c 20 ea 20  |andlemenu.... . |
000013b0  61 25 2c 6c 25 0d 08 b6  0d 20 c8 8e 20 21 71 25  |a%,l%.... .. !q%|
000013c0  20 ca 0d 08 c0 0a 20 20  20 c9 20 32 0d 08 ca 3c  | .....   . 2...<|
000013d0  20 20 20 20 61 25 3d a4  63 6f 6e 66 69 72 6d 28  |    a%=.confirm(|
000013e0  22 57 69 70 65 20 70 72  6f 63 65 73 73 65 64 20  |"Wipe processed |
000013f0  6d 75 73 69 63 2e 2e 2e  20 41 72 65 20 79 6f 75  |music... Are you|
00001400  20 73 75 72 65 3f 22 29  0d 08 d4 27 20 20 20 20  | sure?")...'    |
00001410  e7 20 61 25 3d 31 20 8c  20 f2 63 6c 65 61 72 3a  |. a%=1 . .clear:|
00001420  f2 69 63 6f 6e 28 b9 29  3a f2 6d 65 6e 75 73 0d  |.icon(.):.menus.|
00001430  08 de 0a 20 20 20 c9 20  33 0d 08 e8 08 20 20 20  |...   . 3....   |
00001440  e0 0d 08 f2 06 20 cb 0d  08 fc 21 20 c8 99 20 22  |..... ....! .. "|
00001450  57 69 6d 70 5f 47 65 74  50 6f 69 6e 74 65 72 49  |Wimp_GetPointerI|
00001460  6e 66 6f 22 2c 2c 71 25  0d 09 06 22 20 e7 20 28  |nfo",,q%..." . (|
00001470  28 71 25 21 38 29 20 80  20 31 29 3d 31 20 8c 20  |(q%!8) . 1)=1 . |
00001480  f2 6f 70 65 6e 5f 6d 65  6e 75 0d 09 10 05 e1 0d  |.open_menu......|
00001490  09 1a 05 3a 0d 09 24 0d  dd f2 69 6e 66 6f 62 6f  |...:..$...infobo|
000014a0  78 0d 09 2e 0b ea 20 73  25 2c 69 25 0d 09 38 0e  |x..... s%,i%..8.|
000014b0  73 25 3d 69 6e 66 6f 73  70 25 0d 09 42 13 73 25  |s%=infosp%..B.s%|
000014c0  21 32 38 3d 26 38 34 30  30 30 30 31 32 0d 09 4c  |!28=&84000012..L|
000014d0  12 73 25 21 33 32 3d 26  31 30 37 30 32 30 37 0d  |.s%!32=&1070207.|
000014e0  09 56 10 73 25 21 33 36  3d 26 32 30 31 30 33 0d  |.V.s%!36=&20103.|
000014f0  09 60 14 73 25 21 34 30  3d 32 30 3a 73 25 21 34  |.`.s%!40=20:s%!4|
00001500  34 3d 30 0d 09 6a 17 73  25 21 34 38 3d 36 33 36  |4=0..j.s%!48=636|
00001510  3a 73 25 21 35 32 3d 32  31 36 0d 09 74 13 73 25  |:s%!52=216..t.s%|
00001520  21 35 36 3d 26 30 30 30  30 30 31 31 39 0d 09 7e  |!56=&00000119..~|
00001530  13 73 25 21 36 30 3d 26  30 30 30 30 30 30 30 30  |.s%!60=&00000000|
00001540  0d 09 88 0b 73 25 21 36  34 3d 31 0d 09 92 0d 73  |....s%!64=1....s|
00001550  25 21 36 38 3d 36 31 36  0d 09 9c 0d 73 25 21 37  |%!68=616....s%!7|
00001560  30 3d 32 31 36 0d 09 a6  10 73 25 21 37 32 3d 73  |0=216....s%!72=s|
00001570  25 2b 35 32 38 0d 09 b0  10 73 25 21 37 36 3d 73  |%+528....s%!76=s|
00001580  25 2b 33 39 30 0d 09 ba  0c 73 25 21 38 30 3d 33  |%+390....s%!80=3|
00001590  32 0d 09 c4 0b 73 25 21  38 34 3d 38 0d 09 ce 0c  |2....s%!84=8....|
000015a0  69 25 3d 73 25 2b 38 38  0d 09 d8 11 21 69 25 3d  |i%=s%+88....!i%=|
000015b0  33 32 3a 69 25 21 34 3d  38 0d 09 e2 15 69 25 21  |32:i%!4=8....i%!|
000015c0  38 3d 31 38 34 3a 69 25  21 31 32 3d 35 36 0d 09  |8=184:i%!12=56..|
000015d0  ec 13 69 25 21 31 36 3d  26 30 37 30 30 30 32 31  |..i%!16=&0700021|
000015e0  31 0d 09 f6 1a 24 28 69  25 2b 32 30 29 3d 22 56  |1....$(i%+20)="V|
000015f0  65 72 73 69 6f 6e 3a 22  2b bd 30 0d 0a 00 0a 69  |ersion:"+.0....i|
00001600  25 2b 3d 33 32 0d 0a 0a  12 21 69 25 3d 31 38 38  |%+=32....!i%=188|
00001610  3a 69 25 21 34 3d 38 0d  0a 14 15 69 25 21 38 3d  |:i%!4=8....i%!8=|
00001620  36 33 32 3a 69 25 21 31  32 3d 35 36 0d 0a 1e 13  |632:i%!12=56....|
00001630  69 25 21 31 36 3d 26 30  37 30 30 30 31 33 44 0d  |i%!16=&0700013D.|
00001640  0a 28 10 69 25 21 32 30  3d 73 25 2b 34 30 30 0d  |.(.i%!20=s%+400.|
00001650  0a 32 10 69 25 21 32 34  3d 73 25 2b 33 39 30 0d  |.2.i%!24=s%+390.|
00001660  0a 3c 0c 69 25 21 32 38  3d 33 30 0d 0a 46 0a 69  |.<.i%!28=30..F.i|
00001670  25 2b 3d 33 32 0d 0a 50  12 21 69 25 3d 33 32 3a  |%+=32..P.!i%=32:|
00001680  69 25 21 34 3d 36 30 0d  0a 5a 16 69 25 21 38 3d  |i%!4=60..Z.i%!8=|
00001690  31 38 34 3a 69 25 21 31  32 3d 31 30 38 0d 0a 64  |184:i%!12=108..d|
000016a0  13 69 25 21 31 36 3d 26  30 37 30 30 30 32 31 31  |.i%!16=&07000211|
000016b0  0d 0a 6e 19 24 28 69 25  2b 32 30 29 3d 22 41 75  |..n.$(i%+20)="Au|
000016c0  74 68 6f 72 3a 22 2b bd  30 0d 0a 78 0a 69 25 2b  |thor:"+.0..x.i%+|
000016d0  3d 33 32 0d 0a 82 13 21  69 25 3d 31 38 38 3a 69  |=32....!i%=188:i|
000016e0  25 21 34 3d 36 30 0d 0a  8c 16 69 25 21 38 3d 36  |%!4=60....i%!8=6|
000016f0  33 32 3a 69 25 21 31 32  3d 31 30 38 0d 0a 96 13  |32:i%!12=108....|
00001700  69 25 21 31 36 3d 26 30  37 30 30 30 31 33 44 0d  |i%!16=&0700013D.|
00001710  0a a0 10 69 25 21 32 30  3d 73 25 2b 34 33 32 0d  |...i%!20=s%+432.|
00001720  0a aa 10 69 25 21 32 34  3d 73 25 2b 33 39 30 0d  |...i%!24=s%+390.|
00001730  0a b4 0c 69 25 21 32 38  3d 33 30 0d 0a be 0a 69  |...i%!28=30....i|
00001740  25 2b 3d 33 32 0d 0a c8  13 21 69 25 3d 33 32 3a  |%+=32....!i%=32:|
00001750  69 25 21 34 3d 31 31 32  0d 0a d2 16 69 25 21 38  |i%!4=112....i%!8|
00001760  3d 31 38 34 3a 69 25 21  31 32 3d 31 36 30 0d 0a  |=184:i%!12=160..|
00001770  dc 13 69 25 21 31 36 3d  26 30 37 30 30 30 32 31  |..i%!16=&0700021|
00001780  31 0d 0a e6 1a 24 28 69  25 2b 32 30 29 3d 22 50  |1....$(i%+20)="P|
00001790  75 72 70 6f 73 65 3a 22  2b bd 30 0d 0a f0 0a 69  |urpose:"+.0....i|
000017a0  25 2b 3d 33 32 0d 0a fa  14 21 69 25 3d 31 38 38  |%+=32....!i%=188|
000017b0  3a 69 25 21 34 3d 31 31  32 0d 0b 04 16 69 25 21  |:i%!4=112....i%!|
000017c0  38 3d 36 33 32 3a 69 25  21 31 32 3d 31 36 30 0d  |8=632:i%!12=160.|
000017d0  0b 0e 13 69 25 21 31 36  3d 26 30 37 30 30 30 31  |...i%!16=&070001|
000017e0  33 44 0d 0b 18 10 69 25  21 32 30 3d 73 25 2b 34  |3D....i%!20=s%+4|
000017f0  36 34 0d 0b 22 10 69 25  21 32 34 3d 73 25 2b 33  |64..".i%!24=s%+3|
00001800  39 30 0d 0b 2c 0c 69 25  21 32 38 3d 33 30 0d 0b  |90..,.i%!28=30..|
00001810  36 0a 69 25 2b 3d 33 32  0d 0b 40 13 21 69 25 3d  |6.i%+=32..@.!i%=|
00001820  33 32 3a 69 25 21 34 3d  31 36 34 0d 0b 4a 16 69  |32:i%!4=164..J.i|
00001830  25 21 38 3d 31 38 34 3a  69 25 21 31 32 3d 32 31  |%!8=184:i%!12=21|
00001840  32 0d 0b 54 13 69 25 21  31 36 3d 26 30 37 30 30  |2..T.i%!16=&0700|
00001850  30 32 31 31 0d 0b 5e 17  24 28 69 25 2b 32 30 29  |0211..^.$(i%+20)|
00001860  3d 22 4e 61 6d 65 3a 22  2b bd 30 0d 0b 68 0a 69  |="Name:"+.0..h.i|
00001870  25 2b 3d 33 32 0d 0b 72  14 21 69 25 3d 31 38 38  |%+=32..r.!i%=188|
00001880  3a 69 25 21 34 3d 31 36  34 0d 0b 7c 16 69 25 21  |:i%!4=164..|.i%!|
00001890  38 3d 36 33 32 3a 69 25  21 31 32 3d 32 31 32 0d  |8=632:i%!12=212.|
000018a0  0b 86 13 69 25 21 31 36  3d 26 30 37 30 30 30 31  |...i%!16=&070001|
000018b0  33 44 0d 0b 90 10 69 25  21 32 30 3d 73 25 2b 34  |3D....i%!20=s%+4|
000018c0  39 36 0d 0b 9a 10 69 25  21 32 34 3d 73 25 2b 33  |96....i%!24=s%+3|
000018d0  39 30 0d 0b a4 0c 69 25  21 32 38 3d 33 30 0d 0b  |90....i%!28=30..|
000018e0  ae 0c 73 25 21 33 39 30  3d 30 0d 0b b8 22 24 28  |..s%!390=0..."$(|
000018f0  73 25 2b 34 30 30 29 3d  22 31 2e 30 30 20 28 38  |s%+400)="1.00 (8|
00001900  2d 41 75 67 2d 39 39 29  22 2b bd 30 0d 0b c2 27  |-Aug-99)"+.0...'|
00001910  24 28 73 25 2b 34 33 32  29 3d 22 a9 20 44 6f 6d  |$(s%+432)=". Dom|
00001920  69 6e 69 63 20 46 6f 72  64 2c 20 31 39 39 39 22  |inic Ford, 1999"|
00001930  2b bd 30 0d 0b cc 22 24  28 73 25 2b 34 36 34 29  |+.0..."$(s%+464)|
00001940  3d 22 4d 61 65 73 74 72  6f 20 74 6f 20 4d 49 44  |="Maestro to MID|
00001950  49 22 2b bd 30 0d 0b d6  1d 24 28 73 25 2b 34 39  |I"+.0....$(s%+49|
00001960  36 29 3d 22 4d 49 44 49  20 4d 61 6b 65 72 22 2b  |6)="MIDI Maker"+|
00001970  bd 30 0d 0b e0 25 24 28  73 25 2b 35 32 38 29 3d  |.0...%$(s%+528)=|
00001980  22 41 62 6f 75 74 20 74  68 69 73 20 70 72 6f 67  |"About this prog|
00001990  72 61 6d 22 2b bd 30 0d  0b ea 26 c8 99 20 22 57  |ram"+.0...&.. "W|
000019a0  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
000019b0  22 2c 2c 73 25 20 b8 20  69 6e 66 6f 25 0d 0b f4  |",,s% . info%...|
000019c0  05 e1 0d 0b fe 05 3a 0d  0c 08 0f dd f2 6f 70 65  |......:......ope|
000019d0  6e 5f 6d 65 6e 75 0d 0c  12 31 20 c8 99 20 22 57  |n_menu...1 .. "W|
000019e0  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
000019f0  2c 6d 61 69 6e 6d 65 6e  75 25 2c 28 21 71 25 29  |,mainmenu%,(!q%)|
00001a00  2d 36 34 2c 31 36 30 0d  0c 1c 05 e1 0d 0c 26 05  |-64,160.......&.|
00001a10  3a 0d 0c 30 12 dd f2 69  63 6f 6e 28 72 65 64 72  |:..0...icon(redr|
00001a20  61 77 29 0d 0c 3a 0f 73  70 25 3d 69 63 6f 6e 73  |aw)..:.sp%=icons|
00001a30  70 25 0d 0c 44 0e e7 20  72 65 64 72 61 77 20 8c  |p%..D.. redraw .|
00001a40  0d 0c 4e 18 20 21 73 70  25 3d 2d 31 3a 73 70 25  |..N. !sp%=-1:sp%|
00001a50  21 34 3d 69 63 6f 6e 25  0d 0c 58 1e 20 c8 99 20  |!4=icon%..X. .. |
00001a60  22 57 69 6d 70 5f 44 65  6c 65 74 65 49 63 6f 6e  |"Wimp_DeleteIcon|
00001a70  22 2c 2c 73 70 25 0d 0c  62 05 cd 0d 0c 6c 0b 21  |",,sp%..b....l.!|
00001a80  73 70 25 3d 2d 31 0d 0c  76 0b 73 70 25 21 34 3d  |sp%=-1..v.sp%!4=|
00001a90  30 0d 0c 80 0d 73 70 25  21 38 3d 2d 31 36 0d 0c  |0....sp%!8=-16..|
00001aa0  8a 18 73 70 25 21 31 32  3d 31 32 38 3a 73 70 25  |..sp%!12=128:sp%|
00001ab0  21 31 36 3d 38 34 0d 0c  94 14 73 70 25 21 32 30  |!16=84....sp%!20|
00001ac0  3d 26 31 37 30 30 33 31  30 42 0d 0c 9e 11 73 70  |=&1700310B....sp|
00001ad0  25 21 32 34 3d 73 70 25  2b 34 30 0d 0c a8 11 73  |%!24=sp%+40....s|
00001ae0  70 25 21 32 38 3d 73 70  25 2b 38 30 0d 0c b2 0d  |p%!28=sp%+80....|
00001af0  73 70 25 21 33 32 3d 33  32 0d 0c bc 23 e7 20 70  |sp%!32=32...#. p|
00001b00  61 67 65 73 3d 30 20 8c  20 24 28 73 70 25 2b 34  |ages=0 . $(sp%+4|
00001b10  30 29 3d 22 49 64 6c 65  22 2b bd 30 0d 0c c6 25  |0)="Idle"+.0...%|
00001b20  e7 20 70 61 67 65 73 3d  31 20 8c 20 24 28 73 70  |. pages=1 . $(sp|
00001b30  25 2b 34 30 29 3d 22 31  20 70 61 67 65 22 2b bd  |%+40)="1 page"+.|
00001b40  30 0d 0c d0 2c e7 20 70  61 67 65 73 3e 31 20 8c  |0...,. pages>1 .|
00001b50  20 24 28 73 70 25 2b 34  30 29 3d c3 70 61 67 65  | $(sp%+40)=.page|
00001b60  73 2b 22 20 70 61 67 65  73 22 2b bd 30 0d 0c da  |s+" pages"+.0...|
00001b70  1d 24 28 73 70 25 2b 38  30 29 3d 22 53 21 6d 61  |.$(sp%+80)="S!ma|
00001b80  6b 65 6d 69 64 69 22 2b  bd 30 0d 0c e4 25 c8 99  |kemidi"+.0...%..|
00001b90  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
00001ba0  6e 22 2c 2c 73 70 25 20  b8 20 69 63 6f 6e 25 0d  |n",,sp% . icon%.|
00001bb0  0c ee 05 e1 0d 0c f8 05  3a 0d 0d 02 17 f4 20 43  |........:..... C|
00001bc0  4f 4e 56 45 52 53 49 4f  4e 20 45 4e 47 49 4e 45  |ONVERSION ENGINE|
00001bd0  0d 0d 0c 05 3a 0d 0d 16  15 dd f2 64 6f 69 74 28  |....:......doit(|
00001be0  66 69 6c 65 6e 61 6d 65  24 29 0d 0d 20 14 c8 99  |filename$).. ...|
00001bf0  22 48 6f 75 72 67 6c 61  73 73 5f 4f 6e 22 0d 0d  |"Hourglass_On"..|
00001c00  2a 0e f2 6c 6f 61 64 6d  75 73 69 63 0d 0d 34 11  |*..loadmusic..4.|
00001c10  f2 64 6f 63 6f 6e 76 65  72 73 69 6f 6e 0d 0d 3e  |.doconversion..>|
00001c20  15 c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 4f 66  |..."Hourglass_Of|
00001c30  66 22 0d 0d 48 05 e1 0d  0d 52 05 3a 0d 0d 5c 12  |f"..H....R.:..\.|
00001c40  dd f2 73 65 74 75 70 63  6f 6e 76 65 72 74 0d 0d  |..setupconvert..|
00001c50  66 0d de 20 53 20 26 39  30 30 30 0d 0d 70 50 de  |f.. S &9000..pP.|
00001c60  20 71 75 65 75 65 25 28  37 29 2c 63 6c 65 66 25  | queue%(7),clef%|
00001c70  28 37 29 2c 6e 6f 74 65  25 28 37 29 2c 63 6f 75  |(7),note%(7),cou|
00001c80  6e 74 25 28 37 29 2c 70  6f 73 25 28 37 29 2c 6d  |nt%(7),pos%(7),m|
00001c90  69 64 69 25 28 37 2c 37  29 2c 6d 69 64 69 73 65  |idi%(7,7),midise|
00001ca0  6e 64 25 28 31 2c 33 31  2c 31 29 0d 0d 7a 2b de  |nd%(1,31,1)..z+.|
00001cb0  61 63 63 73 74 61 74 75  73 25 28 37 29 2c 73 68  |accstatus%(7),sh|
00001cc0  61 72 70 73 65 71 25 28  36 29 2c 66 6c 61 74 73  |arpseq%(6),flats|
00001cd0  65 71 25 28 36 29 0d 0d  84 0d f2 72 65 61 64 64  |eq%(6).....readd|
00001ce0  61 74 61 0d 0d 8e 05 e1  0d 0d 98 05 3a 0d 0d a2  |ata.........:...|
00001cf0  0f dd f2 6c 6f 61 64 6d  75 73 69 63 0d 0d ac 15  |...loadmusic....|
00001d00  46 49 4c 45 25 3d 8e 20  66 69 6c 65 6e 61 6d 65  |FILE%=. filename|
00001d10  24 0d 0d b6 20 4d 24 3d  22 22 3a e3 52 25 3d 31  |$... M$="":.R%=1|
00001d20  b8 37 3a 4d 24 2b 3d bd  9a 23 46 49 4c 45 25 3a  |.7:M$+=..#FILE%:|
00001d30  ed 0d 0d c0 2f e7 4d 24  3c 3e 22 4d 61 65 73 74  |..../.M$<>"Maest|
00001d40  72 6f 22 8c f1 22 4d 61  65 73 74 72 6f 20 66 69  |ro".."Maestro fi|
00001d50  6c 65 20 69 73 20 63 6f  72 72 75 70 74 22 3a e0  |le is corrupt":.|
00001d60  0d 0d ca 26 42 25 3d 9a  23 46 49 4c 45 25 3a 42  |...&B%=.#FILE%:B|
00001d70  32 25 3d 9a 23 46 49 4c  45 25 3a 42 33 25 3d 9a  |2%=.#FILE%:B3%=.|
00001d80  23 46 49 4c 45 25 0d 0d  d4 83 e7 42 25 3c 3e 26  |#FILE%.....B%<>&|
00001d90  41 20 84 42 32 25 3c 3e  32 20 84 42 33 25 3c 3e  |A .B2%<>2 .B3%<>|
00001da0  31 8c f1 22 54 68 69 73  20 4d 61 65 73 74 72 6f  |1.."This Maestro|
00001db0  20 66 69 6c 65 20 69 73  20 69 6e 20 61 20 6e 6f  | file is in a no|
00001dc0  6e 2d 73 74 61 6e 64 61  72 64 20 66 6f 72 6d 61  |n-standard forma|
00001dd0  74 2e 20 50 6c 65 61 73  65 20 6c 6f 61 64 20 69  |t. Please load i|
00001de0  74 20 69 6e 74 6f 20 4d  61 65 73 74 72 6f 20 61  |t into Maestro a|
00001df0  6e 64 20 20 72 65 73 61  76 65 20 69 74 2e 22 3a  |nd  resave it.":|
00001e00  d9 23 46 49 4c 45 25 3a  e0 0d 0d de 2f e8 23 46  |.#FILE%:..../.#F|
00001e10  49 4c 45 25 2c 67 61 74  65 73 25 3a e3 52 25 3d  |ILE%,gates%:.R%=|
00001e20  30 b8 37 3a e8 23 46 49  4c 45 25 2c 71 75 65 75  |0.7:.#FILE%,queu|
00001e30  65 25 28 52 25 29 3a ed  0d 0d e8 22 e3 52 25 3d  |e%(R%):....".R%=|
00001e40  31 b8 67 61 74 65 73 25  3a 3f 28 53 2b 52 25 29  |1.gates%:?(S+R%)|
00001e50  3d 9a 23 46 49 4c 45 25  3a ed 0d 0d f2 0b e3 56  |=.#FILE%:......V|
00001e60  25 3d 30 b8 37 0d 0d fc  45 20 e7 71 75 65 75 65  |%=0.7...E .queue|
00001e70  25 28 56 25 29 3c 3e 30  8c e3 52 25 3d 31 b8 71  |%(V%)<>0..R%=1.q|
00001e80  75 65 75 65 25 28 56 25  29 3a 3f 28 53 2b 52 25  |ueue%(V%):?(S+R%|
00001e90  2b 26 31 30 30 30 2a 56  25 2b 26 31 30 30 30 29  |+&1000*V%+&1000)|
00001ea0  3d 9a 23 46 49 4c 45 25  3a ed 0d 0e 06 05 ed 0d  |=.#FILE%:.......|
00001eb0  0e 10 7e 42 25 3d 9a 23  46 49 4c 45 25 3a e7 42  |..~B%=.#FILE%:.B|
00001ec0  25 3c 3e 32 20 8c f1 22  54 68 69 73 20 4d 61 65  |%<>2 .."This Mae|
00001ed0  73 74 72 6f 20 66 69 6c  65 20 69 73 20 69 6e 20  |stro file is in |
00001ee0  61 20 6e 6f 6e 2d 73 74  61 6e 64 61 72 64 20 66  |a non-standard f|
00001ef0  6f 72 6d 61 74 2e 20 50  6c 65 61 73 65 20 6c 6f  |ormat. Please lo|
00001f00  61 64 20 69 74 20 69 6e  74 6f 20 4d 61 65 73 74  |ad it into Maest|
00001f10  72 6f 20 61 6e 64 20 20  72 65 73 61 76 65 20 69  |ro and  resave i|
00001f20  74 2e 22 3a d9 23 46 49  4c 45 25 3a e0 0d 0e 1a  |t.":.#FILE%:....|
00001f30  1d 73 74 61 76 65 73 25  3d 9a 23 46 49 4c 45 25  |.staves%=.#FILE%|
00001f40  2b 34 2a 9a 23 46 49 4c  45 25 0d 0e 24 0b d9 23  |+4*.#FILE%..$..#|
00001f50  46 49 4c 45 25 0d 0e 2e  05 e1 0d 0e 38 05 3a 0d  |FILE%.......8.:.|
00001f60  0e 42 12 dd f2 64 6f 63  6f 6e 76 65 72 73 69 6f  |.B...doconversio|
00001f70  6e 0d 0e 4c 51 e3 52 25  3d 30 b8 37 3a 70 6f 73  |n..LQ.R%=0.7:pos|
00001f80  25 28 52 25 29 3d 53 2b  26 31 30 30 30 2a 52 25  |%(R%)=S+&1000*R%|
00001f90  2b 26 31 30 30 31 3a 63  6c 65 66 25 28 52 25 29  |+&1001:clef%(R%)|
00001fa0  3d 30 3a 63 6f 75 6e 74  25 28 52 25 29 3d 30 3a  |=0:count%(R%)=0:|
00001fb0  61 63 63 73 74 61 74 75  73 25 28 52 25 29 3d 30  |accstatus%(R%)=0|
00001fc0  3a ed 0d 0e 56 25 6b 65  79 66 6c 61 74 3d a3 3a  |:...V%keyflat=.:|
00001fd0  6e 6f 61 63 63 69 64 65  6e 74 73 25 3d 30 3a f2  |noaccidents%=0:.|
00001fe0  62 61 72 6c 69 6e 65 0d  0e 60 25 70 6f 73 69 74  |barline..`%posit|
00001ff0  69 6f 6e 25 3d 53 2b 31  3a 74 69 6d 65 72 25 3d  |ion%=S+1:timer%=|
00002000  30 3a f2 72 65 61 64 67  61 74 65 73 0d 0e 6a 05  |0:.readgates..j.|
00002010  f5 0d 0e 74 0d 20 74 69  6d 65 72 25 3d 30 0d 0e  |...t. timer%=0..|
00002020  7e 06 20 f5 0d 0e 88 1e  20 20 6d 6f 76 65 6f 6e  |~. .....  moveon|
00002030  3d a3 3a 74 69 6d 65 72  25 3d 74 69 6d 65 72 25  |=.:timer%=timer%|
00002040  2b 31 0d 0e 92 0d 20 20  e3 52 25 3d 30 b8 37 0d  |+1....  .R%=0.7.|
00002050  0e 9c 15 20 20 20 e7 63  6f 75 6e 74 25 28 52 25  |...   .count%(R%|
00002060  29 3d 31 8c 0d 0e a6 10  20 20 20 20 6d 6f 76 65  |)=1.....    move|
00002070  6f 6e 3d b9 0d 0e b0 44  20 20 20 20 e7 6e 6f 74  |on=....D    .not|
00002080  65 25 28 52 25 29 3c 3e  30 8c f2 73 65 6e 64 6d  |e%(R%)<>0..sendm|
00002090  69 64 69 28 33 2c 26 38  30 2b 6d 69 64 69 25 28  |idi(3,&80+midi%(|
000020a0  73 74 61 76 65 73 25 2c  52 25 29 2c 6e 6f 74 65  |staves%,R%),note|
000020b0  25 28 52 25 29 2c 30 29  0d 0e ba 08 20 20 20 cd  |%(R%),0)....   .|
000020c0  0d 0e c4 2d 20 20 20 e7  63 6f 75 6e 74 25 28 52  |...-   .count%(R|
000020d0  25 29 3c 3e 30 8c 63 6f  75 6e 74 25 28 52 25 29  |%)<>0.count%(R%)|
000020e0  3d 63 6f 75 6e 74 25 28  52 25 29 2d 31 0d 0e ce  |=count%(R%)-1...|
000020f0  07 20 20 ed 0d 0e d8 13  20 20 e3 77 61 69 74 3d  |.  .....  .wait=|
00002100  30 b8 31 32 35 3a ed 0d  0e e2 0d 20 fd 20 6d 6f  |0.125:..... . mo|
00002110  76 65 6f 6e 0d 0e ec 0f  20 f2 72 65 61 64 67 61  |veon.... .readga|
00002120  74 65 73 0d 0e f6 39 20  c8 99 22 48 6f 75 72 67  |tes...9 .."Hourg|
00002130  6c 61 73 73 5f 50 65 72  63 65 6e 74 61 67 65 22  |lass_Percentage"|
00002140  2c a8 28 28 70 6f 73 69  74 69 6f 6e 25 2d 53 29  |,.((position%-S)|
00002150  2f 67 61 74 65 73 25 2a  31 30 30 29 0d 0f 00 19  |/gates%*100)....|
00002160  fd 70 6f 73 69 74 69 6f  6e 25 3e 28 67 61 74 65  |.position%>(gate|
00002170  73 25 2b 53 29 0d 0f 0a  05 e1 0d 0f 14 05 3a 0d  |s%+S).........:.|
00002180  0f 1e 0f dd f2 72 65 61  64 67 61 74 65 73 0d 0f  |.....readgates..|
00002190  28 0a ea 74 79 70 65 25  0d 0f 32 15 20 74 79 70  |(..type%..2. typ|
000021a0  65 25 3d 3f 70 6f 73 69  74 69 6f 6e 25 0d 0f 3c  |e%=?position%..<|
000021b0  0f 20 e7 20 74 79 70 65  25 3d 30 8c 0d 0f 46 34  |. . type%=0...F4|
000021c0  20 20 f2 73 70 65 63 69  61 6c 28 3f 28 70 6f 73  |  .special(?(pos|
000021d0  69 74 69 6f 6e 25 2b 31  29 29 3a 70 6f 73 69 74  |ition%+1)):posit|
000021e0  69 6f 6e 25 3d 70 6f 73  69 74 69 6f 6e 25 2b 32  |ion%=position%+2|
000021f0  0d 0f 50 29 20 20 e7 ac  28 70 6f 73 69 74 69 6f  |..P)  ..(positio|
00002200  6e 25 3e 28 67 61 74 65  73 25 2b 53 29 29 8c f2  |n%>(gates%+S))..|
00002210  72 65 61 64 67 61 74 65  73 0d 0f 5a 06 20 cc 0d  |readgates..Z. ..|
00002220  0f 64 2c 20 20 f2 61 64  64 6e 6f 74 65 73 28 74  |.d,  .addnotes(t|
00002230  79 70 65 25 29 3a 70 6f  73 69 74 69 6f 6e 25 3d  |ype%):position%=|
00002240  70 6f 73 69 74 69 6f 6e  25 2b 31 0d 0f 6e 06 20  |position%+1..n. |
00002250  cd 0d 0f 78 05 e1 0d 0f  82 05 3a 0d 0f 8c 17 dd  |...x......:.....|
00002260  f2 61 64 64 6e 6f 74 65  73 28 71 75 65 75 65 73  |.addnotes(queues|
00002270  25 29 0d 0f 96 07 ea 52  25 0d 0f a0 0c 20 e3 52  |%).....R%.... .R|
00002280  25 3d 30 b8 37 0d 0f aa  22 20 20 e7 28 71 75 65  |%=0.7..."  .(que|
00002290  75 65 73 25 83 32 29 3d  31 8c f2 67 65 74 71 75  |ues%.2)=1..getqu|
000022a0  65 75 65 28 52 25 29 0d  0f b4 17 20 20 71 75 65  |eue(R%)....  que|
000022b0  75 65 73 25 3d 71 75 65  75 65 73 25 81 32 0d 0f  |ues%=queues%.2..|
000022c0  be 06 20 ed 0d 0f c8 05  e1 0d 0f d2 05 3a 0d 0f  |.. ..........:..|
000022d0  dc 12 dd f2 67 65 74 71  75 65 75 65 28 71 25 29  |....getqueue(q%)|
000022e0  0d 0f e6 2f ea 6e 6f 74  65 70 6f 73 25 2c 6e 6f  |.../.notepos%,no|
000022f0  74 65 25 2c 61 63 63 69  64 65 6e 74 61 6c 73 25  |te%,accidentals%|
00002300  2c 6c 65 6e 62 69 74 73  25 2c 64 6f 74 73 25 0d  |,lenbits%,dots%.|
00002310  0f f0 1b 20 6e 6f 74 65  70 6f 73 25 3d 28 3f 70  |... notepos%=(?p|
00002320  6f 73 25 28 71 25 29 29  81 38 0d 0f fa 2d 20 61  |os%(q%)).8...- a|
00002330  63 63 69 64 65 6e 74 61  6c 73 25 3d a4 72 65 76  |ccidentals%=.rev|
00002340  62 69 74 73 28 3f 28 70  6f 73 25 28 71 25 29 2b  |bits(?(pos%(q%)+|
00002350  31 29 2c 30 2c 33 29 0d  10 04 54 20 e7 61 63 63  |1),0,3)...T .acc|
00002360  69 64 65 6e 74 61 6c 73  25 3c 3e 30 8c f2 63 68  |identals%<>0..ch|
00002370  61 6e 67 65 61 63 63 73  74 61 74 75 73 28 6d 69  |angeaccstatus(mi|
00002380  64 69 73 65 6e 64 25 28  63 6c 65 66 25 28 71 25  |disend%(clef%(q%|
00002390  29 2c 6e 6f 74 65 70 6f  73 25 2c 31 29 2c 61 63  |),notepos%,1),ac|
000023a0  63 69 64 65 6e 74 61 6c  73 25 29 0d 10 0e 56 20  |cidentals%)...V |
000023b0  6e 6f 74 65 25 3d 6d 69  64 69 73 65 6e 64 25 28  |note%=midisend%(|
000023c0  63 6c 65 66 25 28 71 25  29 2c 6e 6f 74 65 70 6f  |clef%(q%),notepo|
000023d0  73 25 2c 30 29 2b 61 63  63 73 74 61 74 75 73 25  |s%,0)+accstatus%|
000023e0  28 6d 69 64 69 73 65 6e  64 25 28 63 6c 65 66 25  |(midisend%(clef%|
000023f0  28 71 25 29 2c 6e 6f 74  65 70 6f 73 25 2c 31 29  |(q%),notepos%,1)|
00002400  29 0d 10 18 3c 20 e7 20  6e 6f 74 65 25 3c 3e 30  |)...< . note%<>0|
00002410  8c f2 73 65 6e 64 6d 69  64 69 28 33 2c 26 39 30  |..sendmidi(3,&90|
00002420  2b 6d 69 64 69 25 28 73  74 61 76 65 73 25 2c 71  |+midi%(staves%,q|
00002430  25 29 2c 6e 6f 74 65 25  2c 26 33 46 29 0d 10 22  |%),note%,&3F).."|
00002440  14 20 6e 6f 74 65 25 28  71 25 29 3d 6e 6f 74 65  |. note%(q%)=note|
00002450  25 0d 10 2c 29 20 6c 65  6e 62 69 74 73 25 3d a4  |%..,) lenbits%=.|
00002460  72 65 76 62 69 74 73 28  3f 28 70 6f 73 25 28 71  |revbits(?(pos%(q|
00002470  25 29 2b 31 29 2c 35 2c  33 29 0d 10 36 26 20 64  |%)+1),5,3)..6& d|
00002480  6f 74 73 25 3d a4 72 65  76 62 69 74 73 28 3f 28  |ots%=.revbits(?(|
00002490  70 6f 73 25 28 71 25 29  2b 31 29 2c 33 2c 32 29  |pos%(q%)+1),3,2)|
000024a0  0d 10 40 31 20 63 6f 75  6e 74 25 28 71 25 29 3d  |..@1 count%(q%)=|
000024b0  a8 28 28 32 5e 28 38 2d  6c 65 6e 62 69 74 73 25  |.((2^(8-lenbits%|
000024c0  29 29 2a 34 2a 28 31 2e  35 5e 64 6f 74 73 25 29  |))*4*(1.5^dots%)|
000024d0  29 0d 10 4a 18 20 70 6f  73 25 28 71 25 29 3d 70  |)..J. pos%(q%)=p|
000024e0  6f 73 25 28 71 25 29 2b  32 0d 10 54 05 e1 0d 10  |os%(q%)+2..T....|
000024f0  5e 05 3a 0d 10 68 1f dd  a4 72 65 76 62 69 74 73  |^.:..h...revbits|
00002500  28 62 69 74 73 25 2c 66  69 72 73 74 25 2c 6e 6f  |(bits%,first%,no|
00002510  25 29 0d 10 72 0d 20 ea  52 25 2c 6f 75 74 25 0d  |%)..r. .R%,out%.|
00002520  10 7c 0b 20 6f 75 74 25  3d 30 0d 10 86 10 20 e3  |.|. out%=0.... .|
00002530  52 25 3d 30 b8 6e 6f 25  2d 31 0d 10 90 33 20 20  |R%=0.no%-1...3  |
00002540  6f 75 74 25 3d 6f 75 74  25 2d 28 32 5e 52 25 29  |out%=out%-(2^R%)|
00002550  2a 28 28 62 69 74 73 25  80 28 32 5e 28 66 69 72  |*((bits%.(2^(fir|
00002560  73 74 25 2b 52 25 29 29  29 3c 3e 30 29 0d 10 9a  |st%+R%)))<>0)...|
00002570  06 20 ed 0d 10 a4 09 3d  6f 75 74 25 0d 10 ae 05  |. .....=out%....|
00002580  3a 0d 10 b8 14 dd f2 73  70 65 63 69 61 6c 28 74  |:......special(t|
00002590  79 70 65 25 29 0d 10 c2  19 20 e7 28 74 79 70 65  |ype%).... .(type|
000025a0  25 80 31 29 3d 31 8c f2  74 69 6d 73 69 67 0d 10  |%.1)=1..timsig..|
000025b0  cc 19 20 e7 28 74 79 70  65 25 80 33 29 3d 32 8c  |.. .(type%.3)=2.|
000025c0  f2 6b 65 79 73 69 67 0d  10 d6 1a 20 e7 28 74 79  |.keysig.... .(ty|
000025d0  70 65 25 80 37 29 3d 34  8c f2 63 6c 65 66 73 65  |pe%.7)=4..clefse|
000025e0  74 0d 10 e0 1c 20 e7 28  74 79 70 65 25 80 36 33  |t.... .(type%.63|
000025f0  29 3d 33 32 8c f2 62 61  72 6c 69 6e 65 0d 10 ea  |)=32..barline...|
00002600  05 e1 0d 10 f4 05 3a 0d  10 fe 0c dd f2 74 69 6d  |......:......tim|
00002610  73 69 67 0d 11 08 05 e1  0d 11 12 05 3a 0d 11 1c  |sig.........:...|
00002620  0c dd f2 6b 65 79 73 69  67 0d 11 26 1a 20 6b 65  |...keysig..&. ke|
00002630  79 66 6c 61 74 3d 28 28  74 79 70 65 25 80 34 29  |yflat=((type%.4)|
00002640  3d 34 29 0d 11 30 25 20  6e 6f 61 63 63 69 64 65  |=4)..0% noaccide|
00002650  6e 74 73 25 3d a4 72 65  76 62 69 74 73 28 74 79  |nts%=.revbits(ty|
00002660  70 65 25 2c 33 2c 33 29  0d 11 3a 0d 20 f2 62 61  |pe%,3,3)..:. .ba|
00002670  72 6c 69 6e 65 0d 11 44  05 e1 0d 11 4e 05 3a 0d  |rline..D....N.:.|
00002680  11 58 0d dd f2 63 6c 65  66 73 65 74 0d 11 62 12  |.X...clefset..b.|
00002690  20 ea 63 6c 65 66 25 2c  73 74 61 76 65 25 0d 11  | .clef%,stave%..|
000026a0  6c 18 20 63 6c 65 66 25  3d 28 74 79 70 65 25 80  |l. clef%=(type%.|
000026b0  31 36 29 81 31 36 0d 11  76 2d 20 73 74 61 76 65  |16).16..v- stave|
000026c0  25 3d 28 28 74 79 70 65  25 80 33 32 29 81 33 32  |%=((type%.32).32|
000026d0  29 2a 32 2b 28 28 74 79  70 65 25 80 36 34 29 81  |)*2+((type%.64).|
000026e0  36 34 29 0d 11 80 0c 20  e3 52 25 3d 30 b8 37 0d  |64).... .R%=0.7.|
000026f0  11 8a 30 20 20 e7 6d 69  64 69 25 28 73 74 61 76  |..0  .midi%(stav|
00002700  65 73 25 2c 52 25 29 3d  73 74 61 76 65 25 20 8c  |es%,R%)=stave% .|
00002710  63 6c 65 66 25 28 52 25  29 3d 63 6c 65 66 25 0d  |clef%(R%)=clef%.|
00002720  11 94 06 20 ed 0d 11 9e  05 e1 0d 11 a8 05 3a 0d  |... ..........:.|
00002730  11 b2 0d dd f2 62 61 72  6c 69 6e 65 0d 11 bc 10  |.....barline....|
00002740  20 e7 20 6b 65 79 66 6c  61 74 20 8c 0d 11 c6 0d  | . keyflat .....|
00002750  20 20 e3 52 25 3d 30 b8  36 0d 11 d0 45 20 20 20  |  .R%=0.6...E   |
00002760  e7 66 6c 61 74 73 65 71  25 28 52 25 29 3c 6e 6f  |.flatseq%(R%)<no|
00002770  61 63 63 69 64 65 6e 74  73 25 8c 61 63 63 73 74  |accidents%.accst|
00002780  61 74 75 73 25 28 52 25  29 3d 2d 31 20 8b 61 63  |atus%(R%)=-1 .ac|
00002790  63 73 74 61 74 75 73 25  28 52 25 29 3d 30 0d 11  |cstatus%(R%)=0..|
000027a0  da 07 20 20 ed 0d 11 e4  06 20 cc 0d 11 ee 0d 20  |..  ..... ..... |
000027b0  20 e3 52 25 3d 30 b8 36  0d 11 f8 45 20 20 20 e7  | .R%=0.6...E   .|
000027c0  73 68 61 72 70 73 65 71  25 28 52 25 29 3c 6e 6f  |sharpseq%(R%)<no|
000027d0  61 63 63 69 64 65 6e 74  73 25 8c 61 63 63 73 74  |accidents%.accst|
000027e0  61 74 75 73 25 28 52 25  29 3d 31 20 8b 61 63 63  |atus%(R%)=1 .acc|
000027f0  73 74 61 74 75 73 25 28  52 25 29 3d 30 0d 12 02  |status%(R%)=0...|
00002800  07 20 20 ed 0d 12 0c 06  20 cd 0d 12 16 05 e1 0d  |.  ..... .......|
00002810  12 20 05 3a 0d 12 2a 21  dd f2 63 68 61 6e 67 65  |. .:..*!..change|
00002820  61 63 63 73 74 61 74 75  73 28 6b 65 79 25 2c 74  |accstatus(key%,t|
00002830  79 70 65 25 29 0d 12 34  0f 20 c8 8e 20 74 79 70  |ype%)..4. .. typ|
00002840  65 25 20 ca 0d 12 3e 1c  20 20 c9 20 31 3a 61 63  |e% ...>.  . 1:ac|
00002850  63 73 74 61 74 75 73 25  28 6b 65 79 25 29 3d 30  |cstatus%(key%)=0|
00002860  0d 12 48 1c 20 20 c9 20  32 3a 61 63 63 73 74 61  |..H.  . 2:accsta|
00002870  74 75 73 25 28 6b 65 79  25 29 3d 31 0d 12 52 1d  |tus%(key%)=1..R.|
00002880  20 20 c9 20 33 3a 61 63  63 73 74 61 74 75 73 25  |  . 3:accstatus%|
00002890  28 6b 65 79 25 29 3d 2d  31 0d 12 5c 06 20 cb 0d  |(key%)=-1..\. ..|
000028a0  12 66 05 e1 0d 12 70 05  3a 0d 12 7a 13 dd f2 64  |.f....p.:..z...d|
000028b0  65 6c 74 61 74 69 6d 65  28 6e 25 29 0d 12 84 0f  |eltatime(n%)....|
000028c0  ea 73 74 6f 72 65 25 2c  62 69 74 0d 12 8e 0e f5  |.store%,bit.....|
000028d0  3a 73 74 6f 72 65 25 3d  30 0d 12 98 0d 20 e3 62  |:store%=0.... .b|
000028e0  69 74 3d 30 b8 36 0d 12  a2 26 20 20 e7 28 28 6e  |it=0.6...&  .((n|
000028f0  25 83 32 29 3c 3e 30 29  8c 73 74 6f 72 65 25 3d  |%.2)<>0).store%=|
00002900  73 74 6f 72 65 25 2b 32  5e 62 69 74 0d 12 ac 0d  |store%+2^bit....|
00002910  20 20 6e 25 3d 6e 25 81  32 0d 12 b6 06 20 ed 0d  |  n%=n%.2.... ..|
00002920  12 c0 35 20 3f 6d 69 64  69 74 6f 70 25 3d 73 74  |..5 ?miditop%=st|
00002930  6f 72 65 25 2d 31 32 38  2a 28 6e 25 3c 3e 30 29  |ore%-128*(n%<>0)|
00002940  3a 6d 69 64 69 74 6f 70  25 3d 6d 69 64 69 74 6f  |:miditop%=midito|
00002950  70 25 2b 31 0d 12 ca 09  fd 6e 25 3d 30 0d 12 d4  |p%+1.....n%=0...|
00002960  05 e1 0d 12 de 05 3a 0d  12 e8 17 dd f2 73 65 6e  |......:......sen|
00002970  64 6d 69 64 69 28 6e 2c  78 2c 79 2c 7a 29 0d 12  |dmidi(n,x,y,z)..|
00002980  f2 10 20 3f 6d 69 64 69  74 6f 70 25 3d 78 0d 12  |.. ?miditop%=x..|
00002990  fc 17 20 e7 6e 3e 31 20  8c 20 3f 6d 69 64 69 74  |.. .n>1 . ?midit|
000029a0  6f 70 25 3d 79 0d 13 06  17 20 e7 6e 3e 32 20 8c  |op%=y.... .n>2 .|
000029b0  20 3f 6d 69 64 69 74 6f  70 25 3d 7a 0d 13 10 18  | ?miditop%=z....|
000029c0  20 6d 69 64 69 74 6f 70  25 3d 6d 69 64 69 74 6f  | miditop%=midito|
000029d0  70 25 2b 6e 0d 13 1a 05  e1 0d 13 24 05 3a 0d 13  |p%+n.......$.:..|
000029e0  2e 0e dd f2 72 65 61 64  64 61 74 61 0d 13 38 06  |....readdata..8.|
000029f0  20 f7 0d 13 42 11 20 e3  73 74 61 76 65 73 25 3d  | ...B. .staves%=|
00002a00  30 b8 37 0d 13 4c 22 20  20 e3 52 25 3d 30 b8 37  |0.7..L"  .R%=0.7|
00002a10  3a f3 6d 69 64 69 25 28  73 74 61 76 65 73 25 2c  |:.midi%(staves%,|
00002a20  52 25 29 3a ed 0d 13 56  06 20 ed 0d 13 60 0f 20  |R%):...V. ...`. |
00002a30  e3 63 6c 65 66 25 3d 30  b8 31 0d 13 6a 11 20 20  |.clef%=0.1..j.  |
00002a40  e3 6e 6f 74 65 25 3d 30  b8 33 31 0d 13 74 11 20  |.note%=0.31..t. |
00002a50  20 20 e3 64 61 74 61 25  3d 30 b8 31 0d 13 7e 25  |  .data%=0.1..~%|
00002a60  20 20 20 20 f3 6d 69 64  69 73 65 6e 64 25 28 63  |    .midisend%(c|
00002a70  6c 65 66 25 2c 6e 6f 74  65 25 2c 64 61 74 61 25  |lef%,note%,data%|
00002a80  29 0d 13 88 08 20 20 20  ed 0d 13 92 07 20 20 ed  |)....   .....  .|
00002a90  0d 13 9c 06 20 ed 0d 13  a6 4e 20 f4 20 42 65 6c  |.... ....N . Bel|
00002aa0  6f 77 20 72 65 70 72 65  73 65 6e 74 73 20 22 46  |ow represents "F|
00002ab0  61 74 68 65 72 20 43 68  72 69 73 74 6d 61 73 20  |ather Christmas |
00002ac0  47 6f 65 73 20 44 6f 77  6e 20 41 6c 6c 20 45 73  |Goes Down All Es|
00002ad0  63 61 6c 61 74 6f 72 73  20 42 61 63 6b 77 61 72  |calators Backwar|
00002ae0  64 73 21 22 0d 13 b0 25  20 73 68 61 72 70 73 65  |ds!"...% sharpse|
00002af0  71 25 28 30 29 3d 34 3a  66 6c 61 74 73 65 71 25  |q%(0)=4:flatseq%|
00002b00  28 30 29 3d 32 3a f4 20  41 0d 13 ba 25 20 73 68  |(0)=2:. A...% sh|
00002b10  61 72 70 73 65 71 25 28  31 29 3d 36 3a 66 6c 61  |arpseq%(1)=6:fla|
00002b20  74 73 65 71 25 28 31 29  3d 30 3a f4 20 42 0d 13  |tseq%(1)=0:. B..|
00002b30  c4 25 20 73 68 61 72 70  73 65 71 25 28 32 29 3d  |.% sharpseq%(2)=|
00002b40  31 3a 66 6c 61 74 73 65  71 25 28 32 29 3d 35 3a  |1:flatseq%(2)=5:|
00002b50  f4 20 43 0d 13 ce 25 20  73 68 61 72 70 73 65 71  |. C...% sharpseq|
00002b60  25 28 33 29 3d 33 3a 66  6c 61 74 73 65 71 25 28  |%(3)=3:flatseq%(|
00002b70  33 29 3d 33 3a f4 20 44  0d 13 d8 25 20 73 68 61  |3)=3:. D...% sha|
00002b80  72 70 73 65 71 25 28 34  29 3d 35 3a 66 6c 61 74  |rpseq%(4)=5:flat|
00002b90  73 65 71 25 28 34 29 3d  31 3a f4 20 45 0d 13 e2  |seq%(4)=1:. E...|
00002ba0  25 20 73 68 61 72 70 73  65 71 25 28 35 29 3d 30  |% sharpseq%(5)=0|
00002bb0  3a 66 6c 61 74 73 65 71  25 28 35 29 3d 36 3a f4  |:flatseq%(5)=6:.|
00002bc0  20 46 0d 13 ec 25 20 73  68 61 72 70 73 65 71 25  | F...% sharpseq%|
00002bd0  28 36 29 3d 32 3a 66 6c  61 74 73 65 71 25 28 36  |(6)=2:flatseq%(6|
00002be0  29 3d 34 3a f4 20 47 0d  13 f6 05 e1 0d 14 00 05  |)=4:. G.........|
00002bf0  e1 0d 14 0a 05 3a 0d 14  14 2a f4 20 4d 49 44 49  |.....:...*. MIDI|
00002c00  20 56 6f 69 63 65 20 61  6c 6c 6f 63 61 74 69 6f  | Voice allocatio|
00002c10  6e 73 20 74 6f 20 65 61  63 68 20 71 75 65 75 65  |ns to each queue|
00002c20  0d 14 1e 14 dc 30 2c 30  2c 30 2c 30 2c 30 2c 30  |.....0,0,0,0,0,0|
00002c30  2c 30 2c 30 0d 14 28 14  dc 30 2c 30 2c 30 2c 30  |,0,0..(..0,0,0,0|
00002c40  2c 31 2c 31 2c 31 2c 31  0d 14 32 14 dc 30 2c 31  |,1,1,1,1..2..0,1|
00002c50  2c 31 2c 31 2c 31 2c 32  2c 32 2c 32 0d 14 3c 14  |,1,1,1,2,2,2..<.|
00002c60  dc 30 2c 30 2c 31 2c 31  2c 32 2c 32 2c 33 2c 33  |.0,0,1,1,2,2,3,3|
00002c70  0d 14 46 14 dc 30 2c 30  2c 30 2c 30 2c 30 2c 30  |..F..0,0,0,0,0,0|
00002c80  2c 30 2c 39 0d 14 50 14  dc 30 2c 30 2c 30 2c 30  |,0,9..P..0,0,0,0|
00002c90  2c 31 2c 31 2c 31 2c 39  0d 14 5a 14 dc 30 2c 31  |,1,1,1,9..Z..0,1|
00002ca0  2c 31 2c 31 2c 31 2c 32  2c 32 2c 39 0d 14 64 14  |,1,1,1,2,2,9..d.|
00002cb0  dc 30 2c 30 2c 31 2c 31  2c 32 2c 32 2c 33 2c 39  |.0,0,1,1,2,2,3,9|
00002cc0  0d 14 6e 05 3a 0d 14 78  3c f4 20 54 72 65 62 6c  |..n.:..x<. Trebl|
00002cd0  65 20 43 6c 65 66 20 28  4d 61 65 73 74 72 6f 20  |e Clef (Maestro |
00002ce0  6c 69 6e 65 20 6e 6f 2f  61 63 63 69 64 65 6e 74  |line no/accident|
00002cf0  61 6c 20 2d 2d 3e 20 4d  49 44 49 20 4e 6f 74 65  |al --> MIDI Note|
00002d00  29 0d 14 82 08 dc 30 2c  37 0d 14 8c 09 dc 34 35  |).....0,7.....45|
00002d10  2c 30 0d 14 96 09 dc 34  37 2c 31 0d 14 a0 09 dc  |,0.....47,1.....|
00002d20  34 38 2c 32 0d 14 aa 09  dc 35 30 2c 33 0d 14 b4  |48,2.....50,3...|
00002d30  09 dc 35 32 2c 34 0d 14  be 09 dc 35 33 2c 35 0d  |..52,4.....53,5.|
00002d40  14 c8 09 dc 35 35 2c 36  0d 14 d2 09 dc 35 37 2c  |....55,6.....57,|
00002d50  30 0d 14 dc 09 dc 35 39  2c 31 0d 14 e6 09 dc 36  |0.....59,1.....6|
00002d60  30 2c 32 0d 14 f0 09 dc  36 32 2c 33 0d 14 fa 09  |0,2.....62,3....|
00002d70  dc 36 34 2c 34 0d 15 04  09 dc 36 35 2c 35 0d 15  |.64,4.....65,5..|
00002d80  0e 09 dc 36 37 2c 36 0d  15 18 09 dc 36 39 2c 30  |...67,6.....69,0|
00002d90  0d 15 22 09 dc 37 31 2c  31 0d 15 2c 09 dc 37 32  |.."..71,1..,..72|
00002da0  2c 32 0d 15 36 09 dc 37  34 2c 33 0d 15 40 09 dc  |,2..6..74,3..@..|
00002db0  37 36 2c 34 0d 15 4a 09  dc 37 37 2c 35 0d 15 54  |76,4..J..77,5..T|
00002dc0  09 dc 37 39 2c 36 0d 15  5e 09 dc 38 31 2c 30 0d  |..79,6..^..81,0.|
00002dd0  15 68 09 dc 38 33 2c 31  0d 15 72 09 dc 38 34 2c  |.h..83,1..r..84,|
00002de0  32 0d 15 7c 09 dc 38 36  2c 33 0d 15 86 09 dc 38  |2..|..86,3.....8|
00002df0  38 2c 34 0d 15 90 09 dc  38 39 2c 35 0d 15 9a 09  |8,4.....89,5....|
00002e00  dc 39 31 2c 36 0d 15 a4  09 dc 39 33 2c 30 0d 15  |.91,6.....93,0..|
00002e10  ae 09 dc 39 35 2c 31 0d  15 b8 09 dc 39 36 2c 32  |...95,1.....96,2|
00002e20  0d 15 c2 05 3a 0d 15 cc  3a f4 20 42 61 73 73 20  |....:...:. Bass |
00002e30  43 6c 65 66 20 28 4d 61  65 73 74 72 6f 20 6c 69  |Clef (Maestro li|
00002e40  6e 65 20 6e 6f 2f 61 63  63 69 64 65 6e 74 61 6c  |ne no/accidental|
00002e50  20 2d 2d 3e 20 4d 49 44  49 20 4e 6f 74 65 29 0d  | --> MIDI Note).|
00002e60  15 d6 08 dc 30 2c 37 0d  15 e0 09 dc 32 34 2c 32  |....0,7.....24,2|
00002e70  0d 15 ea 09 dc 32 36 2c  33 0d 15 f4 09 dc 32 38  |.....26,3.....28|
00002e80  2c 34 0d 15 fe 09 dc 32  39 2c 35 0d 16 08 09 dc  |,4.....29,5.....|
00002e90  33 31 2c 36 0d 16 12 09  dc 33 33 2c 30 0d 16 1c  |31,6.....33,0...|
00002ea0  09 dc 33 35 2c 31 0d 16  26 09 dc 33 36 2c 32 0d  |..35,1..&..36,2.|
00002eb0  16 30 09 dc 33 38 2c 33  0d 16 3a 09 dc 34 30 2c  |.0..38,3..:..40,|
00002ec0  34 0d 16 44 09 dc 34 31  2c 35 0d 16 4e 09 dc 34  |4..D..41,5..N..4|
00002ed0  33 2c 36 0d 16 58 09 dc  34 35 2c 30 0d 16 62 09  |3,6..X..45,0..b.|
00002ee0  dc 34 37 2c 31 0d 16 6c  09 dc 34 38 2c 32 0d 16  |.47,1..l..48,2..|
00002ef0  76 09 dc 35 30 2c 33 0d  16 80 09 dc 35 32 2c 34  |v..50,3.....52,4|
00002f00  0d 16 8a 09 dc 35 33 2c  35 0d 16 94 09 dc 35 35  |.....53,5.....55|
00002f10  2c 36 0d 16 9e 09 dc 35  37 2c 30 0d 16 a8 09 dc  |,6.....57,0.....|
00002f20  35 39 2c 31 0d 16 b2 09  dc 36 30 2c 32 0d 16 bc  |59,1.....60,2...|
00002f30  09 dc 36 32 2c 33 0d 16  c6 09 dc 36 34 2c 34 0d  |..62,3.....64,4.|
00002f40  16 d0 09 dc 36 35 2c 35  0d 16 da 09 dc 36 37 2c  |....65,5.....67,|
00002f50  36 0d 16 e4 09 dc 36 39  2c 30 0d 16 ee 09 dc 37  |6.....69,0.....7|
00002f60  31 2c 31 0d 16 f8 09 dc  37 32 2c 32 0d 17 02 09  |1,1.....72,2....|
00002f70  dc 37 34 2c 33 0d 17 0c  09 dc 37 36 2c 34 0d ff  |.74,3.....76,4..|
00002f80