Home » Personal collection » Acorn hard disk » files » music » !ScoreOCR/Old/!RunIO2

!ScoreOCR/Old/!RunIO2

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: !ScoreOCR/Old/!RunIO2
Read OK:
File size: 2A2F bytes
Load address: 0000
Exec address: 0000
File contents
   10REM !ScoreOCR
   20REM LEN Dominic Ford, 1999
   30:
   40ON ERROR !txt%=0:$(txt%+4)=REPORT$+" at line "+STR$ERL+CHR$0:SYS "Wimp_ReportError",txt%,0,"ScoreOCR":END
   50DIM q% 256,menusp% &1000,iconsp% 256,infosp% &400,txt% 256
   60DIM stave(32,5),nolines(32)
   70DIM notex%(32,5,100),notev%(32,5,100),notep%(32,5,100),notes%(32,5),nfile%(32,5)
   80DIM start(32),stop(32)
   90DIM space 16,sarea &80000,queue%(7)
  100:
  110REM stave = y position of stave line
  120REM nolines = number of lines in stave (usually 5)
  130REM notex% = x position of filed note on stave
  140REM notev% = length of note (0=breve, 7=hdsquaver)
  150REM notep% = line position of note (yet to be coded to Maestro/MIDI form)
  160REM notes% = no of notes files on stave/line
  170REM nfile% = used in the filing as counter
  180REM start/stop = left/right of stave on the page
  190:
  200SYS "Wimp_Initialise",200,&4B534154,"ScoreOCR"
  210PROCicon
  220PROCmenus
  230 REPEAT
  240  SYS "Wimp_Poll",0,q% TO a%
  250  CASE a% OF
  260   WHEN 6
  270    IF q%!12=-2 AND q%!16=icon% AND q%!8=2 THEN PROCopen_menu
  280   WHEN 9
  290    PROChandlemenu
  300   WHEN 17,18
  310    CASE q%!16 OF
  320     WHEN 0
  330      END
  340     WHEN 3
  350      IF q%!20=-2 AND q%!24=icon% THEN
  360       PROCocrrequest
  370       SYS "Wimp_CreateMenu",-1
  380       q%!16=3
  390      ENDIF
  400    ENDCASE
  410  ENDCASE
  420 UNTIL FALSE
  430:
  440DEFPROCocrrequest
  450file$=FNget_str(q%+44)
  460type%=q%!40
  470IF type%<>&FF9 THEN
  480 !txt%=0:$(txt%+4)="Please convert to a sprite file before attempting to OCR"+CHR$0
  490 SYS "Wimp_ReportError",txt%,0,"ScoreOCR"
  500ELSE
  510 MODE0
  520 REM SYS "Wimp_SlotSize",640,-1
  530 PROCdoocr(file$)
  540 REM SYS "Wimp_SlotSize",32,-1
  550 PRINT"Press any key to return to the desktop..."
  560 A$=GET$
  570 MODE12:MOUSE ON:OSCLI"<Obey$Dir>.!Palette"
  580 SYS "Wimp_ForceRedraw",-1,0,0,1280,1024
  590ENDIF
  600ENDPROC
  610:
  620DEFFNget_str(q%)
  630LOCAL fn$,p%
  640p%=0:fn$=""
  650REPEAT
  660 fn$=fn$+CHR$(q%?p%)
  670 p%=p%+1
  680UNTIL (q%?p%)<32
  690=fn$
  700:
  710DEFPROCmenus
  720 PROCinfobox
  730 p%=menusp%
  740 $p%="ScoreOCR"+CHR$0:p%!12=&70207:p%!16=200
  750 p%!20=40:p%!24=0:f%=p%+28
  760 !f%=0:f%!4=info%:f%!8=&07000011:$(f%+12)="Info"+CHR$0:f%+=24
  770 !f%=&80:f%!4=-1:f%!8=&07003011:$(f%+12)="Quit"+CHR$0
  780ENDPROC
  790:
  800DEFPROChandlemenu
  810 LOCAL a%,l%
  820 CASE !q% OF
  830   WHEN 1
  840   END
  850 ENDCASE
  860 SYS "Wimp_GetPointerInfo",,q%
  870 IF ((q%!8) AND 1)=1 THEN PROCopen_menu
  880ENDPROC
  890:
  900DEFPROCinfobox
  910LOCAL s%,i%
  920s%=infosp%
  930s%!28=&84000012
  940s%!32=&1070207
  950s%!36=&20103
  960s%!40=20:s%!44=0
  970s%!48=636:s%!52=216
  980s%!56=&00000119
  990s%!60=&00000000
 1000s%!64=1
 1010s%!68=616
 1020s%!70=216
 1030s%!72=s%+528
 1040s%!76=s%+390
 1050s%!80=32
 1060s%!84=8
 1070i%=s%+88
 1080!i%=32:i%!4=8
 1090i%!8=184:i%!12=56
 1100i%!16=&07000211
 1110$(i%+20)="Version:"+CHR$0
 1120i%+=32
 1130!i%=188:i%!4=8
 1140i%!8=632:i%!12=56
 1150i%!16=&0700013D
 1160i%!20=s%+400
 1170i%!24=s%+390
 1180i%!28=30
 1190i%+=32
 1200!i%=32:i%!4=60
 1210i%!8=184:i%!12=108
 1220i%!16=&07000211
 1230$(i%+20)="Author:"+CHR$0
 1240i%+=32
 1250!i%=188:i%!4=60
 1260i%!8=632:i%!12=108
 1270i%!16=&0700013D
 1280i%!20=s%+432
 1290i%!24=s%+390
 1300i%!28=30
 1310i%+=32
 1320!i%=32:i%!4=112
 1330i%!8=184:i%!12=160
 1340i%!16=&07000211
 1350$(i%+20)="Purpose:"+CHR$0
 1360i%+=32
 1370!i%=188:i%!4=112
 1380i%!8=632:i%!12=160
 1390i%!16=&0700013D
 1400i%!20=s%+464
 1410i%!24=s%+390
 1420i%!28=30
 1430i%+=32
 1440!i%=32:i%!4=164
 1450i%!8=184:i%!12=212
 1460i%!16=&07000211
 1470$(i%+20)="Name:"+CHR$0
 1480i%+=32
 1490!i%=188:i%!4=164
 1500i%!8=632:i%!12=212
 1510i%!16=&0700013D
 1520i%!20=s%+496
 1530i%!24=s%+390
 1540i%!28=30
 1550s%!390=0
 1560$(s%+400)="1.00 (28-Jul-99)"+CHR$0
 1570$(s%+432)="� Dominic Ford, 1999"+CHR$0
 1580$(s%+464)="OCR of music scores"+CHR$0
 1590$(s%+496)="ScoreOCR"+CHR$0
 1600$(s%+528)="About this program"+CHR$0
 1610SYS "Wimp_CreateWindow",,s% TO info%
 1620ENDPROC
 1630:
 1640DEFPROCopen_menu
 1650 SYS "Wimp_CreateMenu",,menusp%,(!q%)-64,160
 1660ENDPROC
 1670:
 1680DEFPROCicon
 1690sp%=iconsp%
 1700!sp%=-1
 1710sp%!4=0
 1720sp%!8=0
 1730sp%!12=100
 1740sp%!16=68
 1750sp%!20=%00010001000000000011000000101010
 1760REM                     ^  ^
 1770$(sp%+24)="!scoreocr"+CHR$0
 1780SYS "Wimp_CreateIcon",,sp% TO icon%
 1790ENDPROC
 1800:
 1810REM OCR ENGINE
 1820:
 1830DEFPROCdoocr(filename$)
 1840quit=FALSE:*SPOOL <Obey$Dir>.temp
 1850LOCAL ERROR
 1860ON ERROR LOCAL REPORT:PRINT" @ ";ERL''''':END
 1870PROCinit
 1880PROCgetstaves
 1890PROCgettilt:IF quit THEN ENDPROC
 1900PROCcheckstaves:IF quit THEN ENDPROC
 1910PROCmeasurestaves
 1920FOR s=1 TO staves%
 1930PROCgetnotes(s)
 1940NEXT
 1950PROCsort
 1960PROCmakemaestro
 1970PRINT''"OCR completed"'
 1980*spool
 1990ENDPROC
 2000:
 2010DEFPROCinit
 2020!sarea=&80000:!(sarea+8)=16:SYS "OS_SpriteOp",9+256,sarea
 2030SYS "OS_SpriteOp",10+256,sarea,filename$
 2040SYS "OS_SpriteOp",13+256,sarea,txt%,256,1
 2050SYS "OS_SpriteOp",40+256,sarea,txt% TO ,,,xsize%,ysize%
 2060PROCclear
 2070PRINT"Music Score OCR"'"Dominic Ford, 1999"''
 2080ENDPROC
 2090:
 2100DEFPROCdraw
 2110!space=1:!(space+4)=1:!(space+8)=2:!(space+12)=2
 2120SYS "OS_SpriteOp",52+256,sarea,txt%,0,1024-ysize%*2,0,space,0
 2130ENDPROC
 2140:
 2150DEFPROCgetstaves
 2160PRINT"Searching for staves..."
 2170staves%=0:slast%=ysize%+200
 2180FORy%=ysize%-1 TO2STEP-1
 2190SYS "OS_SpriteOp",41+256,sarea,txt%,xsize% DIV4,y% TO ,,,,,cl%
 2200IFcl%<>0THEN
 2210 ct%=0
 2220 FORyc%=y%-1 TO y%+1
 2230  FORx%=(xsize% DIV 8)TO(xsize% DIV2)STEP4
 2240   SYS "OS_SpriteOp",41+256,sarea,txt%,x%,yc% TO ,,,,,cl%
 2250   ct%=ct%+cl%
 2260  NEXT
 2270 NEXT
 2280 IF ct%>(xsize%*0.1) THEN PROCgotline(y%):y%=y%-4
 2290ENDIF
 2300NEXT
 2310ENDPROC
 2320:
 2330DEFPROCgettilt
 2340PRINT"Measuring angle of tilt of scan..."
 2350y%=stave(1,0)+10:IF y%>ysize% THEN y%=ysize%
 2360REPEAT
 2370 y%=y%-1:ct%=0
 2380 SYS "OS_SpriteOp",41+256,sarea,txt%,3*(xsize% DIV4),y% TO ,,,,,cl%
 2390 IFcl%<>0THEN
 2400  ct%=0
 2410  FORyc%=y%-1 TO y%+1
 2420   FORx%=(xsize% DIV 2)TO7*(xsize% DIV8)STEP4
 2430    SYS "OS_SpriteOp",41+256,sarea,txt%,x%,yc% TO ,,,,,cl%
 2440    ct%=ct%+cl%
 2450   NEXT
 2460  NEXT
 2470 ENDIF
 2480UNTIL ct%>(xsize%*0.1) OR y%=stave(1,0)-10
 2490IF y%=stave(1,0)-10 THEN PRINT"This score is not legible. Please re-scan.":quit=TRUE
 2500offset%=(y%-stave(1,0))DIV2
 2510ENDPROC
 2520:
 2530DEFPROCgotline(y%)
 2540IF y%<(slast%-20) THEN staves%=staves%+1
 2550stave(staves%,nolines(staves%))=y%
 2560IF nolines(staves%)<>5 THEN nolines(staves%)=nolines(staves%)+1
 2570slast%=y%
 2580ENDPROC
 2590:
 2600DEFPROCcheckstaves
 2610PRINT'"Please confirm:"'''"This score has ";staves%;" staves."''
 2620FOR s=1 TO staves%
 2630PRINT"Stave ";s;" consists of ";nolines(s);" lines."
 2640NEXT
 2650PRINT'''"Is this OK? (Y/N) ";
 2660REPEAT A$=GET$:UNTIL INSTR("YyNn",A$)<>0
 2670IF INSTR("Nn",A$)<>0 THEN
 2680 PRINT"No"''"Please re-scan and try again."'
 2690 quit=TRUE
 2700ENDIF
 2710PRINT"Yes"'
 2720INPUT"How many staves are in each line of music";inmax%
 2730IFinmax%=1THENnomax%=8
 2740IFinmax%=2THENnomax%=4
 2750IFinmax%>2THENnomax%=2
 2760ENDPROC
 2770:
 2780DEFPROCmeasurestaves
 2790FOR s=1 TO staves%
 2800PRINT"Measuring stave ";s;"..."
 2810 x%=0:REPEAT x%=x%+1:ct%=0
 2820  FORlin=0TOnolines(s)-1
 2830   FORy=(stave(s,lin)-1)TO(stave(s,lin)+1)
 2840    SYS "OS_SpriteOp",41+256,sarea,txt%,x%,y TO ,,,,,cl%
 2850    ct%=ct%+cl%
 2860   NEXT
 2870  NEXT
 2880  IF ct%>nolines(s) THEN
 2890   ct%=0
 2900   FORlin=0TOnolines(s)-1
 2910    FORy=(stave(s,lin)+5)TO(stave(s,lin)+7)
 2920     SYS "OS_SpriteOp",41+256,sarea,txt%,x%,y TO ,,,,,cl%
 2930     ct%=ct%+1-cl%
 2940    NEXT
 2950   NEXT
 2960  ENDIF
 2970  UNTIL ct%>nolines(s)
 2980  start(s)=x%
 2990:
 3000 x%=xsize%:REPEAT x%=x%-1:ct%=0
 3010  FORlin=0TOnolines(s)-1
 3020   FORy=(stave(s,lin)-1+offset%)TO(stave(s,lin)+1+offset%)
 3030    SYS "OS_SpriteOp",41+256,sarea,txt%,x%,y TO ,,,,,cl%
 3040    ct%=ct%+cl%
 3050   NEXT
 3060  NEXT
 3070  IF ct%>nolines(s) THEN
 3080   ct%=0
 3090   FORlin=0TOnolines(s)-1
 3100    FORy=(stave(s,lin)+5+offset%)TO(stave(s,lin)+7+offset%)
 3110     SYS "OS_SpriteOp",41+256,sarea,txt%,x%,y TO ,,,,,cl%
 3120     ct%=ct%+1-cl%
 3130    NEXT
 3140   NEXT
 3150  ENDIF
 3160  UNTIL ct%>nolines(s)
 3170  stop(s)=x%
 3180NEXT
 3190ENDPROC
 3200:
 3210DEFPROCgetnotes(s)
 3220PRINT"Now processing stave ";s;"..."
 3230IFnolines(s)>2 THEN gap%=(stave(s,0)-stave(s,1))DIV2 ELSE gap%=6
 3240FORline=0TOnolines(s)-1
 3250 FORx=start(s) TO stop(s)
 3260  SYS "OS_SpriteOp",41+256,sarea,txt%,x,stave(s,line)+INT(offset%*x/xsize%)-gap% TO ,,,,,cl%
 3270  IFcl%=1 THEN
 3280   ct%=0
 3290   FORx2=x TO x+3
 3300    SYS "OS_SpriteOp",41+256,sarea,txt%,x2,stave(s,line)+INT(offset%*x2/xsize%)-gap% TO ,,,,,cl%
 3310    ct%=ct%+cl%
 3320   NEXT
 3330   IF ct%>2 THEN PROCfillednote
 3340  ENDIF
 3350 NEXT
 3360NEXT
 3370ENDPROC
 3380:
 3390DEFPROCfillednote
 3400left%=x:y=stave(s,line)-gap%+INT(offset%*x/xsize%)
 3410REPEAT
 3420 SYS "OS_SpriteOp",41+256,sarea,txt%,x,y TO ,,,,,cl%
 3430 SYS "OS_SpriteOp",41+256,sarea,txt%,x+1,y TO ,,,,,cl2%
 3440 IF cl2%=1 THEN x=x+2 ELSE x=x+1
 3450UNTIL (cl%=0 AND cl2%=0) OR (x>(stop(s)-2))
 3460middle%=(left%+x)DIV2
 3470REPEAT
 3480 SYS "OS_SpriteOp",41+256,sarea,txt%,middle%,y TO ,,,,,cl%
 3490 SYS "OS_SpriteOp",41+256,sarea,txt%,middle%,y+1 TO ,,,,,cl2%
 3500 IF cl2%=1 THEN y=y+2 ELSE y=y+1
 3510UNTIL (cl%=0 AND cl2%=0) OR (y>(ysize%-2))
 3520top%=y:y=stave(s,line)-gap%+INT(offset%*x/xsize%)
 3530REPEAT
 3540 SYS "OS_SpriteOp",41+256,sarea,txt%,middle%,y TO ,,,,,cl%
 3550 SYS "OS_SpriteOp",41+256,sarea,txt%,middle%,y-1 TO ,,,,,cl2%
 3560 IF cl2%=1 THEN y=y-2 ELSE y=y-1
 3570UNTIL (cl%=0 AND cl2%=0) OR (y<2)
 3580bottom%=y
 3590IF (top%-bottom%)<6 THEN PROChollownote(middle%)
 3600IF (x-left%)<0.25*(top%-bottom%) OR (x-left%)>1.5*(top%-bottom%) THEN ENDPROC
 3610ymid%=(top%+bottom%)DIV2
 3620notepos=20-2*line
 3630IFymid%<(stave(s,line)-1.3*gap%) THEN ENDPROC
 3640IFymid%<(stave(s,line)-3) THEN notepos=notepos-1
 3650IFymid%<(stave(s,line)+3) THEN PROCfilenote(left%,ymid%,s,notepos)
 3660ENDPROC
 3670:
 3680DEFPROChollownote(middle%)
 3690ENDPROC
 3700:
 3710DEFPROCfilenote(left%,y,s,notepos)
 3720PRINTs;" ";line;" ";notes%(s,line);" ";left%;" ";middle%;" ";top%;" ";bottom%;" ";notepos
 3730notex%(s,line,notes%(s,line))=left%
 3740notep%(s,line,notes%(s,line))=notepos
 3750notev%(s,line,notes%(s,line))=3
 3760notes%(s,line)=notes%(s,line)+1
 3770ENDPROC
 3780:
 3790DEFPROCsort
 3800gates%=0:FORc=0TO7:queue%(c)=0:NEXT
 3810FORstave=0TO(staves%DIVinmax%)-1
 3820 PRINT"Sorting line ";stave+1;"..."
 3830 PROCsortline
 3840NEXT
 3850ENDPROC
 3860:
 3870DEFPROCsortline
 3880REPEAT
 3890 min=FNgetnextnote
 3900 PRINT"--- ";min
 3910 chans%=0:gates%=gates%+1
 3920 IF min<>0 THEN PROCsortnotes(min):?(sarea+&1000+gates%)=chans%
 3930UNTILmin=0
 3940ENDPROC
 3950:
 3960DEFFNgetnextnote
 3970min=9999
 3980FORs=(stave*inmax%+1) TO(stave+1)*inmax%
 3990 FORline=0TOnolines(s)-1
 4000  IFnfile%(s,line)<>notes%(s,line) THEN
 4010   IF notex%(s,line,nfile%(s,line))<min THEN min=notex%(s,line,nfile%(s,line))
 4020  ENDIF
 4030 NEXT
 4040NEXT
 4050IFmin=9999 THEN =0
 4060=min
 4070:
 4080DEFPROCsortnotes(min)
 4090FORs=(stave*inmax%+1) TO(stave+1)*inmax%
 4100 instn%=nomax%*((s-1)MODinmax%)
 4110 FORline=0TOnolines(s)-1
 4120  IFnfile%(s,line)<>notes%(s,line) THEN
 4130   IF notex%(s,line,nfile%(s,line))<(min+10) THEN
 4140    PRINTs-stave,notep%(s,line,nfile%(s,line))
 4150    FORinno%=instn% TO (instn%+nomax%-1)
 4160     IF(chans% AND(2^inno%))=0THENchans%=chans%+2^inno%:?(sarea+&8000*inno%+queue%(inno%)+&8000)=8*notep%(s,line,nfile%(s,line)):?(sarea+&8000*inno%+queue%(inno%)+&8001)=128:queue%(inno%)=queue%(inno%)+2:inno%=instn%+nomax%
 4170     NEXT
 4180    nfile%(s,line)=nfile%(s,line)+1
 4190   ENDIF
 4200  ENDIF
 4210 NEXT
 4220NEXT
 4230ENDPROC
 4240:
 4250DEFPROCclear
 4260FORs=0TO32
 4270 FORl=0TO5
 4280  notes%(s,l)=0:nfile%(s,l)=0
 4290 NEXT
 4300NEXT
 4310ENDPROC
 4320:
 4330DEFPROCmakemaestro
 4340PRINT"Making Maestro file..."
 4350file%=OPENOUT"<Obey$Dir>.MusicScan"
 4360P%=sarea
 4370[OPT 0:EQUS"Maestro":EQUB&A:EQUB2:EQUB1:]
 4380FORr=sarea TO P%-1:BPUT#file%,?r:NEXT
 4390:
 4400PRINT#file%,(gates%-1)+2
 4410FORc=0TO7:PRINT#file%,queue%(c):NEXT
 4420BPUT#file%,0:BPUT#file%,32
 4430IFgates%<>1 THEN FORr=1TO(gates%-1):BPUT#file%,?(sarea+&1000+r):NEXT
 4440FORc=1TO8
 4450 IFqueue%(c-1)<>0 THEN FORr=0TOqueue%(c-1)-1:BPUT#file%,?(sarea+&8000*c+r):NEXT
 4460NEXT
 4470P%=sarea
 4480[OPT 0:EQUB2:EQUBinmax%-1:EQUB0
 4490EQUB3:]:FORc=0TO7:[OPT 0:EQUBc:EQUB1:]:NEXT:[OPT 0
 4500EQUB4:EQUD&06060606:EQUD&06060606
 4510EQUB5:EQUD&03030303:EQUD&03030303:]
 4520FORr=sarea TO P%-1:BPUT#file%,?r:NEXT
 4530:
 4540CLOSE#file%
 4550*SETTYPE <Obey$Dir>.MusicScan AF1
 4560ENDPROC

� !ScoreOCR
� � Dominic Ford, 1999
:
(X� � !txt%=0:$(txt%+4)=�$+" at line "+Þ+�0:ș "Wimp_ReportError",txt%,0,"ScoreOCR":�
2<� q% 256,menusp% &1000,iconsp% 256,infosp% &400,txt% 256
<� stave(32,5),nolines(32)
FR� notex%(32,5,100),notev%(32,5,100),notep%(32,5,100),notes%(32,5),nfile%(32,5)
P� start(32),stop(32)
Z%� space 16,sarea &80000,queue%(7)
d:
n&� stave = y position of stave line
x4� nolines = number of lines in stave (usually 5)
�0� notex% = x position of filed note on stave
�4� notev% = length of note (0=breve, 7=hdsquaver)
�K� notep% = line position of note (yet to be coded to Maestro/MIDI form)
�.� notes% = no of notes files on stave/line
�,� nfile% = used in the filing as counter
�2� start/stop = left/right of stave on the page
�:
�1ș "Wimp_Initialise",200,&4B534154,"ScoreOCR"
�	�icon
�
�menus
� �
�  ș "Wimp_Poll",0,q% � a%
�
  Ȏ a% �

   � 6
6    � q%!12=-2 � q%!16=icon% � q%!8=2 � �open_menu

   � 9
"    �handlemenu
,   � 17,18
6    Ȏ q%!16 �
@     � 0
J      �
T     � 3
^$      � q%!20=-2 � q%!24=icon% �
h       �ocrrequest
r"       ș "Wimp_CreateMenu",-1
|       q%!16=3
�      �
�	    �
�  �
� � �
�:
���ocrrequest
�file$=�get_str(q%+44)
�type%=q%!40
�� type%<>&FF9 �
�T !txt%=0:$(txt%+4)="Please convert to a sprite file before attempting to OCR"+�0
�, ș "Wimp_ReportError",txt%,0,"ScoreOCR"
��
� �0
! � SYS "Wimp_SlotSize",640,-1
 �doocr(file$)
  � SYS "Wimp_SlotSize",32,-1
&1 �"Press any key to return to the desktop..."
0	 A$=�
:$ �12:ȗ �:�"<Obey$Dir>.!Palette"
D+ ș "Wimp_ForceRedraw",-1,0,0,1280,1024
N�
X�
b:
lݤget_str(q%)
v� fn$,p%
�p%=0:fn$=""
��
� fn$=fn$+�(q%?p%)
� p%=p%+1
�� (q%?p%)<32
�=fn$
�:
���menus
�
 �infobox
� p%=menusp%
�- $p%="ScoreOCR"+�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
6 !f%=&80:f%!4=-1:f%!8=&07003011:$(f%+12)="Quit"+�0
�
:
 ��handlemenu
* � a%,l%
4
 Ȏ !q% �
>
   � 1
H   �
R �
\! ș "Wimp_GetPointerInfo",,q%
f" � ((q%!8) � 1)=1 � �open_menu
p�
z:
�
��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
�s%!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
8!i%=32:i%!4=8
Bi%!8=184:i%!12=56
Li%!16=&07000211
V$(i%+20)="Version:"+�0
`
i%+=32
j!i%=188:i%!4=8
ti%!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
�$(i%+20)="Author:"+�0
�
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
2i%!8=184:i%!12=160
<i%!16=&07000211
F$(i%+20)="Purpose:"+�0
P
i%+=32
Z!i%=188:i%!4=112
di%!8=632:i%!12=160
ni%!16=&0700013D
xi%!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
�!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 (28-Jul-99)"+�0
"'$(s%+432)="� Dominic Ford, 1999"+�0
,&$(s%+464)="OCR of music scores"+�0
6$(s%+496)="ScoreOCR"+�0
@%$(s%+528)="About this program"+�0
J&ș "Wimp_CreateWindow",,s% � info%
T�
^:
h��open_menu
r/ ș "Wimp_CreateMenu",,menusp%,(!q%)-64,160
|�
�:
�
��icon
�sp%=iconsp%
�!sp%=-1
�sp%!4=0
�sp%!8=0
�sp%!12=100
�
sp%!16=68
�,sp%!20=%00010001000000000011000000101010
��                     ^  ^
�$(sp%+24)="!scoreocr"+�0
�%ș "Wimp_CreateIcon",,sp% � icon%
��
:
� OCR ENGINE
:
&��doocr(filename$)
0!quit=�:*SPOOL <Obey$Dir>.temp
:� �
D� � � �:�" @ ";�''''':�
N	�init
X�getstaves
b�gettilt:� quit � �
l�checkstaves:� quit � �
v�measurestaves
�� s=1 � staves%
��getnotes(s)
��
�	�sort
��makemaestro
��''"OCR completed"'
�
*spool
��
�:
�
��init
�<!sarea=&80000:!(sarea+8)=16:ș "OS_SpriteOp",9+256,sarea
�+ș "OS_SpriteOp",10+256,sarea,filename$
�,ș "OS_SpriteOp",13+256,sarea,txt%,256,1
9ș "OS_SpriteOp",40+256,sarea,txt% � ,,,xsize%,ysize%

�clear
-�"Music Score OCR"'"Dominic Ford, 1999"''
 �
*:
4
��draw
>4!space=1:!(space+4)=1:!(space+8)=2:!(space+12)=2
H@ș "OS_SpriteOp",52+256,sarea,txt%,0,1024-ysize%*2,0,space,0
R�
\:
f��getstaves
p�"Searching for staves..."
zstaves%=0:slast%=ysize%+200
��y%=ysize%-1 �2�-1
�>ș "OS_SpriteOp",41+256,sarea,txt%,xsize% �4,y% � ,,,,,cl%
��cl%<>0�
�
 ct%=0
� �yc%=y%-1 � y%+1
�$  �x%=(xsize% � 8)�(xsize% �2)�4
�;   ș "OS_SpriteOp",41+256,sarea,txt%,x%,yc% � ,,,,,cl%
�   ct%=ct%+cl%
�  �
� �
�. � ct%>(xsize%*0.1) � �gotline(y%):y%=y%-4
��
��
	�
	:
	
��gettilt
	$)�"Measuring angle of tilt of scan..."
	.,y%=stave(1,0)+10:� y%>ysize% � y%=ysize%
	8�
	B y%=y%-1:ct%=0
	LC ș "OS_SpriteOp",41+256,sarea,txt%,3*(xsize% �4),y% � ,,,,,cl%
	V
 �cl%<>0�
	`  ct%=0
	j  �yc%=y%-1 � y%+1
	t'   �x%=(xsize% � 2)�7*(xsize% �8)�4
	~<    ș "OS_SpriteOp",41+256,sarea,txt%,x%,yc% � ,,,,,cl%
	�    ct%=ct%+cl%
	�   �
	�  �
	� �
	�)� ct%>(xsize%*0.1) � y%=stave(1,0)-10
	�M� y%=stave(1,0)-10 � �"This score is not legible. Please re-scan.":quit=�
	�offset%=(y%-stave(1,0))�2
	��
	�:
	���gotline(y%)
	�(� y%<(slast%-20) � staves%=staves%+1
	�&stave(staves%,nolines(staves%))=y%
?� nolines(staves%)<>5 � nolines(staves%)=nolines(staves%)+1


slast%=y%
�
:
(��checkstaves
2@�'"Please confirm:"'''"This score has ";staves%;" staves."''
<� s=1 � staves%
F4�"Stave ";s;" consists of ";nolines(s);" lines."
P�
Z�'''"Is this OK? (Y/N) ";
d� A$=�:� �"YyNn",A$)<>0
n� �"Nn",A$)<>0 �
x, �"No"''"Please re-scan and try again."'
� quit=�
��
��"Yes"'
�7�"How many staves are in each line of music";inmax%
��inmax%=1�nomax%=8
��inmax%=2�nomax%=4
��inmax%>2�nomax%=2
��
�:
���measurestaves
�� s=1 � staves%
��"Measuring stave ";s;"..."
� x%=0:� x%=x%+1:ct%=0
  �lin=0�nolines(s)-1
+   �y=(stave(s,lin)-1)�(stave(s,lin)+1)
:    ș "OS_SpriteOp",41+256,sarea,txt%,x%,y � ,,,,,cl%
"    ct%=ct%+cl%
,   �
6  �
@  � ct%>nolines(s) �
J   ct%=0
T   �lin=0�nolines(s)-1
^,    �y=(stave(s,lin)+5)�(stave(s,lin)+7)
h;     ș "OS_SpriteOp",41+256,sarea,txt%,x%,y � ,,,,,cl%
r     ct%=ct%+1-cl%
|	    �
�   �
�  �
�  � ct%>nolines(s)
�  start(s)=x%
�:
� x%=xsize%:� x%=x%-1:ct%=0
�  �lin=0�nolines(s)-1
�;   �y=(stave(s,lin)-1+offset%)�(stave(s,lin)+1+offset%)
�:    ș "OS_SpriteOp",41+256,sarea,txt%,x%,y � ,,,,,cl%
�    ct%=ct%+cl%
�   �
�  �
�  � ct%>nolines(s) �
   ct%=0
   �lin=0�nolines(s)-1
<    �y=(stave(s,lin)+5+offset%)�(stave(s,lin)+7+offset%)
&;     ș "OS_SpriteOp",41+256,sarea,txt%,x%,y � ,,,,,cl%
0     ct%=ct%+1-cl%
:	    �
D   �
N  �
X  � ct%>nolines(s)
b  stop(s)=x%
l�
v�
�:
���getnotes(s)
�$�"Now processing stave ";s;"..."
�;�nolines(s)>2 � gap%=(stave(s,0)-stave(s,1))�2 � gap%=6
��line=0�nolines(s)-1
� �x=start(s) � stop(s)
�\  ș "OS_SpriteOp",41+256,sarea,txt%,x,stave(s,line)+�(offset%*x/xsize%)-gap% � ,,,,,cl%
�  �cl%=1 �
�   ct%=0
�   �x2=x � x+3
�`    ș "OS_SpriteOp",41+256,sarea,txt%,x2,stave(s,line)+�(offset%*x2/xsize%)-gap% � ,,,,,cl%
�    ct%=ct%+cl%
�   �

   � ct%>2 � �fillednote

  �

 �

 �

*�

4:

>��fillednote

H4left%=x:y=stave(s,line)-gap%+�(offset%*x/xsize%)

R�

\6 ș "OS_SpriteOp",41+256,sarea,txt%,x,y � ,,,,,cl%

f9 ș "OS_SpriteOp",41+256,sarea,txt%,x+1,y � ,,,,,cl2%

p � cl2%=1 � x=x+2 � x=x+1

z(� (cl%=0 � cl2%=0) � (x>(stop(s)-2))

�middle%=(left%+x)�2

��

�< ș "OS_SpriteOp",41+256,sarea,txt%,middle%,y � ,,,,,cl%

�? ș "OS_SpriteOp",41+256,sarea,txt%,middle%,y+1 � ,,,,,cl2%

� � cl2%=1 � y=y+2 � y=y+1

�'� (cl%=0 � cl2%=0) � (y>(ysize%-2))

�3top%=y:y=stave(s,line)-gap%+�(offset%*x/xsize%)

��

�< ș "OS_SpriteOp",41+256,sarea,txt%,middle%,y � ,,,,,cl%

�? ș "OS_SpriteOp",41+256,sarea,txt%,middle%,y-1 � ,,,,,cl2%

� � cl2%=1 � y=y-2 � y=y-1

�� (cl%=0 � cl2%=0) � (y<2)

�
bottom%=y
-� (top%-bottom%)<6 � �hollownote(middle%)
F� (x-left%)<0.25*(top%-bottom%) � (x-left%)>1.5*(top%-bottom%) � �
ymid%=(top%+bottom%)�2
$notepos=20-2*line
.'�ymid%<(stave(s,line)-1.3*gap%) � �
80�ymid%<(stave(s,line)-3) � notepos=notepos-1
B?�ymid%<(stave(s,line)+3) � �filenote(left%,ymid%,s,notepos)
L�
V:
`��hollownote(middle%)
j�
t:
~!��filenote(left%,y,s,notepos)
�Y�s;" ";line;" ";notes%(s,line);" ";left%;" ";middle%;" ";top%;" ";bottom%;" ";notepos
�'notex%(s,line,notes%(s,line))=left%
�)notep%(s,line,notes%(s,line))=notepos
�#notev%(s,line,notes%(s,line))=3
�#notes%(s,line)=notes%(s,line)+1
��
�:
�
��sort
�!gates%=0:�c=0�7:queue%(c)=0:�
��stave=0�(staves%�inmax%)-1
�# �"Sorting line ";stave+1;"..."
� �sortline
�

�
:
��sortline
(�
2 min=�getnextnote
< �"--- ";min
F chans%=0:gates%=gates%+1
P< � min<>0 � �sortnotes(min):?(sarea+&1000+gates%)=chans%
Z
�min=0
d�
n:
xݤgetnextnote
�min=9999
�)�s=(stave*inmax%+1) �(stave+1)*inmax%
� �line=0�nolines(s)-1
�'  �nfile%(s,line)<>notes%(s,line) �
�N   � notex%(s,line,nfile%(s,line))<min � min=notex%(s,line,nfile%(s,line))
�  �
� �
��
��min=9999 � =0
�=min
�:
���sortnotes(min)
�)�s=(stave*inmax%+1) �(stave+1)*inmax%
! instn%=nomax%*((s-1)�inmax%)
 �line=0�nolines(s)-1
'  �nfile%(s,line)<>notes%(s,line) �
"1   � notex%(s,line,nfile%(s,line))<(min+10) �
,.    �s-stave,notep%(s,line,nfile%(s,line))
6)    �inno%=instn% � (instn%+nomax%-1)
@�     �(chans% �(2^inno%))=0�chans%=chans%+2^inno%:?(sarea+&8000*inno%+queue%(inno%)+&8000)=8*notep%(s,line,nfile%(s,line)):?(sarea+&8000*inno%+queue%(inno%)+&8001)=128:queue%(inno%)=queue%(inno%)+2:inno%=instn%+nomax%
J
     �
T'    nfile%(s,line)=nfile%(s,line)+1
^   �
h  �
r �
|�
��
�:
���clear
��s=0�32
� �l=0�5
�!  notes%(s,l)=0:nfile%(s,l)=0
� �
��
��
�:
���makemaestro
��"Making Maestro file..."
�!file%=�"<Obey$Dir>.MusicScan"
P%=sarea
-[OPT 0:EQUS"Maestro":EQUB&A:EQUB2:EQUB1:]
 �r=sarea � P%-1:�#file%,?r:�
&:
0�#file%,(gates%-1)+2
:�c=0�7:�#file%,queue%(c):�
D�#file%,0:�#file%,32
N;�gates%<>1 � �r=1�(gates%-1):�#file%,?(sarea+&1000+r):�
X
�c=1�8
bF �queue%(c-1)<>0 � �r=0�queue%(c-1)-1:�#file%,?(sarea+&8000*c+r):�
l�
vP%=sarea
�#[OPT 0:EQUB2:EQUBinmax%-1:EQUB0
�0EQUB3:]:�c=0�7:[OPT 0:EQUBc:EQUB1:]:�:[OPT 0
�%EQUB4:EQUD&06060606:EQUD&06060606
�'EQUB5:EQUD&03030303:EQUD&03030303:]
� �r=sarea � P%-1:�#file%,?r:�
�:
��#file%
�%*SETTYPE <Obey$Dir>.MusicScan AF1
��
�
00000000  0d 00 0a 0f f4 20 21 53  63 6f 72 65 4f 43 52 0d  |..... !ScoreOCR.|
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 58 ee 20 85 20 21 74  78 74 25 3d 30 3a 24 28  |(X. . !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 53 63 6f 72 65  |r",txt%,0,"Score|
00000080  4f 43 52 22 3a e0 0d 00  32 3c de 20 71 25 20 32  |OCR":...2<. q% 2|
00000090  35 36 2c 6d 65 6e 75 73  70 25 20 26 31 30 30 30  |56,menusp% &1000|
000000a0  2c 69 63 6f 6e 73 70 25  20 32 35 36 2c 69 6e 66  |,iconsp% 256,inf|
000000b0  6f 73 70 25 20 26 34 30  30 2c 74 78 74 25 20 32  |osp% &400,txt% 2|
000000c0  35 36 0d 00 3c 1d de 20  73 74 61 76 65 28 33 32  |56..<.. stave(32|
000000d0  2c 35 29 2c 6e 6f 6c 69  6e 65 73 28 33 32 29 0d  |,5),nolines(32).|
000000e0  00 46 52 de 20 6e 6f 74  65 78 25 28 33 32 2c 35  |.FR. notex%(32,5|
000000f0  2c 31 30 30 29 2c 6e 6f  74 65 76 25 28 33 32 2c  |,100),notev%(32,|
00000100  35 2c 31 30 30 29 2c 6e  6f 74 65 70 25 28 33 32  |5,100),notep%(32|
00000110  2c 35 2c 31 30 30 29 2c  6e 6f 74 65 73 25 28 33  |,5,100),notes%(3|
00000120  32 2c 35 29 2c 6e 66 69  6c 65 25 28 33 32 2c 35  |2,5),nfile%(32,5|
00000130  29 0d 00 50 18 de 20 73  74 61 72 74 28 33 32 29  |)..P.. start(32)|
00000140  2c 73 74 6f 70 28 33 32  29 0d 00 5a 25 de 20 73  |,stop(32)..Z%. s|
00000150  70 61 63 65 20 31 36 2c  73 61 72 65 61 20 26 38  |pace 16,sarea &8|
00000160  30 30 30 30 2c 71 75 65  75 65 25 28 37 29 0d 00  |0000,queue%(7)..|
00000170  64 05 3a 0d 00 6e 26 f4  20 73 74 61 76 65 20 3d  |d.:..n&. stave =|
00000180  20 79 20 70 6f 73 69 74  69 6f 6e 20 6f 66 20 73  | y position of s|
00000190  74 61 76 65 20 6c 69 6e  65 0d 00 78 34 f4 20 6e  |tave line..x4. n|
000001a0  6f 6c 69 6e 65 73 20 3d  20 6e 75 6d 62 65 72 20  |olines = number |
000001b0  6f 66 20 6c 69 6e 65 73  20 69 6e 20 73 74 61 76  |of lines in stav|
000001c0  65 20 28 75 73 75 61 6c  6c 79 20 35 29 0d 00 82  |e (usually 5)...|
000001d0  30 f4 20 6e 6f 74 65 78  25 20 3d 20 78 20 70 6f  |0. notex% = x po|
000001e0  73 69 74 69 6f 6e 20 6f  66 20 66 69 6c 65 64 20  |sition of filed |
000001f0  6e 6f 74 65 20 6f 6e 20  73 74 61 76 65 0d 00 8c  |note on stave...|
00000200  34 f4 20 6e 6f 74 65 76  25 20 3d 20 6c 65 6e 67  |4. notev% = leng|
00000210  74 68 20 6f 66 20 6e 6f  74 65 20 28 30 3d 62 72  |th of note (0=br|
00000220  65 76 65 2c 20 37 3d 68  64 73 71 75 61 76 65 72  |eve, 7=hdsquaver|
00000230  29 0d 00 96 4b f4 20 6e  6f 74 65 70 25 20 3d 20  |)...K. notep% = |
00000240  6c 69 6e 65 20 70 6f 73  69 74 69 6f 6e 20 6f 66  |line position of|
00000250  20 6e 6f 74 65 20 28 79  65 74 20 74 6f 20 62 65  | note (yet to be|
00000260  20 63 6f 64 65 64 20 74  6f 20 4d 61 65 73 74 72  | coded to Maestr|
00000270  6f 2f 4d 49 44 49 20 66  6f 72 6d 29 0d 00 a0 2e  |o/MIDI form)....|
00000280  f4 20 6e 6f 74 65 73 25  20 3d 20 6e 6f 20 6f 66  |. notes% = no of|
00000290  20 6e 6f 74 65 73 20 66  69 6c 65 73 20 6f 6e 20  | notes files on |
000002a0  73 74 61 76 65 2f 6c 69  6e 65 0d 00 aa 2c f4 20  |stave/line...,. |
000002b0  6e 66 69 6c 65 25 20 3d  20 75 73 65 64 20 69 6e  |nfile% = used in|
000002c0  20 74 68 65 20 66 69 6c  69 6e 67 20 61 73 20 63  | the filing as c|
000002d0  6f 75 6e 74 65 72 0d 00  b4 32 f4 20 73 74 61 72  |ounter...2. star|
000002e0  74 2f 73 74 6f 70 20 3d  20 6c 65 66 74 2f 72 69  |t/stop = left/ri|
000002f0  67 68 74 20 6f 66 20 73  74 61 76 65 20 6f 6e 20  |ght of stave on |
00000300  74 68 65 20 70 61 67 65  0d 00 be 05 3a 0d 00 c8  |the page....:...|
00000310  31 c8 99 20 22 57 69 6d  70 5f 49 6e 69 74 69 61  |1.. "Wimp_Initia|
00000320  6c 69 73 65 22 2c 32 30  30 2c 26 34 42 35 33 34  |lise",200,&4B534|
00000330  31 35 34 2c 22 53 63 6f  72 65 4f 43 52 22 0d 00  |154,"ScoreOCR"..|
00000340  d2 09 f2 69 63 6f 6e 0d  00 dc 0a f2 6d 65 6e 75  |...icon.....menu|
00000350  73 0d 00 e6 06 20 f5 0d  00 f0 1e 20 20 c8 99 20  |s.... .....  .. |
00000360  22 57 69 6d 70 5f 50 6f  6c 6c 22 2c 30 2c 71 25  |"Wimp_Poll",0,q%|
00000370  20 b8 20 61 25 0d 00 fa  0d 20 20 c8 8e 20 61 25  | . a%....  .. a%|
00000380  20 ca 0d 01 04 0a 20 20  20 c9 20 36 0d 01 0e 36  | .....   . 6...6|
00000390  20 20 20 20 e7 20 71 25  21 31 32 3d 2d 32 20 80  |    . q%!12=-2 .|
000003a0  20 71 25 21 31 36 3d 69  63 6f 6e 25 20 80 20 71  | q%!16=icon% . q|
000003b0  25 21 38 3d 32 20 8c 20  f2 6f 70 65 6e 5f 6d 65  |%!8=2 . .open_me|
000003c0  6e 75 0d 01 18 0a 20 20  20 c9 20 39 0d 01 22 13  |nu....   . 9..".|
000003d0  20 20 20 20 f2 68 61 6e  64 6c 65 6d 65 6e 75 0d  |    .handlemenu.|
000003e0  01 2c 0e 20 20 20 c9 20  31 37 2c 31 38 0d 01 36  |.,.   . 17,18..6|
000003f0  12 20 20 20 20 c8 8e 20  71 25 21 31 36 20 ca 0d  |.    .. q%!16 ..|
00000400  01 40 0c 20 20 20 20 20  c9 20 30 0d 01 4a 0b 20  |.@.     . 0..J. |
00000410  20 20 20 20 20 e0 0d 01  54 0c 20 20 20 20 20 c9  |     ...T.     .|
00000420  20 33 0d 01 5e 24 20 20  20 20 20 20 e7 20 71 25  | 3..^$      . q%|
00000430  21 32 30 3d 2d 32 20 80  20 71 25 21 32 34 3d 69  |!20=-2 . q%!24=i|
00000440  63 6f 6e 25 20 8c 0d 01  68 16 20 20 20 20 20 20  |con% ...h.      |
00000450  20 f2 6f 63 72 72 65 71  75 65 73 74 0d 01 72 22  | .ocrrequest..r"|
00000460  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00000470  43 72 65 61 74 65 4d 65  6e 75 22 2c 2d 31 0d 01  |CreateMenu",-1..|
00000480  7c 12 20 20 20 20 20 20  20 71 25 21 31 36 3d 33  ||.       q%!16=3|
00000490  0d 01 86 0b 20 20 20 20  20 20 cd 0d 01 90 09 20  |....      ..... |
000004a0  20 20 20 cb 0d 01 9a 07  20 20 cb 0d 01 a4 08 20  |   .....  ..... |
000004b0  fd 20 a3 0d 01 ae 05 3a  0d 01 b8 10 dd f2 6f 63  |. .....:......oc|
000004c0  72 72 65 71 75 65 73 74  0d 01 c2 19 66 69 6c 65  |rrequest....file|
000004d0  24 3d a4 67 65 74 5f 73  74 72 28 71 25 2b 34 34  |$=.get_str(q%+44|
000004e0  29 0d 01 cc 0f 74 79 70  65 25 3d 71 25 21 34 30  |)....type%=q%!40|
000004f0  0d 01 d6 13 e7 20 74 79  70 65 25 3c 3e 26 46 46  |..... type%<>&FF|
00000500  39 20 8c 0d 01 e0 54 20  21 74 78 74 25 3d 30 3a  |9 ....T !txt%=0:|
00000510  24 28 74 78 74 25 2b 34  29 3d 22 50 6c 65 61 73  |$(txt%+4)="Pleas|
00000520  65 20 63 6f 6e 76 65 72  74 20 74 6f 20 61 20 73  |e convert to a s|
00000530  70 72 69 74 65 20 66 69  6c 65 20 62 65 66 6f 72  |prite file befor|
00000540  65 20 61 74 74 65 6d 70  74 69 6e 67 20 74 6f 20  |e attempting to |
00000550  4f 43 52 22 2b bd 30 0d  01 ea 2c 20 c8 99 20 22  |OCR"+.0..., .. "|
00000560  57 69 6d 70 5f 52 65 70  6f 72 74 45 72 72 6f 72  |Wimp_ReportError|
00000570  22 2c 74 78 74 25 2c 30  2c 22 53 63 6f 72 65 4f  |",txt%,0,"ScoreO|
00000580  43 52 22 0d 01 f4 05 cc  0d 01 fe 07 20 eb 30 0d  |CR"......... .0.|
00000590  02 08 21 20 f4 20 53 59  53 20 22 57 69 6d 70 5f  |..! . SYS "Wimp_|
000005a0  53 6c 6f 74 53 69 7a 65  22 2c 36 34 30 2c 2d 31  |SlotSize",640,-1|
000005b0  0d 02 12 12 20 f2 64 6f  6f 63 72 28 66 69 6c 65  |.... .doocr(file|
000005c0  24 29 0d 02 1c 20 20 f4  20 53 59 53 20 22 57 69  |$)...  . SYS "Wi|
000005d0  6d 70 5f 53 6c 6f 74 53  69 7a 65 22 2c 33 32 2c  |mp_SlotSize",32,|
000005e0  2d 31 0d 02 26 31 20 f1  22 50 72 65 73 73 20 61  |-1..&1 ."Press a|
000005f0  6e 79 20 6b 65 79 20 74  6f 20 72 65 74 75 72 6e  |ny key to return|
00000600  20 74 6f 20 74 68 65 20  64 65 73 6b 74 6f 70 2e  | to the desktop.|
00000610  2e 2e 22 0d 02 30 09 20  41 24 3d be 0d 02 3a 24  |.."..0. A$=...:$|
00000620  20 eb 31 32 3a c8 97 20  ee 3a ff 22 3c 4f 62 65  | .12:.. .:."<Obe|
00000630  79 24 44 69 72 3e 2e 21  50 61 6c 65 74 74 65 22  |y$Dir>.!Palette"|
00000640  0d 02 44 2b 20 c8 99 20  22 57 69 6d 70 5f 46 6f  |..D+ .. "Wimp_Fo|
00000650  72 63 65 52 65 64 72 61  77 22 2c 2d 31 2c 30 2c  |rceRedraw",-1,0,|
00000660  30 2c 31 32 38 30 2c 31  30 32 34 0d 02 4e 05 cd  |0,1280,1024..N..|
00000670  0d 02 58 05 e1 0d 02 62  05 3a 0d 02 6c 11 dd a4  |..X....b.:..l...|
00000680  67 65 74 5f 73 74 72 28  71 25 29 0d 02 76 0c ea  |get_str(q%)..v..|
00000690  20 66 6e 24 2c 70 25 0d  02 80 0f 70 25 3d 30 3a  | fn$,p%....p%=0:|
000006a0  66 6e 24 3d 22 22 0d 02  8a 05 f5 0d 02 94 15 20  |fn$=""......... |
000006b0  66 6e 24 3d 66 6e 24 2b  bd 28 71 25 3f 70 25 29  |fn$=fn$+.(q%?p%)|
000006c0  0d 02 9e 0c 20 70 25 3d  70 25 2b 31 0d 02 a8 10  |.... p%=p%+1....|
000006d0  fd 20 28 71 25 3f 70 25  29 3c 33 32 0d 02 b2 08  |. (q%?p%)<32....|
000006e0  3d 66 6e 24 0d 02 bc 05  3a 0d 02 c6 0b dd f2 6d  |=fn$....:......m|
000006f0  65 6e 75 73 0d 02 d0 0d  20 f2 69 6e 66 6f 62 6f  |enus.... .infobo|
00000700  78 0d 02 da 0f 20 70 25  3d 6d 65 6e 75 73 70 25  |x.... p%=menusp%|
00000710  0d 02 e4 2d 20 24 70 25  3d 22 53 63 6f 72 65 4f  |...- $p%="ScoreO|
00000720  43 52 22 2b bd 30 3a 70  25 21 31 32 3d 26 37 30  |CR"+.0:p%!12=&70|
00000730  32 30 37 3a 70 25 21 31  36 3d 32 30 30 0d 02 ee  |207:p%!16=200...|
00000740  1e 20 70 25 21 32 30 3d  34 30 3a 70 25 21 32 34  |. p%!20=40:p%!24|
00000750  3d 30 3a 66 25 3d 70 25  2b 32 38 0d 02 f8 3e 20  |=0:f%=p%+28...> |
00000760  21 66 25 3d 30 3a 66 25  21 34 3d 69 6e 66 6f 25  |!f%=0:f%!4=info%|
00000770  3a 66 25 21 38 3d 26 30  37 30 30 30 30 31 31 3a  |:f%!8=&07000011:|
00000780  24 28 66 25 2b 31 32 29  3d 22 49 6e 66 6f 22 2b  |$(f%+12)="Info"+|
00000790  bd 30 3a 66 25 2b 3d 32  34 0d 03 02 36 20 21 66  |.0:f%+=24...6 !f|
000007a0  25 3d 26 38 30 3a 66 25  21 34 3d 2d 31 3a 66 25  |%=&80:f%!4=-1:f%|
000007b0  21 38 3d 26 30 37 30 30  33 30 31 31 3a 24 28 66  |!8=&07003011:$(f|
000007c0  25 2b 31 32 29 3d 22 51  75 69 74 22 2b bd 30 0d  |%+12)="Quit"+.0.|
000007d0  03 0c 05 e1 0d 03 16 05  3a 0d 03 20 10 dd f2 68  |........:.. ...h|
000007e0  61 6e 64 6c 65 6d 65 6e  75 0d 03 2a 0c 20 ea 20  |andlemenu..*. . |
000007f0  61 25 2c 6c 25 0d 03 34  0d 20 c8 8e 20 21 71 25  |a%,l%..4. .. !q%|
00000800  20 ca 0d 03 3e 0a 20 20  20 c9 20 31 0d 03 48 08  | ...>.   . 1..H.|
00000810  20 20 20 e0 0d 03 52 06  20 cb 0d 03 5c 21 20 c8  |   ...R. ...\! .|
00000820  99 20 22 57 69 6d 70 5f  47 65 74 50 6f 69 6e 74  |. "Wimp_GetPoint|
00000830  65 72 49 6e 66 6f 22 2c  2c 71 25 0d 03 66 22 20  |erInfo",,q%..f" |
00000840  e7 20 28 28 71 25 21 38  29 20 80 20 31 29 3d 31  |. ((q%!8) . 1)=1|
00000850  20 8c 20 f2 6f 70 65 6e  5f 6d 65 6e 75 0d 03 70  | . .open_menu..p|
00000860  05 e1 0d 03 7a 05 3a 0d  03 84 0d dd f2 69 6e 66  |....z.:......inf|
00000870  6f 62 6f 78 0d 03 8e 0b  ea 20 73 25 2c 69 25 0d  |obox..... s%,i%.|
00000880  03 98 0e 73 25 3d 69 6e  66 6f 73 70 25 0d 03 a2  |...s%=infosp%...|
00000890  13 73 25 21 32 38 3d 26  38 34 30 30 30 30 31 32  |.s%!28=&84000012|
000008a0  0d 03 ac 12 73 25 21 33  32 3d 26 31 30 37 30 32  |....s%!32=&10702|
000008b0  30 37 0d 03 b6 10 73 25  21 33 36 3d 26 32 30 31  |07....s%!36=&201|
000008c0  30 33 0d 03 c0 14 73 25  21 34 30 3d 32 30 3a 73  |03....s%!40=20:s|
000008d0  25 21 34 34 3d 30 0d 03  ca 17 73 25 21 34 38 3d  |%!44=0....s%!48=|
000008e0  36 33 36 3a 73 25 21 35  32 3d 32 31 36 0d 03 d4  |636:s%!52=216...|
000008f0  13 73 25 21 35 36 3d 26  30 30 30 30 30 31 31 39  |.s%!56=&00000119|
00000900  0d 03 de 13 73 25 21 36  30 3d 26 30 30 30 30 30  |....s%!60=&00000|
00000910  30 30 30 0d 03 e8 0b 73  25 21 36 34 3d 31 0d 03  |000....s%!64=1..|
00000920  f2 0d 73 25 21 36 38 3d  36 31 36 0d 03 fc 0d 73  |..s%!68=616....s|
00000930  25 21 37 30 3d 32 31 36  0d 04 06 10 73 25 21 37  |%!70=216....s%!7|
00000940  32 3d 73 25 2b 35 32 38  0d 04 10 10 73 25 21 37  |2=s%+528....s%!7|
00000950  36 3d 73 25 2b 33 39 30  0d 04 1a 0c 73 25 21 38  |6=s%+390....s%!8|
00000960  30 3d 33 32 0d 04 24 0b  73 25 21 38 34 3d 38 0d  |0=32..$.s%!84=8.|
00000970  04 2e 0c 69 25 3d 73 25  2b 38 38 0d 04 38 11 21  |...i%=s%+88..8.!|
00000980  69 25 3d 33 32 3a 69 25  21 34 3d 38 0d 04 42 15  |i%=32:i%!4=8..B.|
00000990  69 25 21 38 3d 31 38 34  3a 69 25 21 31 32 3d 35  |i%!8=184:i%!12=5|
000009a0  36 0d 04 4c 13 69 25 21  31 36 3d 26 30 37 30 30  |6..L.i%!16=&0700|
000009b0  30 32 31 31 0d 04 56 1a  24 28 69 25 2b 32 30 29  |0211..V.$(i%+20)|
000009c0  3d 22 56 65 72 73 69 6f  6e 3a 22 2b bd 30 0d 04  |="Version:"+.0..|
000009d0  60 0a 69 25 2b 3d 33 32  0d 04 6a 12 21 69 25 3d  |`.i%+=32..j.!i%=|
000009e0  31 38 38 3a 69 25 21 34  3d 38 0d 04 74 15 69 25  |188:i%!4=8..t.i%|
000009f0  21 38 3d 36 33 32 3a 69  25 21 31 32 3d 35 36 0d  |!8=632:i%!12=56.|
00000a00  04 7e 13 69 25 21 31 36  3d 26 30 37 30 30 30 31  |.~.i%!16=&070001|
00000a10  33 44 0d 04 88 10 69 25  21 32 30 3d 73 25 2b 34  |3D....i%!20=s%+4|
00000a20  30 30 0d 04 92 10 69 25  21 32 34 3d 73 25 2b 33  |00....i%!24=s%+3|
00000a30  39 30 0d 04 9c 0c 69 25  21 32 38 3d 33 30 0d 04  |90....i%!28=30..|
00000a40  a6 0a 69 25 2b 3d 33 32  0d 04 b0 12 21 69 25 3d  |..i%+=32....!i%=|
00000a50  33 32 3a 69 25 21 34 3d  36 30 0d 04 ba 16 69 25  |32:i%!4=60....i%|
00000a60  21 38 3d 31 38 34 3a 69  25 21 31 32 3d 31 30 38  |!8=184:i%!12=108|
00000a70  0d 04 c4 13 69 25 21 31  36 3d 26 30 37 30 30 30  |....i%!16=&07000|
00000a80  32 31 31 0d 04 ce 19 24  28 69 25 2b 32 30 29 3d  |211....$(i%+20)=|
00000a90  22 41 75 74 68 6f 72 3a  22 2b bd 30 0d 04 d8 0a  |"Author:"+.0....|
00000aa0  69 25 2b 3d 33 32 0d 04  e2 13 21 69 25 3d 31 38  |i%+=32....!i%=18|
00000ab0  38 3a 69 25 21 34 3d 36  30 0d 04 ec 16 69 25 21  |8:i%!4=60....i%!|
00000ac0  38 3d 36 33 32 3a 69 25  21 31 32 3d 31 30 38 0d  |8=632:i%!12=108.|
00000ad0  04 f6 13 69 25 21 31 36  3d 26 30 37 30 30 30 31  |...i%!16=&070001|
00000ae0  33 44 0d 05 00 10 69 25  21 32 30 3d 73 25 2b 34  |3D....i%!20=s%+4|
00000af0  33 32 0d 05 0a 10 69 25  21 32 34 3d 73 25 2b 33  |32....i%!24=s%+3|
00000b00  39 30 0d 05 14 0c 69 25  21 32 38 3d 33 30 0d 05  |90....i%!28=30..|
00000b10  1e 0a 69 25 2b 3d 33 32  0d 05 28 13 21 69 25 3d  |..i%+=32..(.!i%=|
00000b20  33 32 3a 69 25 21 34 3d  31 31 32 0d 05 32 16 69  |32:i%!4=112..2.i|
00000b30  25 21 38 3d 31 38 34 3a  69 25 21 31 32 3d 31 36  |%!8=184:i%!12=16|
00000b40  30 0d 05 3c 13 69 25 21  31 36 3d 26 30 37 30 30  |0..<.i%!16=&0700|
00000b50  30 32 31 31 0d 05 46 1a  24 28 69 25 2b 32 30 29  |0211..F.$(i%+20)|
00000b60  3d 22 50 75 72 70 6f 73  65 3a 22 2b bd 30 0d 05  |="Purpose:"+.0..|
00000b70  50 0a 69 25 2b 3d 33 32  0d 05 5a 14 21 69 25 3d  |P.i%+=32..Z.!i%=|
00000b80  31 38 38 3a 69 25 21 34  3d 31 31 32 0d 05 64 16  |188:i%!4=112..d.|
00000b90  69 25 21 38 3d 36 33 32  3a 69 25 21 31 32 3d 31  |i%!8=632:i%!12=1|
00000ba0  36 30 0d 05 6e 13 69 25  21 31 36 3d 26 30 37 30  |60..n.i%!16=&070|
00000bb0  30 30 31 33 44 0d 05 78  10 69 25 21 32 30 3d 73  |0013D..x.i%!20=s|
00000bc0  25 2b 34 36 34 0d 05 82  10 69 25 21 32 34 3d 73  |%+464....i%!24=s|
00000bd0  25 2b 33 39 30 0d 05 8c  0c 69 25 21 32 38 3d 33  |%+390....i%!28=3|
00000be0  30 0d 05 96 0a 69 25 2b  3d 33 32 0d 05 a0 13 21  |0....i%+=32....!|
00000bf0  69 25 3d 33 32 3a 69 25  21 34 3d 31 36 34 0d 05  |i%=32:i%!4=164..|
00000c00  aa 16 69 25 21 38 3d 31  38 34 3a 69 25 21 31 32  |..i%!8=184:i%!12|
00000c10  3d 32 31 32 0d 05 b4 13  69 25 21 31 36 3d 26 30  |=212....i%!16=&0|
00000c20  37 30 30 30 32 31 31 0d  05 be 17 24 28 69 25 2b  |7000211....$(i%+|
00000c30  32 30 29 3d 22 4e 61 6d  65 3a 22 2b bd 30 0d 05  |20)="Name:"+.0..|
00000c40  c8 0a 69 25 2b 3d 33 32  0d 05 d2 14 21 69 25 3d  |..i%+=32....!i%=|
00000c50  31 38 38 3a 69 25 21 34  3d 31 36 34 0d 05 dc 16  |188:i%!4=164....|
00000c60  69 25 21 38 3d 36 33 32  3a 69 25 21 31 32 3d 32  |i%!8=632:i%!12=2|
00000c70  31 32 0d 05 e6 13 69 25  21 31 36 3d 26 30 37 30  |12....i%!16=&070|
00000c80  30 30 31 33 44 0d 05 f0  10 69 25 21 32 30 3d 73  |0013D....i%!20=s|
00000c90  25 2b 34 39 36 0d 05 fa  10 69 25 21 32 34 3d 73  |%+496....i%!24=s|
00000ca0  25 2b 33 39 30 0d 06 04  0c 69 25 21 32 38 3d 33  |%+390....i%!28=3|
00000cb0  30 0d 06 0e 0c 73 25 21  33 39 30 3d 30 0d 06 18  |0....s%!390=0...|
00000cc0  23 24 28 73 25 2b 34 30  30 29 3d 22 31 2e 30 30  |#$(s%+400)="1.00|
00000cd0  20 28 32 38 2d 4a 75 6c  2d 39 39 29 22 2b bd 30  | (28-Jul-99)"+.0|
00000ce0  0d 06 22 27 24 28 73 25  2b 34 33 32 29 3d 22 a9  |.."'$(s%+432)=".|
00000cf0  20 44 6f 6d 69 6e 69 63  20 46 6f 72 64 2c 20 31  | Dominic Ford, 1|
00000d00  39 39 39 22 2b bd 30 0d  06 2c 26 24 28 73 25 2b  |999"+.0..,&$(s%+|
00000d10  34 36 34 29 3d 22 4f 43  52 20 6f 66 20 6d 75 73  |464)="OCR of mus|
00000d20  69 63 20 73 63 6f 72 65  73 22 2b bd 30 0d 06 36  |ic scores"+.0..6|
00000d30  1b 24 28 73 25 2b 34 39  36 29 3d 22 53 63 6f 72  |.$(s%+496)="Scor|
00000d40  65 4f 43 52 22 2b bd 30  0d 06 40 25 24 28 73 25  |eOCR"+.0..@%$(s%|
00000d50  2b 35 32 38 29 3d 22 41  62 6f 75 74 20 74 68 69  |+528)="About thi|
00000d60  73 20 70 72 6f 67 72 61  6d 22 2b bd 30 0d 06 4a  |s program"+.0..J|
00000d70  26 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  |&.. "Wimp_Create|
00000d80  57 69 6e 64 6f 77 22 2c  2c 73 25 20 b8 20 69 6e  |Window",,s% . in|
00000d90  66 6f 25 0d 06 54 05 e1  0d 06 5e 05 3a 0d 06 68  |fo%..T....^.:..h|
00000da0  0f dd f2 6f 70 65 6e 5f  6d 65 6e 75 0d 06 72 2f  |...open_menu..r/|
00000db0  20 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  | .. "Wimp_Create|
00000dc0  4d 65 6e 75 22 2c 2c 6d  65 6e 75 73 70 25 2c 28  |Menu",,menusp%,(|
00000dd0  21 71 25 29 2d 36 34 2c  31 36 30 0d 06 7c 05 e1  |!q%)-64,160..|..|
00000de0  0d 06 86 05 3a 0d 06 90  0a dd f2 69 63 6f 6e 0d  |....:......icon.|
00000df0  06 9a 0f 73 70 25 3d 69  63 6f 6e 73 70 25 0d 06  |...sp%=iconsp%..|
00000e00  a4 0b 21 73 70 25 3d 2d  31 0d 06 ae 0b 73 70 25  |..!sp%=-1....sp%|
00000e10  21 34 3d 30 0d 06 b8 0b  73 70 25 21 38 3d 30 0d  |!4=0....sp%!8=0.|
00000e20  06 c2 0e 73 70 25 21 31  32 3d 31 30 30 0d 06 cc  |...sp%!12=100...|
00000e30  0d 73 70 25 21 31 36 3d  36 38 0d 06 d6 2c 73 70  |.sp%!16=68...,sp|
00000e40  25 21 32 30 3d 25 30 30  30 31 30 30 30 31 30 30  |%!20=%0001000100|
00000e50  30 30 30 30 30 30 30 30  31 31 30 30 30 30 30 30  |0000000011000000|
00000e60  31 30 31 30 31 30 0d 06  e0 1e f4 20 20 20 20 20  |101010.....     |
00000e70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e80  5e 20 20 5e 0d 06 ea 1c  24 28 73 70 25 2b 32 34  |^  ^....$(sp%+24|
00000e90  29 3d 22 21 73 63 6f 72  65 6f 63 72 22 2b bd 30  |)="!scoreocr"+.0|
00000ea0  0d 06 f4 25 c8 99 20 22  57 69 6d 70 5f 43 72 65  |...%.. "Wimp_Cre|
00000eb0  61 74 65 49 63 6f 6e 22  2c 2c 73 70 25 20 b8 20  |ateIcon",,sp% . |
00000ec0  69 63 6f 6e 25 0d 06 fe  05 e1 0d 07 08 05 3a 0d  |icon%.........:.|
00000ed0  07 12 10 f4 20 4f 43 52  20 45 4e 47 49 4e 45 0d  |.... OCR ENGINE.|
00000ee0  07 1c 05 3a 0d 07 26 16  dd f2 64 6f 6f 63 72 28  |...:..&...doocr(|
00000ef0  66 69 6c 65 6e 61 6d 65  24 29 0d 07 30 21 71 75  |filename$)..0!qu|
00000f00  69 74 3d a3 3a 2a 53 50  4f 4f 4c 20 3c 4f 62 65  |it=.:*SPOOL <Obe|
00000f10  79 24 44 69 72 3e 2e 74  65 6d 70 0d 07 3a 07 ea  |y$Dir>.temp..:..|
00000f20  20 85 0d 07 44 1b ee 20  85 20 ea 20 f6 3a f1 22  | ...D.. . . .:."|
00000f30  20 40 20 22 3b 9e 27 27  27 27 27 3a e0 0d 07 4e  | @ ";.''''':...N|
00000f40  09 f2 69 6e 69 74 0d 07  58 0e f2 67 65 74 73 74  |..init..X..getst|
00000f50  61 76 65 73 0d 07 62 17  f2 67 65 74 74 69 6c 74  |aves..b..gettilt|
00000f60  3a e7 20 71 75 69 74 20  8c 20 e1 0d 07 6c 1b f2  |:. quit . ...l..|
00000f70  63 68 65 63 6b 73 74 61  76 65 73 3a e7 20 71 75  |checkstaves:. qu|
00000f80  69 74 20 8c 20 e1 0d 07  76 12 f2 6d 65 61 73 75  |it . ...v..measu|
00000f90  72 65 73 74 61 76 65 73  0d 07 80 13 e3 20 73 3d  |restaves..... s=|
00000fa0  31 20 b8 20 73 74 61 76  65 73 25 0d 07 8a 10 f2  |1 . staves%.....|
00000fb0  67 65 74 6e 6f 74 65 73  28 73 29 0d 07 94 05 ed  |getnotes(s).....|
00000fc0  0d 07 9e 09 f2 73 6f 72  74 0d 07 a8 10 f2 6d 61  |.....sort.....ma|
00000fd0  6b 65 6d 61 65 73 74 72  6f 0d 07 b2 17 f1 27 27  |kemaestro.....''|
00000fe0  22 4f 43 52 20 63 6f 6d  70 6c 65 74 65 64 22 27  |"OCR completed"'|
00000ff0  0d 07 bc 0a 2a 73 70 6f  6f 6c 0d 07 c6 05 e1 0d  |....*spool......|
00001000  07 d0 05 3a 0d 07 da 0a  dd f2 69 6e 69 74 0d 07  |...:......init..|
00001010  e4 3c 21 73 61 72 65 61  3d 26 38 30 30 30 30 3a  |.<!sarea=&80000:|
00001020  21 28 73 61 72 65 61 2b  38 29 3d 31 36 3a c8 99  |!(sarea+8)=16:..|
00001030  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 39  | "OS_SpriteOp",9|
00001040  2b 32 35 36 2c 73 61 72  65 61 0d 07 ee 2b c8 99  |+256,sarea...+..|
00001050  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 31  | "OS_SpriteOp",1|
00001060  30 2b 32 35 36 2c 73 61  72 65 61 2c 66 69 6c 65  |0+256,sarea,file|
00001070  6e 61 6d 65 24 0d 07 f8  2c c8 99 20 22 4f 53 5f  |name$...,.. "OS_|
00001080  53 70 72 69 74 65 4f 70  22 2c 31 33 2b 32 35 36  |SpriteOp",13+256|
00001090  2c 73 61 72 65 61 2c 74  78 74 25 2c 32 35 36 2c  |,sarea,txt%,256,|
000010a0  31 0d 08 02 39 c8 99 20  22 4f 53 5f 53 70 72 69  |1...9.. "OS_Spri|
000010b0  74 65 4f 70 22 2c 34 30  2b 32 35 36 2c 73 61 72  |teOp",40+256,sar|
000010c0  65 61 2c 74 78 74 25 20  b8 20 2c 2c 2c 78 73 69  |ea,txt% . ,,,xsi|
000010d0  7a 65 25 2c 79 73 69 7a  65 25 0d 08 0c 0a f2 63  |ze%,ysize%.....c|
000010e0  6c 65 61 72 0d 08 16 2d  f1 22 4d 75 73 69 63 20  |lear...-."Music |
000010f0  53 63 6f 72 65 20 4f 43  52 22 27 22 44 6f 6d 69  |Score OCR"'"Domi|
00001100  6e 69 63 20 46 6f 72 64  2c 20 31 39 39 39 22 27  |nic Ford, 1999"'|
00001110  27 0d 08 20 05 e1 0d 08  2a 05 3a 0d 08 34 0a dd  |'.. ....*.:..4..|
00001120  f2 64 72 61 77 0d 08 3e  34 21 73 70 61 63 65 3d  |.draw..>4!space=|
00001130  31 3a 21 28 73 70 61 63  65 2b 34 29 3d 31 3a 21  |1:!(space+4)=1:!|
00001140  28 73 70 61 63 65 2b 38  29 3d 32 3a 21 28 73 70  |(space+8)=2:!(sp|
00001150  61 63 65 2b 31 32 29 3d  32 0d 08 48 40 c8 99 20  |ace+12)=2..H@.. |
00001160  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 35 32  |"OS_SpriteOp",52|
00001170  2b 32 35 36 2c 73 61 72  65 61 2c 74 78 74 25 2c  |+256,sarea,txt%,|
00001180  30 2c 31 30 32 34 2d 79  73 69 7a 65 25 2a 32 2c  |0,1024-ysize%*2,|
00001190  30 2c 73 70 61 63 65 2c  30 0d 08 52 05 e1 0d 08  |0,space,0..R....|
000011a0  5c 05 3a 0d 08 66 0f dd  f2 67 65 74 73 74 61 76  |\.:..f...getstav|
000011b0  65 73 0d 08 70 1e f1 22  53 65 61 72 63 68 69 6e  |es..p.."Searchin|
000011c0  67 20 66 6f 72 20 73 74  61 76 65 73 2e 2e 2e 22  |g for staves..."|
000011d0  0d 08 7a 1f 73 74 61 76  65 73 25 3d 30 3a 73 6c  |..z.staves%=0:sl|
000011e0  61 73 74 25 3d 79 73 69  7a 65 25 2b 32 30 30 0d  |ast%=ysize%+200.|
000011f0  08 84 16 e3 79 25 3d 79  73 69 7a 65 25 2d 31 20  |....y%=ysize%-1 |
00001200  b8 32 88 2d 31 0d 08 8e  3e c8 99 20 22 4f 53 5f  |.2.-1...>.. "OS_|
00001210  53 70 72 69 74 65 4f 70  22 2c 34 31 2b 32 35 36  |SpriteOp",41+256|
00001220  2c 73 61 72 65 61 2c 74  78 74 25 2c 78 73 69 7a  |,sarea,txt%,xsiz|
00001230  65 25 20 81 34 2c 79 25  20 b8 20 2c 2c 2c 2c 2c  |e% .4,y% . ,,,,,|
00001240  63 6c 25 0d 08 98 0c e7  63 6c 25 3c 3e 30 8c 0d  |cl%.....cl%<>0..|
00001250  08 a2 0a 20 63 74 25 3d  30 0d 08 ac 15 20 e3 79  |... ct%=0.... .y|
00001260  63 25 3d 79 25 2d 31 20  b8 20 79 25 2b 31 0d 08  |c%=y%-1 . y%+1..|
00001270  b6 24 20 20 e3 78 25 3d  28 78 73 69 7a 65 25 20  |.$  .x%=(xsize% |
00001280  81 20 38 29 b8 28 78 73  69 7a 65 25 20 81 32 29  |. 8).(xsize% .2)|
00001290  88 34 0d 08 c0 3b 20 20  20 c8 99 20 22 4f 53 5f  |.4...;   .. "OS_|
000012a0  53 70 72 69 74 65 4f 70  22 2c 34 31 2b 32 35 36  |SpriteOp",41+256|
000012b0  2c 73 61 72 65 61 2c 74  78 74 25 2c 78 25 2c 79  |,sarea,txt%,x%,y|
000012c0  63 25 20 b8 20 2c 2c 2c  2c 2c 63 6c 25 0d 08 ca  |c% . ,,,,,cl%...|
000012d0  12 20 20 20 63 74 25 3d  63 74 25 2b 63 6c 25 0d  |.   ct%=ct%+cl%.|
000012e0  08 d4 07 20 20 ed 0d 08  de 06 20 ed 0d 08 e8 2e  |...  ..... .....|
000012f0  20 e7 20 63 74 25 3e 28  78 73 69 7a 65 25 2a 30  | . ct%>(xsize%*0|
00001300  2e 31 29 20 8c 20 f2 67  6f 74 6c 69 6e 65 28 79  |.1) . .gotline(y|
00001310  25 29 3a 79 25 3d 79 25  2d 34 0d 08 f2 05 cd 0d  |%):y%=y%-4......|
00001320  08 fc 05 ed 0d 09 06 05  e1 0d 09 10 05 3a 0d 09  |.............:..|
00001330  1a 0d dd f2 67 65 74 74  69 6c 74 0d 09 24 29 f1  |....gettilt..$).|
00001340  22 4d 65 61 73 75 72 69  6e 67 20 61 6e 67 6c 65  |"Measuring angle|
00001350  20 6f 66 20 74 69 6c 74  20 6f 66 20 73 63 61 6e  | of tilt of scan|
00001360  2e 2e 2e 22 0d 09 2e 2c  79 25 3d 73 74 61 76 65  |..."...,y%=stave|
00001370  28 31 2c 30 29 2b 31 30  3a e7 20 79 25 3e 79 73  |(1,0)+10:. y%>ys|
00001380  69 7a 65 25 20 8c 20 79  25 3d 79 73 69 7a 65 25  |ize% . y%=ysize%|
00001390  0d 09 38 05 f5 0d 09 42  12 20 79 25 3d 79 25 2d  |..8....B. y%=y%-|
000013a0  31 3a 63 74 25 3d 30 0d  09 4c 43 20 c8 99 20 22  |1:ct%=0..LC .. "|
000013b0  4f 53 5f 53 70 72 69 74  65 4f 70 22 2c 34 31 2b  |OS_SpriteOp",41+|
000013c0  32 35 36 2c 73 61 72 65  61 2c 74 78 74 25 2c 33  |256,sarea,txt%,3|
000013d0  2a 28 78 73 69 7a 65 25  20 81 34 29 2c 79 25 20  |*(xsize% .4),y% |
000013e0  b8 20 2c 2c 2c 2c 2c 63  6c 25 0d 09 56 0d 20 e7  |. ,,,,,cl%..V. .|
000013f0  63 6c 25 3c 3e 30 8c 0d  09 60 0b 20 20 63 74 25  |cl%<>0...`.  ct%|
00001400  3d 30 0d 09 6a 16 20 20  e3 79 63 25 3d 79 25 2d  |=0..j.  .yc%=y%-|
00001410  31 20 b8 20 79 25 2b 31  0d 09 74 27 20 20 20 e3  |1 . y%+1..t'   .|
00001420  78 25 3d 28 78 73 69 7a  65 25 20 81 20 32 29 b8  |x%=(xsize% . 2).|
00001430  37 2a 28 78 73 69 7a 65  25 20 81 38 29 88 34 0d  |7*(xsize% .8).4.|
00001440  09 7e 3c 20 20 20 20 c8  99 20 22 4f 53 5f 53 70  |.~<    .. "OS_Sp|
00001450  72 69 74 65 4f 70 22 2c  34 31 2b 32 35 36 2c 73  |riteOp",41+256,s|
00001460  61 72 65 61 2c 74 78 74  25 2c 78 25 2c 79 63 25  |area,txt%,x%,yc%|
00001470  20 b8 20 2c 2c 2c 2c 2c  63 6c 25 0d 09 88 13 20  | . ,,,,,cl%.... |
00001480  20 20 20 63 74 25 3d 63  74 25 2b 63 6c 25 0d 09  |   ct%=ct%+cl%..|
00001490  92 08 20 20 20 ed 0d 09  9c 07 20 20 ed 0d 09 a6  |..   .....  ....|
000014a0  06 20 cd 0d 09 b0 29 fd  20 63 74 25 3e 28 78 73  |. ....). ct%>(xs|
000014b0  69 7a 65 25 2a 30 2e 31  29 20 84 20 79 25 3d 73  |ize%*0.1) . y%=s|
000014c0  74 61 76 65 28 31 2c 30  29 2d 31 30 0d 09 ba 4d  |tave(1,0)-10...M|
000014d0  e7 20 79 25 3d 73 74 61  76 65 28 31 2c 30 29 2d  |. y%=stave(1,0)-|
000014e0  31 30 20 8c 20 f1 22 54  68 69 73 20 73 63 6f 72  |10 . ."This scor|
000014f0  65 20 69 73 20 6e 6f 74  20 6c 65 67 69 62 6c 65  |e is not legible|
00001500  2e 20 50 6c 65 61 73 65  20 72 65 2d 73 63 61 6e  |. Please re-scan|
00001510  2e 22 3a 71 75 69 74 3d  b9 0d 09 c4 1d 6f 66 66  |.":quit=.....off|
00001520  73 65 74 25 3d 28 79 25  2d 73 74 61 76 65 28 31  |set%=(y%-stave(1|
00001530  2c 30 29 29 81 32 0d 09  ce 05 e1 0d 09 d8 05 3a  |,0)).2.........:|
00001540  0d 09 e2 11 dd f2 67 6f  74 6c 69 6e 65 28 79 25  |......gotline(y%|
00001550  29 0d 09 ec 28 e7 20 79  25 3c 28 73 6c 61 73 74  |)...(. y%<(slast|
00001560  25 2d 32 30 29 20 8c 20  73 74 61 76 65 73 25 3d  |%-20) . staves%=|
00001570  73 74 61 76 65 73 25 2b  31 0d 09 f6 26 73 74 61  |staves%+1...&sta|
00001580  76 65 28 73 74 61 76 65  73 25 2c 6e 6f 6c 69 6e  |ve(staves%,nolin|
00001590  65 73 28 73 74 61 76 65  73 25 29 29 3d 79 25 0d  |es(staves%))=y%.|
000015a0  0a 00 3f e7 20 6e 6f 6c  69 6e 65 73 28 73 74 61  |..?. nolines(sta|
000015b0  76 65 73 25 29 3c 3e 35  20 8c 20 6e 6f 6c 69 6e  |ves%)<>5 . nolin|
000015c0  65 73 28 73 74 61 76 65  73 25 29 3d 6e 6f 6c 69  |es(staves%)=noli|
000015d0  6e 65 73 28 73 74 61 76  65 73 25 29 2b 31 0d 0a  |nes(staves%)+1..|
000015e0  0a 0d 73 6c 61 73 74 25  3d 79 25 0d 0a 14 05 e1  |..slast%=y%.....|
000015f0  0d 0a 1e 05 3a 0d 0a 28  11 dd f2 63 68 65 63 6b  |....:..(...check|
00001600  73 74 61 76 65 73 0d 0a  32 40 f1 27 22 50 6c 65  |staves..2@.'"Ple|
00001610  61 73 65 20 63 6f 6e 66  69 72 6d 3a 22 27 27 27  |ase confirm:"'''|
00001620  22 54 68 69 73 20 73 63  6f 72 65 20 68 61 73 20  |"This score has |
00001630  22 3b 73 74 61 76 65 73  25 3b 22 20 73 74 61 76  |";staves%;" stav|
00001640  65 73 2e 22 27 27 0d 0a  3c 13 e3 20 73 3d 31 20  |es."''..<.. s=1 |
00001650  b8 20 73 74 61 76 65 73  25 0d 0a 46 34 f1 22 53  |. staves%..F4."S|
00001660  74 61 76 65 20 22 3b 73  3b 22 20 63 6f 6e 73 69  |tave ";s;" consi|
00001670  73 74 73 20 6f 66 20 22  3b 6e 6f 6c 69 6e 65 73  |sts of ";nolines|
00001680  28 73 29 3b 22 20 6c 69  6e 65 73 2e 22 0d 0a 50  |(s);" lines."..P|
00001690  05 ed 0d 0a 5a 1d f1 27  27 27 22 49 73 20 74 68  |....Z..'''"Is th|
000016a0  69 73 20 4f 4b 3f 20 28  59 2f 4e 29 20 22 3b 0d  |is OK? (Y/N) ";.|
000016b0  0a 64 1b f5 20 41 24 3d  be 3a fd 20 a7 22 59 79  |.d.. A$=.:. ."Yy|
000016c0  4e 6e 22 2c 41 24 29 3c  3e 30 0d 0a 6e 14 e7 20  |Nn",A$)<>0..n.. |
000016d0  a7 22 4e 6e 22 2c 41 24  29 3c 3e 30 20 8c 0d 0a  |."Nn",A$)<>0 ...|
000016e0  78 2c 20 f1 22 4e 6f 22  27 27 22 50 6c 65 61 73  |x, ."No"''"Pleas|
000016f0  65 20 72 65 2d 73 63 61  6e 20 61 6e 64 20 74 72  |e re-scan and tr|
00001700  79 20 61 67 61 69 6e 2e  22 27 0d 0a 82 0b 20 71  |y again."'.... q|
00001710  75 69 74 3d b9 0d 0a 8c  05 cd 0d 0a 96 0b f1 22  |uit=..........."|
00001720  59 65 73 22 27 0d 0a a0  37 e8 22 48 6f 77 20 6d  |Yes"'...7."How m|
00001730  61 6e 79 20 73 74 61 76  65 73 20 61 72 65 20 69  |any staves are i|
00001740  6e 20 65 61 63 68 20 6c  69 6e 65 20 6f 66 20 6d  |n each line of m|
00001750  75 73 69 63 22 3b 69 6e  6d 61 78 25 0d 0a aa 16  |usic";inmax%....|
00001760  e7 69 6e 6d 61 78 25 3d  31 8c 6e 6f 6d 61 78 25  |.inmax%=1.nomax%|
00001770  3d 38 0d 0a b4 16 e7 69  6e 6d 61 78 25 3d 32 8c  |=8.....inmax%=2.|
00001780  6e 6f 6d 61 78 25 3d 34  0d 0a be 16 e7 69 6e 6d  |nomax%=4.....inm|
00001790  61 78 25 3e 32 8c 6e 6f  6d 61 78 25 3d 32 0d 0a  |ax%>2.nomax%=2..|
000017a0  c8 05 e1 0d 0a d2 05 3a  0d 0a dc 13 dd f2 6d 65  |.......:......me|
000017b0  61 73 75 72 65 73 74 61  76 65 73 0d 0a e6 13 e3  |asurestaves.....|
000017c0  20 73 3d 31 20 b8 20 73  74 61 76 65 73 25 0d 0a  | s=1 . staves%..|
000017d0  f0 1f f1 22 4d 65 61 73  75 72 69 6e 67 20 73 74  |..."Measuring st|
000017e0  61 76 65 20 22 3b 73 3b  22 2e 2e 2e 22 0d 0a fa  |ave ";s;"..."...|
000017f0  19 20 78 25 3d 30 3a f5  20 78 25 3d 78 25 2b 31  |. x%=0:. x%=x%+1|
00001800  3a 63 74 25 3d 30 0d 0b  04 19 20 20 e3 6c 69 6e  |:ct%=0....  .lin|
00001810  3d 30 b8 6e 6f 6c 69 6e  65 73 28 73 29 2d 31 0d  |=0.nolines(s)-1.|
00001820  0b 0e 2b 20 20 20 e3 79  3d 28 73 74 61 76 65 28  |..+   .y=(stave(|
00001830  73 2c 6c 69 6e 29 2d 31  29 b8 28 73 74 61 76 65  |s,lin)-1).(stave|
00001840  28 73 2c 6c 69 6e 29 2b  31 29 0d 0b 18 3a 20 20  |(s,lin)+1)...:  |
00001850  20 20 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |  .. "OS_SpriteO|
00001860  70 22 2c 34 31 2b 32 35  36 2c 73 61 72 65 61 2c  |p",41+256,sarea,|
00001870  74 78 74 25 2c 78 25 2c  79 20 b8 20 2c 2c 2c 2c  |txt%,x%,y . ,,,,|
00001880  2c 63 6c 25 0d 0b 22 13  20 20 20 20 63 74 25 3d  |,cl%..".    ct%=|
00001890  63 74 25 2b 63 6c 25 0d  0b 2c 08 20 20 20 ed 0d  |ct%+cl%..,.   ..|
000018a0  0b 36 07 20 20 ed 0d 0b  40 18 20 20 e7 20 63 74  |.6.  ...@.  . ct|
000018b0  25 3e 6e 6f 6c 69 6e 65  73 28 73 29 20 8c 0d 0b  |%>nolines(s) ...|
000018c0  4a 0c 20 20 20 63 74 25  3d 30 0d 0b 54 1a 20 20  |J.   ct%=0..T.  |
000018d0  20 e3 6c 69 6e 3d 30 b8  6e 6f 6c 69 6e 65 73 28  | .lin=0.nolines(|
000018e0  73 29 2d 31 0d 0b 5e 2c  20 20 20 20 e3 79 3d 28  |s)-1..^,    .y=(|
000018f0  73 74 61 76 65 28 73 2c  6c 69 6e 29 2b 35 29 b8  |stave(s,lin)+5).|
00001900  28 73 74 61 76 65 28 73  2c 6c 69 6e 29 2b 37 29  |(stave(s,lin)+7)|
00001910  0d 0b 68 3b 20 20 20 20  20 c8 99 20 22 4f 53 5f  |..h;     .. "OS_|
00001920  53 70 72 69 74 65 4f 70  22 2c 34 31 2b 32 35 36  |SpriteOp",41+256|
00001930  2c 73 61 72 65 61 2c 74  78 74 25 2c 78 25 2c 79  |,sarea,txt%,x%,y|
00001940  20 b8 20 2c 2c 2c 2c 2c  63 6c 25 0d 0b 72 16 20  | . ,,,,,cl%..r. |
00001950  20 20 20 20 63 74 25 3d  63 74 25 2b 31 2d 63 6c  |    ct%=ct%+1-cl|
00001960  25 0d 0b 7c 09 20 20 20  20 ed 0d 0b 86 08 20 20  |%..|.    .....  |
00001970  20 ed 0d 0b 90 07 20 20  cd 0d 0b 9a 16 20 20 fd  | .....  .....  .|
00001980  20 63 74 25 3e 6e 6f 6c  69 6e 65 73 28 73 29 0d  | ct%>nolines(s).|
00001990  0b a4 11 20 20 73 74 61  72 74 28 73 29 3d 78 25  |...  start(s)=x%|
000019a0  0d 0b ae 05 3a 0d 0b b8  1e 20 78 25 3d 78 73 69  |....:.... x%=xsi|
000019b0  7a 65 25 3a f5 20 78 25  3d 78 25 2d 31 3a 63 74  |ze%:. x%=x%-1:ct|
000019c0  25 3d 30 0d 0b c2 19 20  20 e3 6c 69 6e 3d 30 b8  |%=0....  .lin=0.|
000019d0  6e 6f 6c 69 6e 65 73 28  73 29 2d 31 0d 0b cc 3b  |nolines(s)-1...;|
000019e0  20 20 20 e3 79 3d 28 73  74 61 76 65 28 73 2c 6c  |   .y=(stave(s,l|
000019f0  69 6e 29 2d 31 2b 6f 66  66 73 65 74 25 29 b8 28  |in)-1+offset%).(|
00001a00  73 74 61 76 65 28 73 2c  6c 69 6e 29 2b 31 2b 6f  |stave(s,lin)+1+o|
00001a10  66 66 73 65 74 25 29 0d  0b d6 3a 20 20 20 20 c8  |ffset%)...:    .|
00001a20  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00001a30  34 31 2b 32 35 36 2c 73  61 72 65 61 2c 74 78 74  |41+256,sarea,txt|
00001a40  25 2c 78 25 2c 79 20 b8  20 2c 2c 2c 2c 2c 63 6c  |%,x%,y . ,,,,,cl|
00001a50  25 0d 0b e0 13 20 20 20  20 63 74 25 3d 63 74 25  |%....    ct%=ct%|
00001a60  2b 63 6c 25 0d 0b ea 08  20 20 20 ed 0d 0b f4 07  |+cl%....   .....|
00001a70  20 20 ed 0d 0b fe 18 20  20 e7 20 63 74 25 3e 6e  |  .....  . ct%>n|
00001a80  6f 6c 69 6e 65 73 28 73  29 20 8c 0d 0c 08 0c 20  |olines(s) ..... |
00001a90  20 20 63 74 25 3d 30 0d  0c 12 1a 20 20 20 e3 6c  |  ct%=0....   .l|
00001aa0  69 6e 3d 30 b8 6e 6f 6c  69 6e 65 73 28 73 29 2d  |in=0.nolines(s)-|
00001ab0  31 0d 0c 1c 3c 20 20 20  20 e3 79 3d 28 73 74 61  |1...<    .y=(sta|
00001ac0  76 65 28 73 2c 6c 69 6e  29 2b 35 2b 6f 66 66 73  |ve(s,lin)+5+offs|
00001ad0  65 74 25 29 b8 28 73 74  61 76 65 28 73 2c 6c 69  |et%).(stave(s,li|
00001ae0  6e 29 2b 37 2b 6f 66 66  73 65 74 25 29 0d 0c 26  |n)+7+offset%)..&|
00001af0  3b 20 20 20 20 20 c8 99  20 22 4f 53 5f 53 70 72  |;     .. "OS_Spr|
00001b00  69 74 65 4f 70 22 2c 34  31 2b 32 35 36 2c 73 61  |iteOp",41+256,sa|
00001b10  72 65 61 2c 74 78 74 25  2c 78 25 2c 79 20 b8 20  |rea,txt%,x%,y . |
00001b20  2c 2c 2c 2c 2c 63 6c 25  0d 0c 30 16 20 20 20 20  |,,,,,cl%..0.    |
00001b30  20 63 74 25 3d 63 74 25  2b 31 2d 63 6c 25 0d 0c  | ct%=ct%+1-cl%..|
00001b40  3a 09 20 20 20 20 ed 0d  0c 44 08 20 20 20 ed 0d  |:.    ...D.   ..|
00001b50  0c 4e 07 20 20 cd 0d 0c  58 16 20 20 fd 20 63 74  |.N.  ...X.  . ct|
00001b60  25 3e 6e 6f 6c 69 6e 65  73 28 73 29 0d 0c 62 10  |%>nolines(s)..b.|
00001b70  20 20 73 74 6f 70 28 73  29 3d 78 25 0d 0c 6c 05  |  stop(s)=x%..l.|
00001b80  ed 0d 0c 76 05 e1 0d 0c  80 05 3a 0d 0c 8a 11 dd  |...v......:.....|
00001b90  f2 67 65 74 6e 6f 74 65  73 28 73 29 0d 0c 94 24  |.getnotes(s)...$|
00001ba0  f1 22 4e 6f 77 20 70 72  6f 63 65 73 73 69 6e 67  |."Now processing|
00001bb0  20 73 74 61 76 65 20 22  3b 73 3b 22 2e 2e 2e 22  | stave ";s;"..."|
00001bc0  0d 0c 9e 3b e7 6e 6f 6c  69 6e 65 73 28 73 29 3e  |...;.nolines(s)>|
00001bd0  32 20 8c 20 67 61 70 25  3d 28 73 74 61 76 65 28  |2 . gap%=(stave(|
00001be0  73 2c 30 29 2d 73 74 61  76 65 28 73 2c 31 29 29  |s,0)-stave(s,1))|
00001bf0  81 32 20 8b 20 67 61 70  25 3d 36 0d 0c a8 18 e3  |.2 . gap%=6.....|
00001c00  6c 69 6e 65 3d 30 b8 6e  6f 6c 69 6e 65 73 28 73  |line=0.nolines(s|
00001c10  29 2d 31 0d 0c b2 1a 20  e3 78 3d 73 74 61 72 74  |)-1.... .x=start|
00001c20  28 73 29 20 b8 20 73 74  6f 70 28 73 29 0d 0c bc  |(s) . stop(s)...|
00001c30  5c 20 20 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |\  .. "OS_Sprite|
00001c40  4f 70 22 2c 34 31 2b 32  35 36 2c 73 61 72 65 61  |Op",41+256,sarea|
00001c50  2c 74 78 74 25 2c 78 2c  73 74 61 76 65 28 73 2c  |,txt%,x,stave(s,|
00001c60  6c 69 6e 65 29 2b a8 28  6f 66 66 73 65 74 25 2a  |line)+.(offset%*|
00001c70  78 2f 78 73 69 7a 65 25  29 2d 67 61 70 25 20 b8  |x/xsize%)-gap% .|
00001c80  20 2c 2c 2c 2c 2c 63 6c  25 0d 0c c6 0e 20 20 e7  | ,,,,,cl%....  .|
00001c90  63 6c 25 3d 31 20 8c 0d  0c d0 0c 20 20 20 63 74  |cl%=1 .....   ct|
00001ca0  25 3d 30 0d 0c da 12 20  20 20 e3 78 32 3d 78 20  |%=0....   .x2=x |
00001cb0  b8 20 78 2b 33 0d 0c e4  60 20 20 20 20 c8 99 20  |. x+3...`    .. |
00001cc0  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 34 31  |"OS_SpriteOp",41|
00001cd0  2b 32 35 36 2c 73 61 72  65 61 2c 74 78 74 25 2c  |+256,sarea,txt%,|
00001ce0  78 32 2c 73 74 61 76 65  28 73 2c 6c 69 6e 65 29  |x2,stave(s,line)|
00001cf0  2b a8 28 6f 66 66 73 65  74 25 2a 78 32 2f 78 73  |+.(offset%*x2/xs|
00001d00  69 7a 65 25 29 2d 67 61  70 25 20 b8 20 2c 2c 2c  |ize%)-gap% . ,,,|
00001d10  2c 2c 63 6c 25 0d 0c ee  13 20 20 20 20 63 74 25  |,,cl%....    ct%|
00001d20  3d 63 74 25 2b 63 6c 25  0d 0c f8 08 20 20 20 ed  |=ct%+cl%....   .|
00001d30  0d 0d 02 1c 20 20 20 e7  20 63 74 25 3e 32 20 8c  |....   . ct%>2 .|
00001d40  20 f2 66 69 6c 6c 65 64  6e 6f 74 65 0d 0d 0c 07  | .fillednote....|
00001d50  20 20 cd 0d 0d 16 06 20  ed 0d 0d 20 05 ed 0d 0d  |  ..... ... ....|
00001d60  2a 05 e1 0d 0d 34 05 3a  0d 0d 3e 10 dd f2 66 69  |*....4.:..>...fi|
00001d70  6c 6c 65 64 6e 6f 74 65  0d 0d 48 34 6c 65 66 74  |llednote..H4left|
00001d80  25 3d 78 3a 79 3d 73 74  61 76 65 28 73 2c 6c 69  |%=x:y=stave(s,li|
00001d90  6e 65 29 2d 67 61 70 25  2b a8 28 6f 66 66 73 65  |ne)-gap%+.(offse|
00001da0  74 25 2a 78 2f 78 73 69  7a 65 25 29 0d 0d 52 05  |t%*x/xsize%)..R.|
00001db0  f5 0d 0d 5c 36 20 c8 99  20 22 4f 53 5f 53 70 72  |...\6 .. "OS_Spr|
00001dc0  69 74 65 4f 70 22 2c 34  31 2b 32 35 36 2c 73 61  |iteOp",41+256,sa|
00001dd0  72 65 61 2c 74 78 74 25  2c 78 2c 79 20 b8 20 2c  |rea,txt%,x,y . ,|
00001de0  2c 2c 2c 2c 63 6c 25 0d  0d 66 39 20 c8 99 20 22  |,,,,cl%..f9 .. "|
00001df0  4f 53 5f 53 70 72 69 74  65 4f 70 22 2c 34 31 2b  |OS_SpriteOp",41+|
00001e00  32 35 36 2c 73 61 72 65  61 2c 74 78 74 25 2c 78  |256,sarea,txt%,x|
00001e10  2b 31 2c 79 20 b8 20 2c  2c 2c 2c 2c 63 6c 32 25  |+1,y . ,,,,,cl2%|
00001e20  0d 0d 70 1d 20 e7 20 63  6c 32 25 3d 31 20 8c 20  |..p. . cl2%=1 . |
00001e30  78 3d 78 2b 32 20 8b 20  78 3d 78 2b 31 0d 0d 7a  |x=x+2 . x=x+1..z|
00001e40  28 fd 20 28 63 6c 25 3d  30 20 80 20 63 6c 32 25  |(. (cl%=0 . cl2%|
00001e50  3d 30 29 20 84 20 28 78  3e 28 73 74 6f 70 28 73  |=0) . (x>(stop(s|
00001e60  29 2d 32 29 29 0d 0d 84  17 6d 69 64 64 6c 65 25  |)-2))....middle%|
00001e70  3d 28 6c 65 66 74 25 2b  78 29 81 32 0d 0d 8e 05  |=(left%+x).2....|
00001e80  f5 0d 0d 98 3c 20 c8 99  20 22 4f 53 5f 53 70 72  |....< .. "OS_Spr|
00001e90  69 74 65 4f 70 22 2c 34  31 2b 32 35 36 2c 73 61  |iteOp",41+256,sa|
00001ea0  72 65 61 2c 74 78 74 25  2c 6d 69 64 64 6c 65 25  |rea,txt%,middle%|
00001eb0  2c 79 20 b8 20 2c 2c 2c  2c 2c 63 6c 25 0d 0d a2  |,y . ,,,,,cl%...|
00001ec0  3f 20 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |? .. "OS_SpriteO|
00001ed0  70 22 2c 34 31 2b 32 35  36 2c 73 61 72 65 61 2c  |p",41+256,sarea,|
00001ee0  74 78 74 25 2c 6d 69 64  64 6c 65 25 2c 79 2b 31  |txt%,middle%,y+1|
00001ef0  20 b8 20 2c 2c 2c 2c 2c  63 6c 32 25 0d 0d ac 1d  | . ,,,,,cl2%....|
00001f00  20 e7 20 63 6c 32 25 3d  31 20 8c 20 79 3d 79 2b  | . cl2%=1 . y=y+|
00001f10  32 20 8b 20 79 3d 79 2b  31 0d 0d b6 27 fd 20 28  |2 . y=y+1...'. (|
00001f20  63 6c 25 3d 30 20 80 20  63 6c 32 25 3d 30 29 20  |cl%=0 . cl2%=0) |
00001f30  84 20 28 79 3e 28 79 73  69 7a 65 25 2d 32 29 29  |. (y>(ysize%-2))|
00001f40  0d 0d c0 33 74 6f 70 25  3d 79 3a 79 3d 73 74 61  |...3top%=y:y=sta|
00001f50  76 65 28 73 2c 6c 69 6e  65 29 2d 67 61 70 25 2b  |ve(s,line)-gap%+|
00001f60  a8 28 6f 66 66 73 65 74  25 2a 78 2f 78 73 69 7a  |.(offset%*x/xsiz|
00001f70  65 25 29 0d 0d ca 05 f5  0d 0d d4 3c 20 c8 99 20  |e%)........< .. |
00001f80  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 34 31  |"OS_SpriteOp",41|
00001f90  2b 32 35 36 2c 73 61 72  65 61 2c 74 78 74 25 2c  |+256,sarea,txt%,|
00001fa0  6d 69 64 64 6c 65 25 2c  79 20 b8 20 2c 2c 2c 2c  |middle%,y . ,,,,|
00001fb0  2c 63 6c 25 0d 0d de 3f  20 c8 99 20 22 4f 53 5f  |,cl%...? .. "OS_|
00001fc0  53 70 72 69 74 65 4f 70  22 2c 34 31 2b 32 35 36  |SpriteOp",41+256|
00001fd0  2c 73 61 72 65 61 2c 74  78 74 25 2c 6d 69 64 64  |,sarea,txt%,midd|
00001fe0  6c 65 25 2c 79 2d 31 20  b8 20 2c 2c 2c 2c 2c 63  |le%,y-1 . ,,,,,c|
00001ff0  6c 32 25 0d 0d e8 1d 20  e7 20 63 6c 32 25 3d 31  |l2%.... . cl2%=1|
00002000  20 8c 20 79 3d 79 2d 32  20 8b 20 79 3d 79 2d 31  | . y=y-2 . y=y-1|
00002010  0d 0d f2 1e fd 20 28 63  6c 25 3d 30 20 80 20 63  |..... (cl%=0 . c|
00002020  6c 32 25 3d 30 29 20 84  20 28 79 3c 32 29 0d 0d  |l2%=0) . (y<2)..|
00002030  fc 0d 62 6f 74 74 6f 6d  25 3d 79 0d 0e 06 2d e7  |..bottom%=y...-.|
00002040  20 28 74 6f 70 25 2d 62  6f 74 74 6f 6d 25 29 3c  | (top%-bottom%)<|
00002050  36 20 8c 20 f2 68 6f 6c  6c 6f 77 6e 6f 74 65 28  |6 . .hollownote(|
00002060  6d 69 64 64 6c 65 25 29  0d 0e 10 46 e7 20 28 78  |middle%)...F. (x|
00002070  2d 6c 65 66 74 25 29 3c  30 2e 32 35 2a 28 74 6f  |-left%)<0.25*(to|
00002080  70 25 2d 62 6f 74 74 6f  6d 25 29 20 84 20 28 78  |p%-bottom%) . (x|
00002090  2d 6c 65 66 74 25 29 3e  31 2e 35 2a 28 74 6f 70  |-left%)>1.5*(top|
000020a0  25 2d 62 6f 74 74 6f 6d  25 29 20 8c 20 e1 0d 0e  |%-bottom%) . ...|
000020b0  1a 1a 79 6d 69 64 25 3d  28 74 6f 70 25 2b 62 6f  |..ymid%=(top%+bo|
000020c0  74 74 6f 6d 25 29 81 32  0d 0e 24 15 6e 6f 74 65  |ttom%).2..$.note|
000020d0  70 6f 73 3d 32 30 2d 32  2a 6c 69 6e 65 0d 0e 2e  |pos=20-2*line...|
000020e0  27 e7 79 6d 69 64 25 3c  28 73 74 61 76 65 28 73  |'.ymid%<(stave(s|
000020f0  2c 6c 69 6e 65 29 2d 31  2e 33 2a 67 61 70 25 29  |,line)-1.3*gap%)|
00002100  20 8c 20 e1 0d 0e 38 30  e7 79 6d 69 64 25 3c 28  | . ...80.ymid%<(|
00002110  73 74 61 76 65 28 73 2c  6c 69 6e 65 29 2d 33 29  |stave(s,line)-3)|
00002120  20 8c 20 6e 6f 74 65 70  6f 73 3d 6e 6f 74 65 70  | . notepos=notep|
00002130  6f 73 2d 31 0d 0e 42 3f  e7 79 6d 69 64 25 3c 28  |os-1..B?.ymid%<(|
00002140  73 74 61 76 65 28 73 2c  6c 69 6e 65 29 2b 33 29  |stave(s,line)+3)|
00002150  20 8c 20 f2 66 69 6c 65  6e 6f 74 65 28 6c 65 66  | . .filenote(lef|
00002160  74 25 2c 79 6d 69 64 25  2c 73 2c 6e 6f 74 65 70  |t%,ymid%,s,notep|
00002170  6f 73 29 0d 0e 4c 05 e1  0d 0e 56 05 3a 0d 0e 60  |os)..L....V.:..`|
00002180  19 dd f2 68 6f 6c 6c 6f  77 6e 6f 74 65 28 6d 69  |...hollownote(mi|
00002190  64 64 6c 65 25 29 0d 0e  6a 05 e1 0d 0e 74 05 3a  |ddle%)..j....t.:|
000021a0  0d 0e 7e 21 dd f2 66 69  6c 65 6e 6f 74 65 28 6c  |..~!..filenote(l|
000021b0  65 66 74 25 2c 79 2c 73  2c 6e 6f 74 65 70 6f 73  |eft%,y,s,notepos|
000021c0  29 0d 0e 88 59 f1 73 3b  22 20 22 3b 6c 69 6e 65  |)...Y.s;" ";line|
000021d0  3b 22 20 22 3b 6e 6f 74  65 73 25 28 73 2c 6c 69  |;" ";notes%(s,li|
000021e0  6e 65 29 3b 22 20 22 3b  6c 65 66 74 25 3b 22 20  |ne);" ";left%;" |
000021f0  22 3b 6d 69 64 64 6c 65  25 3b 22 20 22 3b 74 6f  |";middle%;" ";to|
00002200  70 25 3b 22 20 22 3b 62  6f 74 74 6f 6d 25 3b 22  |p%;" ";bottom%;"|
00002210  20 22 3b 6e 6f 74 65 70  6f 73 0d 0e 92 27 6e 6f  | ";notepos...'no|
00002220  74 65 78 25 28 73 2c 6c  69 6e 65 2c 6e 6f 74 65  |tex%(s,line,note|
00002230  73 25 28 73 2c 6c 69 6e  65 29 29 3d 6c 65 66 74  |s%(s,line))=left|
00002240  25 0d 0e 9c 29 6e 6f 74  65 70 25 28 73 2c 6c 69  |%...)notep%(s,li|
00002250  6e 65 2c 6e 6f 74 65 73  25 28 73 2c 6c 69 6e 65  |ne,notes%(s,line|
00002260  29 29 3d 6e 6f 74 65 70  6f 73 0d 0e a6 23 6e 6f  |))=notepos...#no|
00002270  74 65 76 25 28 73 2c 6c  69 6e 65 2c 6e 6f 74 65  |tev%(s,line,note|
00002280  73 25 28 73 2c 6c 69 6e  65 29 29 3d 33 0d 0e b0  |s%(s,line))=3...|
00002290  23 6e 6f 74 65 73 25 28  73 2c 6c 69 6e 65 29 3d  |#notes%(s,line)=|
000022a0  6e 6f 74 65 73 25 28 73  2c 6c 69 6e 65 29 2b 31  |notes%(s,line)+1|
000022b0  0d 0e ba 05 e1 0d 0e c4  05 3a 0d 0e ce 0a dd f2  |.........:......|
000022c0  73 6f 72 74 0d 0e d8 21  67 61 74 65 73 25 3d 30  |sort...!gates%=0|
000022d0  3a e3 63 3d 30 b8 37 3a  71 75 65 75 65 25 28 63  |:.c=0.7:queue%(c|
000022e0  29 3d 30 3a ed 0d 0e e2  1f e3 73 74 61 76 65 3d  |)=0:......stave=|
000022f0  30 b8 28 73 74 61 76 65  73 25 81 69 6e 6d 61 78  |0.(staves%.inmax|
00002300  25 29 2d 31 0d 0e ec 23  20 f1 22 53 6f 72 74 69  |%)-1...# ."Sorti|
00002310  6e 67 20 6c 69 6e 65 20  22 3b 73 74 61 76 65 2b  |ng line ";stave+|
00002320  31 3b 22 2e 2e 2e 22 0d  0e f6 0e 20 f2 73 6f 72  |1;"...".... .sor|
00002330  74 6c 69 6e 65 0d 0f 00  05 ed 0d 0f 0a 05 e1 0d  |tline...........|
00002340  0f 14 05 3a 0d 0f 1e 0e  dd f2 73 6f 72 74 6c 69  |...:......sortli|
00002350  6e 65 0d 0f 28 05 f5 0d  0f 32 15 20 6d 69 6e 3d  |ne..(....2. min=|
00002360  a4 67 65 74 6e 65 78 74  6e 6f 74 65 0d 0f 3c 10  |.getnextnote..<.|
00002370  20 f1 22 2d 2d 2d 20 22  3b 6d 69 6e 0d 0f 46 1d  | ."--- ";min..F.|
00002380  20 63 68 61 6e 73 25 3d  30 3a 67 61 74 65 73 25  | chans%=0:gates%|
00002390  3d 67 61 74 65 73 25 2b  31 0d 0f 50 3c 20 e7 20  |=gates%+1..P< . |
000023a0  6d 69 6e 3c 3e 30 20 8c  20 f2 73 6f 72 74 6e 6f  |min<>0 . .sortno|
000023b0  74 65 73 28 6d 69 6e 29  3a 3f 28 73 61 72 65 61  |tes(min):?(sarea|
000023c0  2b 26 31 30 30 30 2b 67  61 74 65 73 25 29 3d 63  |+&1000+gates%)=c|
000023d0  68 61 6e 73 25 0d 0f 5a  0a fd 6d 69 6e 3d 30 0d  |hans%..Z..min=0.|
000023e0  0f 64 05 e1 0d 0f 6e 05  3a 0d 0f 78 11 dd a4 67  |.d....n.:..x...g|
000023f0  65 74 6e 65 78 74 6e 6f  74 65 0d 0f 82 0c 6d 69  |etnextnote....mi|
00002400  6e 3d 39 39 39 39 0d 0f  8c 29 e3 73 3d 28 73 74  |n=9999...).s=(st|
00002410  61 76 65 2a 69 6e 6d 61  78 25 2b 31 29 20 b8 28  |ave*inmax%+1) .(|
00002420  73 74 61 76 65 2b 31 29  2a 69 6e 6d 61 78 25 0d  |stave+1)*inmax%.|
00002430  0f 96 19 20 e3 6c 69 6e  65 3d 30 b8 6e 6f 6c 69  |... .line=0.noli|
00002440  6e 65 73 28 73 29 2d 31  0d 0f a0 27 20 20 e7 6e  |nes(s)-1...'  .n|
00002450  66 69 6c 65 25 28 73 2c  6c 69 6e 65 29 3c 3e 6e  |file%(s,line)<>n|
00002460  6f 74 65 73 25 28 73 2c  6c 69 6e 65 29 20 8c 0d  |otes%(s,line) ..|
00002470  0f aa 4e 20 20 20 e7 20  6e 6f 74 65 78 25 28 73  |..N   . notex%(s|
00002480  2c 6c 69 6e 65 2c 6e 66  69 6c 65 25 28 73 2c 6c  |,line,nfile%(s,l|
00002490  69 6e 65 29 29 3c 6d 69  6e 20 8c 20 6d 69 6e 3d  |ine))<min . min=|
000024a0  6e 6f 74 65 78 25 28 73  2c 6c 69 6e 65 2c 6e 66  |notex%(s,line,nf|
000024b0  69 6c 65 25 28 73 2c 6c  69 6e 65 29 29 0d 0f b4  |ile%(s,line))...|
000024c0  07 20 20 cd 0d 0f be 06  20 ed 0d 0f c8 05 ed 0d  |.  ..... .......|
000024d0  0f d2 12 e7 6d 69 6e 3d  39 39 39 39 20 8c 20 3d  |....min=9999 . =|
000024e0  30 0d 0f dc 08 3d 6d 69  6e 0d 0f e6 05 3a 0d 0f  |0....=min....:..|
000024f0  f0 14 dd f2 73 6f 72 74  6e 6f 74 65 73 28 6d 69  |....sortnotes(mi|
00002500  6e 29 0d 0f fa 29 e3 73  3d 28 73 74 61 76 65 2a  |n)...).s=(stave*|
00002510  69 6e 6d 61 78 25 2b 31  29 20 b8 28 73 74 61 76  |inmax%+1) .(stav|
00002520  65 2b 31 29 2a 69 6e 6d  61 78 25 0d 10 04 21 20  |e+1)*inmax%...! |
00002530  69 6e 73 74 6e 25 3d 6e  6f 6d 61 78 25 2a 28 28  |instn%=nomax%*((|
00002540  73 2d 31 29 83 69 6e 6d  61 78 25 29 0d 10 0e 19  |s-1).inmax%)....|
00002550  20 e3 6c 69 6e 65 3d 30  b8 6e 6f 6c 69 6e 65 73  | .line=0.nolines|
00002560  28 73 29 2d 31 0d 10 18  27 20 20 e7 6e 66 69 6c  |(s)-1...'  .nfil|
00002570  65 25 28 73 2c 6c 69 6e  65 29 3c 3e 6e 6f 74 65  |e%(s,line)<>note|
00002580  73 25 28 73 2c 6c 69 6e  65 29 20 8c 0d 10 22 31  |s%(s,line) ..."1|
00002590  20 20 20 e7 20 6e 6f 74  65 78 25 28 73 2c 6c 69  |   . notex%(s,li|
000025a0  6e 65 2c 6e 66 69 6c 65  25 28 73 2c 6c 69 6e 65  |ne,nfile%(s,line|
000025b0  29 29 3c 28 6d 69 6e 2b  31 30 29 20 8c 0d 10 2c  |))<(min+10) ...,|
000025c0  2e 20 20 20 20 f1 73 2d  73 74 61 76 65 2c 6e 6f  |.    .s-stave,no|
000025d0  74 65 70 25 28 73 2c 6c  69 6e 65 2c 6e 66 69 6c  |tep%(s,line,nfil|
000025e0  65 25 28 73 2c 6c 69 6e  65 29 29 0d 10 36 29 20  |e%(s,line))..6) |
000025f0  20 20 20 e3 69 6e 6e 6f  25 3d 69 6e 73 74 6e 25  |   .inno%=instn%|
00002600  20 b8 20 28 69 6e 73 74  6e 25 2b 6e 6f 6d 61 78  | . (instn%+nomax|
00002610  25 2d 31 29 0d 10 40 dd  20 20 20 20 20 e7 28 63  |%-1)..@.     .(c|
00002620  68 61 6e 73 25 20 80 28  32 5e 69 6e 6e 6f 25 29  |hans% .(2^inno%)|
00002630  29 3d 30 8c 63 68 61 6e  73 25 3d 63 68 61 6e 73  |)=0.chans%=chans|
00002640  25 2b 32 5e 69 6e 6e 6f  25 3a 3f 28 73 61 72 65  |%+2^inno%:?(sare|
00002650  61 2b 26 38 30 30 30 2a  69 6e 6e 6f 25 2b 71 75  |a+&8000*inno%+qu|
00002660  65 75 65 25 28 69 6e 6e  6f 25 29 2b 26 38 30 30  |eue%(inno%)+&800|
00002670  30 29 3d 38 2a 6e 6f 74  65 70 25 28 73 2c 6c 69  |0)=8*notep%(s,li|
00002680  6e 65 2c 6e 66 69 6c 65  25 28 73 2c 6c 69 6e 65  |ne,nfile%(s,line|
00002690  29 29 3a 3f 28 73 61 72  65 61 2b 26 38 30 30 30  |)):?(sarea+&8000|
000026a0  2a 69 6e 6e 6f 25 2b 71  75 65 75 65 25 28 69 6e  |*inno%+queue%(in|
000026b0  6e 6f 25 29 2b 26 38 30  30 31 29 3d 31 32 38 3a  |no%)+&8001)=128:|
000026c0  71 75 65 75 65 25 28 69  6e 6e 6f 25 29 3d 71 75  |queue%(inno%)=qu|
000026d0  65 75 65 25 28 69 6e 6e  6f 25 29 2b 32 3a 69 6e  |eue%(inno%)+2:in|
000026e0  6e 6f 25 3d 69 6e 73 74  6e 25 2b 6e 6f 6d 61 78  |no%=instn%+nomax|
000026f0  25 0d 10 4a 0a 20 20 20  20 20 ed 0d 10 54 27 20  |%..J.     ...T' |
00002700  20 20 20 6e 66 69 6c 65  25 28 73 2c 6c 69 6e 65  |   nfile%(s,line|
00002710  29 3d 6e 66 69 6c 65 25  28 73 2c 6c 69 6e 65 29  |)=nfile%(s,line)|
00002720  2b 31 0d 10 5e 08 20 20  20 cd 0d 10 68 07 20 20  |+1..^.   ...h.  |
00002730  cd 0d 10 72 06 20 ed 0d  10 7c 05 ed 0d 10 86 05  |...r. ...|......|
00002740  e1 0d 10 90 05 3a 0d 10  9a 0b dd f2 63 6c 65 61  |.....:......clea|
00002750  72 0d 10 a4 0b e3 73 3d  30 b8 33 32 0d 10 ae 0b  |r.....s=0.32....|
00002760  20 e3 6c 3d 30 b8 35 0d  10 b8 21 20 20 6e 6f 74  | .l=0.5...!  not|
00002770  65 73 25 28 73 2c 6c 29  3d 30 3a 6e 66 69 6c 65  |es%(s,l)=0:nfile|
00002780  25 28 73 2c 6c 29 3d 30  0d 10 c2 06 20 ed 0d 10  |%(s,l)=0.... ...|
00002790  cc 05 ed 0d 10 d6 05 e1  0d 10 e0 05 3a 0d 10 ea  |............:...|
000027a0  11 dd f2 6d 61 6b 65 6d  61 65 73 74 72 6f 0d 10  |...makemaestro..|
000027b0  f4 1d f1 22 4d 61 6b 69  6e 67 20 4d 61 65 73 74  |..."Making Maest|
000027c0  72 6f 20 66 69 6c 65 2e  2e 2e 22 0d 10 fe 21 66  |ro file..."...!f|
000027d0  69 6c 65 25 3d ae 22 3c  4f 62 65 79 24 44 69 72  |ile%=."<Obey$Dir|
000027e0  3e 2e 4d 75 73 69 63 53  63 61 6e 22 0d 11 08 0c  |>.MusicScan"....|
000027f0  50 25 3d 73 61 72 65 61  0d 11 12 2d 5b 4f 50 54  |P%=sarea...-[OPT|
00002800  20 30 3a 45 51 55 53 22  4d 61 65 73 74 72 6f 22  | 0:EQUS"Maestro"|
00002810  3a 45 51 55 42 26 41 3a  45 51 55 42 32 3a 45 51  |:EQUB&A:EQUB2:EQ|
00002820  55 42 31 3a 5d 0d 11 1c  20 e3 72 3d 73 61 72 65  |UB1:]... .r=sare|
00002830  61 20 b8 20 50 25 2d 31  3a d5 23 66 69 6c 65 25  |a . P%-1:.#file%|
00002840  2c 3f 72 3a ed 0d 11 26  05 3a 0d 11 30 18 f1 23  |,?r:...&.:..0..#|
00002850  66 69 6c 65 25 2c 28 67  61 74 65 73 25 2d 31 29  |file%,(gates%-1)|
00002860  2b 32 0d 11 3a 1e e3 63  3d 30 b8 37 3a f1 23 66  |+2..:..c=0.7:.#f|
00002870  69 6c 65 25 2c 71 75 65  75 65 25 28 63 29 3a ed  |ile%,queue%(c):.|
00002880  0d 11 44 18 d5 23 66 69  6c 65 25 2c 30 3a d5 23  |..D..#file%,0:.#|
00002890  66 69 6c 65 25 2c 33 32  0d 11 4e 3b e7 67 61 74  |file%,32..N;.gat|
000028a0  65 73 25 3c 3e 31 20 8c  20 e3 72 3d 31 b8 28 67  |es%<>1 . .r=1.(g|
000028b0  61 74 65 73 25 2d 31 29  3a d5 23 66 69 6c 65 25  |ates%-1):.#file%|
000028c0  2c 3f 28 73 61 72 65 61  2b 26 31 30 30 30 2b 72  |,?(sarea+&1000+r|
000028d0  29 3a ed 0d 11 58 0a e3  63 3d 31 b8 38 0d 11 62  |):...X..c=1.8..b|
000028e0  46 20 e7 71 75 65 75 65  25 28 63 2d 31 29 3c 3e  |F .queue%(c-1)<>|
000028f0  30 20 8c 20 e3 72 3d 30  b8 71 75 65 75 65 25 28  |0 . .r=0.queue%(|
00002900  63 2d 31 29 2d 31 3a d5  23 66 69 6c 65 25 2c 3f  |c-1)-1:.#file%,?|
00002910  28 73 61 72 65 61 2b 26  38 30 30 30 2a 63 2b 72  |(sarea+&8000*c+r|
00002920  29 3a ed 0d 11 6c 05 ed  0d 11 76 0c 50 25 3d 73  |):...l....v.P%=s|
00002930  61 72 65 61 0d 11 80 23  5b 4f 50 54 20 30 3a 45  |area...#[OPT 0:E|
00002940  51 55 42 32 3a 45 51 55  42 69 6e 6d 61 78 25 2d  |QUB2:EQUBinmax%-|
00002950  31 3a 45 51 55 42 30 0d  11 8a 30 45 51 55 42 33  |1:EQUB0...0EQUB3|
00002960  3a 5d 3a e3 63 3d 30 b8  37 3a 5b 4f 50 54 20 30  |:]:.c=0.7:[OPT 0|
00002970  3a 45 51 55 42 63 3a 45  51 55 42 31 3a 5d 3a ed  |:EQUBc:EQUB1:]:.|
00002980  3a 5b 4f 50 54 20 30 0d  11 94 25 45 51 55 42 34  |:[OPT 0...%EQUB4|
00002990  3a 45 51 55 44 26 30 36  30 36 30 36 30 36 3a 45  |:EQUD&06060606:E|
000029a0  51 55 44 26 30 36 30 36  30 36 30 36 0d 11 9e 27  |QUD&06060606...'|
000029b0  45 51 55 42 35 3a 45 51  55 44 26 30 33 30 33 30  |EQUB5:EQUD&03030|
000029c0  33 30 33 3a 45 51 55 44  26 30 33 30 33 30 33 30  |303:EQUD&0303030|
000029d0  33 3a 5d 0d 11 a8 20 e3  72 3d 73 61 72 65 61 20  |3:]... .r=sarea |
000029e0  b8 20 50 25 2d 31 3a d5  23 66 69 6c 65 25 2c 3f  |. P%-1:.#file%,?|
000029f0  72 3a ed 0d 11 b2 05 3a  0d 11 bc 0b d9 23 66 69  |r:.....:.....#fi|
00002a00  6c 65 25 0d 11 c6 25 2a  53 45 54 54 59 50 45 20  |le%...%*SETTYPE |
00002a10  3c 4f 62 65 79 24 44 69  72 3e 2e 4d 75 73 69 63  |<Obey$Dir>.Music|
00002a20  53 63 61 6e 20 41 46 31  0d 11 d0 05 e1 0d ff     |Scan AF1.......|
00002a2f