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

!ScoreOCR/!RunImage

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/!RunImage
Read OK:
File size: 312F 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%-2 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%=2: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%-4: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)>1 THEN gap%=((stave(s,0)-stave(s,nolines(s)-1))DIV(2*nolines(s)-2))+2 ELSE gap%=5
 3240PRINT"Gap=";gap%
 3250FORline=0TOnolines(s)-1
 3260 FORx=start(s) TO stop(s)
 3270  SYS "OS_SpriteOp",41+256,sarea,txt%,x,stave(s,line)+INT(offset%*x/xsize%)-gap% TO ,,,,,cl%
 3280  IFcl%=1 THEN
 3290   ct%=0
 3300   FORx2=x TO x+3
 3310    SYS "OS_SpriteOp",41+256,sarea,txt%,x2,stave(s,line)+INT(offset%*x2/xsize%)-gap% TO ,,,,,cl%
 3320    ct%=ct%+cl%
 3330   NEXT
 3340   IF ct%>2 THEN PROCfillednote
 3350  ENDIF
 3360 NEXT
 3370NEXT
 3380ENDPROC
 3390:
 3400DEFPROCfillednote
 3410LOCALxsw%,left%,right%,top%,bottom%,middle%,ymid%
 3420left%=x:y=stave(s,line)-gap%+INT(offset%*x/xsize%)
 3430REPEAT
 3440 SYS "OS_SpriteOp",41+256,sarea,txt%,x,y TO ,,,,,cl%
 3450 SYS "OS_SpriteOp",41+256,sarea,txt%,x+1,y TO ,,,,,cl2%
 3460 IF cl2%=1 THEN x=x+2 ELSE x=x+1
 3470UNTIL (cl%=0 AND cl2%=0) OR (x>(stop(s)-2))
 3480middle%=(left%+x)DIV2
 3490top%=FNmeasurevert(0.33,left%,x,stave(s,line)-gap%+INT(offset%*x/xsize%),1,ysize%-2)
 3500bottom%=FNmeasurevert(0.33,left%,x,stave(s,line)-gap%+INT(offset%*x/xsize%),-1,2)
 3510ymid%=(top%+bottom%)DIV2
 3520left%=FNmeasurehori(0.33,bottom%,top%,middle%,-1,2)
 3530right%=FNmeasurehori(0.33,bottom%,top%,middle%,1,xsize%-2)
 3540IF (top%-bottom%)<6 THEN PROChollownote(middle%)
 3550IF (top%-bottom%)>4*gap% THEN PRINT"!@! ";(top%-bottom%):ENDPROC
 3560IF (right%-left%)<0.25*(top%-bottom%) OR (right%-left%)>1.5*(top%-bottom%) THEN ENDPROC
 3570notepos=20-2*line
 3580IFymid%<(stave(s,line)-1.3*gap%) THEN ENDPROC
 3590IFymid%<(stave(s,line)-3) THEN notepos=notepos-1
 3600IFymid%<(stave(s,line)+3) THEN PROCfilenote(left%,right%,ymid%,s,notepos)
 3610ENDPROC
 3620:
 3630DEFFNmeasurevert(theshold,xstart,xstop,y,dir,ystop)
 3640LOCAL ct%,cl%,xsw%
 3650REPEAT
 3660 ct%=0
 3670 FORxsw%=xstart TO xstop
 3680  SYS "OS_SpriteOp",41+256,sarea,txt%,xsw%,y TO ,,,,,cl%
 3690  ct%=ct%+cl%
 3700 NEXT
 3710 y=y+dir
 3720UNTIL (ct%<(theshold*(xstop-xstart))) OR (y=ystop)
 3730=y
 3740:
 3750DEFFNmeasurehori(theshold,ystart,ystop,x,dir,xstop)
 3760LOCAL ct%,cl%,ysw%
 3770REPEAT
 3780 ct%=0
 3790 FORysw%=ystart TO ystop
 3800  SYS "OS_SpriteOp",41+256,sarea,txt%,x,ysw% TO ,,,,,cl%
 3810  ct%=ct%+cl%
 3820 NEXT
 3830 x=x+dir
 3840UNTIL (ct%<(theshold*(ystop-ystart))) OR (x=xstop)
 3850=x
 3860:
 3870DEFPROChollownote(middle%)
 3880ENDPROC
 3890:
 3900DEFPROCfilenote(left%,right%,y,s,notepos)
 3910PRINTs;" ";line;" ";notes%(s,line);" ";left%;" ";middle%;" ";top%;" ";bottom%;" ";notepos
 3920notex%(s,line,notes%(s,line))=left%
 3930notep%(s,line,notes%(s,line))=notepos
 3940notev%(s,line,notes%(s,line))=FNgetstem(left%,right%,y)
 3950notes%(s,line)=notes%(s,line)+1
 3960ENDPROC
 3970:
 3980DEFFNgetstem(left%,right%,y)
 3990LOCALdown%,type%,lb%,lt%,rb%,rt%
 4000lb%=FNmeasurevert(0.1,left%-2,left%+4,y-gap%,-1,2)
 4010lt%=FNmeasurevert(0.1,left%-2,left%+4,y+gap%,1,ysize%-2)
 4020rb%=FNmeasurevert(0.1,right%-4,right%+2,y-gap%,-1,2)
 4030rt%=FNmeasurevert(0.1,right%-4,right%+2,y+gap%,1,ysize%-2)
 4040IFlb%<(y-3*gap%) THENdown%=1:type%=FNcountbeams(left%,y,lb%,-1) ELSE down%=0:type%=FNcountbeams(right%,y,rt%,1)
 4050IF(lb%>(y-3*gap%))AND(rb%>(y-3*gap%))AND(lt%<(y+3*gap%))AND(rt%<(y+3*gap%))THENtype%=0
 4060=32*type%+256*down%
 4070:
 4080DEFFNcountbeams(xs%,ystart%,ystop%,step%)
 4090LOCALx,y,type%,staveline,stat,line
 4100type%=3:stat=FALSE
 4110FORy=ystart%TOystop%STEPstep%
 4120 staveline=FALSE
 4130 FORline=0TOnolines(s)-1
 4140  IF (stave(s,line)<(y+4)) AND (stave(s,line)>(y-1)) THEN staveline=TRUE
 4150 NEXT
 4160 IF NOT staveline THEN
 4170  ct%=0
 4180  FORx=xs%-3 TO xs%+3
 4190   SYS "OS_SpriteOp",41+256,sarea,txt%,x,y TO ,,,,,cl%
 4200   ct%=ct%+cl%
 4210  NEXT
 4220  IFct%<3 THEN stat=FALSE
 4230  IF(ct%>2)AND(NOT stat)AND(y<>ystart%)THENtype%=type%+1
 4240  IFct%>2 THEN stat=TRUE
 4250 ENDIF
 4260NEXT
 4270IF type%>6 THEN type%=6
 4280=type%
 4290:
 4300DEFPROCsort
 4310gates%=0:FORc=0TO7:queue%(c)=0:NEXT
 4320FORstave=0TO(staves%DIVinmax%)-1
 4330 ?(gates%+sarea+&1000)=0:?(gates%+sarea+&1001)=32:gates%=gates%+2
 4340 PRINT"Sorting line ";stave+1;"..."
 4350 PROCsortline
 4360NEXT
 4370?(gates%+sarea+&1000)=0:?(gates%+sarea+&1001)=32:gates%=gates%+2
 4380ENDPROC
 4390:
 4400DEFPROCsortline
 4410REPEAT
 4420 min=FNgetnextnote
 4430 PRINT"--- ";min
 4440 chans%=0
 4450 IF min<>0 THEN PROCsortnotes(min):?(sarea+&1000+gates%)=chans%:gates%=gates%+1
 4460UNTILmin=0
 4470ENDPROC
 4480:
 4490DEFFNgetnextnote
 4500min=9999
 4510FORs=(stave*inmax%+1) TO(stave+1)*inmax%
 4520 FORline=0TOnolines(s)-1
 4530  IFnfile%(s,line)<>notes%(s,line) THEN
 4540   IF notex%(s,line,nfile%(s,line))<min THEN min=notex%(s,line,nfile%(s,line))
 4550  ENDIF
 4560 NEXT
 4570NEXT
 4580IFmin=9999 THEN =0
 4590=min
 4600:
 4610DEFPROCsortnotes(min)
 4620FORs=(stave*inmax%+1) TO(stave+1)*inmax%
 4630 instn%=nomax%*((s-1)MODinmax%)
 4640 FORline=0TOnolines(s)-1
 4650  IFnfile%(s,line)<>notes%(s,line) THEN
 4660   IF notex%(s,line,nfile%(s,line))<(min+10) THEN
 4670    PRINTs-stave,notep%(s,line,nfile%(s,line))
 4680    FORinno%=instn% TO (instn%+nomax%-1)
 4690     IF(chans% AND(2^inno%))=0THEN
 4700      chans%=chans%+2^inno%
 4710      ?(sarea+&8000*inno%+queue%(inno%)+&8000)=8*notep%(s,line,nfile%(s,line))+notev%(s,line,nfile%(s,line))DIV256
 4720      ?(sarea+&8000*inno%+queue%(inno%)+&8001)=notev%(s,line,nfile%(s,line))AND255
 4730      queue%(inno%)=queue%(inno%)+2
 4740      inno%=instn%+nomax%
 4750     ENDIF
 4760    NEXT
 4770    nfile%(s,line)=nfile%(s,line)+1
 4780   ENDIF
 4790  ENDIF
 4800 NEXT
 4810NEXT
 4820ENDPROC
 4830:
 4840DEFPROCclear
 4850FORs=0TO32
 4860 FORl=0TO5
 4870  notes%(s,l)=0:nfile%(s,l)=0
 4880 NEXT
 4890NEXT
 4900ENDPROC
 4910:
 4920DEFPROCmakemaestro
 4930PRINT"Making Maestro file..."
 4940file%=OPENOUT"<Obey$Dir>.MusicScan"
 4950P%=sarea
 4960[OPT 0:EQUS"Maestro":EQUB&A:EQUB2:EQUB1:]
 4970FORr=sarea TO P%-1:BPUT#file%,?r:NEXT
 4980:
 4990PRINT#file%,gates%
 5000FORc=0TO7:PRINT#file%,queue%(c):NEXT
 5010FORr=(sarea+&1000)TO(sarea+&FFF+gates%):BPUT#file%,?r:NEXT
 5020FORc=1TO8
 5030 IFqueue%(c-1)<>0 THEN FORr=0TOqueue%(c-1)-1:BPUT#file%,?(sarea+&8000*c+r):NEXT
 5040NEXT
 5050P%=sarea
 5060[OPT 0:EQUB2:EQUBinmax%-1:EQUB0
 5070EQUB3:]:FORc=0TO7:[OPT 0:EQUBc:EQUB1:]:NEXT:[OPT 0
 5080EQUB4:EQUD&06060606:EQUD&06060606
 5090EQUB5:EQUD&03030303:EQUD&03030303:]
 5100FORr=sarea TO P%-1:BPUT#file%,?r:NEXT
 5110:
 5120CLOSE#file%
 5130*SETTYPE <Obey$Dir>.MusicScan AF1
 5140ENDPROC

� !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%-2 �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%=2:� 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%-4:� 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;"..."
�Y�nolines(s)>1 � gap%=((stave(s,0)-stave(s,nolines(s)-1))�(2*nolines(s)-2))+2 � gap%=5
��"Gap=";gap%
��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�

>:

H��fillednote

R1�xsw%,left%,right%,top%,bottom%,middle%,ymid%

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

f�

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

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

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

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

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

�Utop%=�measurevert(0.33,left%,x,stave(s,line)-gap%+�(offset%*x/xsize%),1,ysize%-2)

�Rbottom%=�measurevert(0.33,left%,x,stave(s,line)-gap%+�(offset%*x/xsize%),-1,2)

�ymid%=(top%+bottom%)�2

�6left%=�measurehori(0.33,bottom%,top%,middle%,-1,2)

�=right%=�measurehori(0.33,bottom%,top%,middle%,1,xsize%-2)

�-� (top%-bottom%)<6 � �hollownote(middle%)

�6� (top%-bottom%)>4*gap% � �"!@! ";(top%-bottom%):�

�P� (right%-left%)<0.25*(top%-bottom%) � (right%-left%)>1.5*(top%-bottom%) � �

�notepos=20-2*line

�'�ymid%<(stave(s,line)-1.3*gap%) � �
0�ymid%<(stave(s,line)-3) � notepos=notepos-1
F�ymid%<(stave(s,line)+3) � �filenote(left%,right%,ymid%,s,notepos)
�
$:
.4ݤmeasurevert(theshold,xstart,xstop,y,dir,ystop)
8� ct%,cl%,xsw%
B�
L
 ct%=0
V �xsw%=xstart � xstop
`:  ș "OS_SpriteOp",41+256,sarea,txt%,xsw%,y � ,,,,,cl%
j  ct%=ct%+cl%
t �
~ y=y+dir
�1� (ct%<(theshold*(xstop-xstart))) � (y=ystop)
�=y
�:
�4ݤmeasurehori(theshold,ystart,ystop,x,dir,xstop)
�� ct%,cl%,ysw%
��
�
 ct%=0
� �ysw%=ystart � ystop
�:  ș "OS_SpriteOp",41+256,sarea,txt%,x,ysw% � ,,,,,cl%
�  ct%=ct%+cl%
� �
� x=x+dir
1� (ct%<(theshold*(ystop-ystart))) � (x=xstop)

=x
:
��hollownote(middle%)
(�
2:
<(��filenote(left%,right%,y,s,notepos)
FY�s;" ";line;" ";notes%(s,line);" ";left%;" ";middle%;" ";top%;" ";bottom%;" ";notepos
P'notex%(s,line,notes%(s,line))=left%
Z)notep%(s,line,notes%(s,line))=notepos
d:notev%(s,line,notes%(s,line))=�getstem(left%,right%,y)
n#notes%(s,line)=notes%(s,line)+1
x�
�:
�ݤgetstem(left%,right%,y)
� �down%,type%,lb%,lt%,rb%,rt%
�5lb%=�measurevert(0.1,left%-2,left%+4,y-gap%,-1,2)
�;lt%=�measurevert(0.1,left%-2,left%+4,y+gap%,1,ysize%-2)
�7rb%=�measurevert(0.1,right%-4,right%+2,y-gap%,-1,2)
�=rt%=�measurevert(0.1,right%-4,right%+2,y+gap%,1,ysize%-2)
�j�lb%<(y-3*gap%) �down%=1:type%=�countbeams(left%,y,lb%,-1) � down%=0:type%=�countbeams(right%,y,rt%,1)
�P�(lb%>(y-3*gap%))�(rb%>(y-3*gap%))�(lt%<(y+3*gap%))�(rt%<(y+3*gap%))�type%=0
�=32*type%+256*down%
�:
�*ݤcountbeams(xs%,ystart%,ystop%,step%)
�"�x,y,type%,staveline,stat,line
type%=3:stat=�
�y=ystart%�ystop%�step%
 staveline=�
" �line=0�nolines(s)-1
,C  � (stave(s,line)<(y+4)) � (stave(s,line)>(y-1)) � staveline=�
6 �
@ � � staveline �
J  ct%=0
T  �x=xs%-3 � xs%+3
^8   ș "OS_SpriteOp",41+256,sarea,txt%,x,y � ,,,,,cl%
h   ct%=ct%+cl%
r  �
|  �ct%<3 � stat=�
�2  �(ct%>2)�(� stat)�(y<>ystart%)�type%=type%+1
�  �ct%>2 � stat=�
� �
��
�� type%>6 � type%=6
�
=type%
�:
�
��sort
�!gates%=0:�c=0�7:queue%(c)=0:�
��stave=0�(staves%�inmax%)-1
�E ?(gates%+sarea+&1000)=0:?(gates%+sarea+&1001)=32:gates%=gates%+2
�# �"Sorting line ";stave+1;"..."
� �sortline
�
D?(gates%+sarea+&1000)=0:?(gates%+sarea+&1001)=32:gates%=gates%+2
�
&:
0��sortline
:�
D min=�getnextnote
N �"--- ";min
X
 chans%=0
bL � min<>0 � �sortnotes(min):?(sarea+&1000+gates%)=chans%:gates%=gates%+1
l
�min=0
v�
�:
�ݤ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) �
41   � notex%(s,line,nfile%(s,line))<(min+10) �
>.    �s-stave,notep%(s,line,nfile%(s,line))
H)    �inno%=instn% � (instn%+nomax%-1)
R      �(chans% �(2^inno%))=0�
\      chans%=chans%+2^inno%
ft      ?(sarea+&8000*inno%+queue%(inno%)+&8000)=8*notep%(s,line,nfile%(s,line))+notev%(s,line,nfile%(s,line))�256
pT      ?(sarea+&8000*inno%+queue%(inno%)+&8001)=notev%(s,line,nfile%(s,line))�255
z'      queue%(inno%)=queue%(inno%)+2
�      inno%=instn%+nomax%
�
     �
�	    �
�'    nfile%(s,line)=nfile%(s,line)+1
�   �
�  �
� �
��
��
�:
���clear
��s=0�32
� �l=0�5
!  notes%(s,l)=0:nfile%(s,l)=0
 �
�
$�
.:
8��makemaestro
B�"Making Maestro file..."
L!file%=�"<Obey$Dir>.MusicScan"
VP%=sarea
`-[OPT 0:EQUS"Maestro":EQUB&A:EQUB2:EQUB1:]
j �r=sarea � P%-1:�#file%,?r:�
t:
~�#file%,gates%
��c=0�7:�#file%,queue%(c):�
�5�r=(sarea+&1000)�(sarea+&FFF+gates%):�#file%,?r:�
�
�c=1�8
�F �queue%(c-1)<>0 � �r=0�queue%(c-1)-1:�#file%,?(sarea+&8000*c+r):�
��
�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 32 20  |....y%=ysize%-2 |
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 32 3a f5  20 78 25 3d 78 25 2b 31  |. x%=2:. 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  20 20 78 25 3d 78 73 69  |....:...  x%=xsi|
000019b0  7a 65 25 2d 34 3a f5 20  78 25 3d 78 25 2d 31 3a  |ze%-4:. x%=x%-1:|
000019c0  63 74 25 3d 30 0d 0b c2  19 20 20 e3 6c 69 6e 3d  |ct%=0....  .lin=|
000019d0  30 b8 6e 6f 6c 69 6e 65  73 28 73 29 2d 31 0d 0b  |0.nolines(s)-1..|
000019e0  cc 3b 20 20 20 e3 79 3d  28 73 74 61 76 65 28 73  |.;   .y=(stave(s|
000019f0  2c 6c 69 6e 29 2d 31 2b  6f 66 66 73 65 74 25 29  |,lin)-1+offset%)|
00001a00  b8 28 73 74 61 76 65 28  73 2c 6c 69 6e 29 2b 31  |.(stave(s,lin)+1|
00001a10  2b 6f 66 66 73 65 74 25  29 0d 0b d6 3a 20 20 20  |+offset%)...:   |
00001a20  20 c8 99 20 22 4f 53 5f  53 70 72 69 74 65 4f 70  | .. "OS_SpriteOp|
00001a30  22 2c 34 31 2b 32 35 36  2c 73 61 72 65 61 2c 74  |",41+256,sarea,t|
00001a40  78 74 25 2c 78 25 2c 79  20 b8 20 2c 2c 2c 2c 2c  |xt%,x%,y . ,,,,,|
00001a50  63 6c 25 0d 0b e0 13 20  20 20 20 63 74 25 3d 63  |cl%....    ct%=c|
00001a60  74 25 2b 63 6c 25 0d 0b  ea 08 20 20 20 ed 0d 0b  |t%+cl%....   ...|
00001a70  f4 07 20 20 ed 0d 0b fe  18 20 20 e7 20 63 74 25  |..  .....  . ct%|
00001a80  3e 6e 6f 6c 69 6e 65 73  28 73 29 20 8c 0d 0c 08  |>nolines(s) ....|
00001a90  0c 20 20 20 63 74 25 3d  30 0d 0c 12 1a 20 20 20  |.   ct%=0....   |
00001aa0  e3 6c 69 6e 3d 30 b8 6e  6f 6c 69 6e 65 73 28 73  |.lin=0.nolines(s|
00001ab0  29 2d 31 0d 0c 1c 3c 20  20 20 20 e3 79 3d 28 73  |)-1...<    .y=(s|
00001ac0  74 61 76 65 28 73 2c 6c  69 6e 29 2b 35 2b 6f 66  |tave(s,lin)+5+of|
00001ad0  66 73 65 74 25 29 b8 28  73 74 61 76 65 28 73 2c  |fset%).(stave(s,|
00001ae0  6c 69 6e 29 2b 37 2b 6f  66 66 73 65 74 25 29 0d  |lin)+7+offset%).|
00001af0  0c 26 3b 20 20 20 20 20  c8 99 20 22 4f 53 5f 53  |.&;     .. "OS_S|
00001b00  70 72 69 74 65 4f 70 22  2c 34 31 2b 32 35 36 2c  |priteOp",41+256,|
00001b10  73 61 72 65 61 2c 74 78  74 25 2c 78 25 2c 79 20  |sarea,txt%,x%,y |
00001b20  b8 20 2c 2c 2c 2c 2c 63  6c 25 0d 0c 30 16 20 20  |. ,,,,,cl%..0.  |
00001b30  20 20 20 63 74 25 3d 63  74 25 2b 31 2d 63 6c 25  |   ct%=ct%+1-cl%|
00001b40  0d 0c 3a 09 20 20 20 20  ed 0d 0c 44 08 20 20 20  |..:.    ...D.   |
00001b50  ed 0d 0c 4e 07 20 20 cd  0d 0c 58 16 20 20 fd 20  |...N.  ...X.  . |
00001b60  63 74 25 3e 6e 6f 6c 69  6e 65 73 28 73 29 0d 0c  |ct%>nolines(s)..|
00001b70  62 10 20 20 73 74 6f 70  28 73 29 3d 78 25 0d 0c  |b.  stop(s)=x%..|
00001b80  6c 05 ed 0d 0c 76 05 e1  0d 0c 80 05 3a 0d 0c 8a  |l....v......:...|
00001b90  11 dd f2 67 65 74 6e 6f  74 65 73 28 73 29 0d 0c  |...getnotes(s)..|
00001ba0  94 24 f1 22 4e 6f 77 20  70 72 6f 63 65 73 73 69  |.$."Now processi|
00001bb0  6e 67 20 73 74 61 76 65  20 22 3b 73 3b 22 2e 2e  |ng stave ";s;"..|
00001bc0  2e 22 0d 0c 9e 59 e7 6e  6f 6c 69 6e 65 73 28 73  |."...Y.nolines(s|
00001bd0  29 3e 31 20 8c 20 67 61  70 25 3d 28 28 73 74 61  |)>1 . gap%=((sta|
00001be0  76 65 28 73 2c 30 29 2d  73 74 61 76 65 28 73 2c  |ve(s,0)-stave(s,|
00001bf0  6e 6f 6c 69 6e 65 73 28  73 29 2d 31 29 29 81 28  |nolines(s)-1)).(|
00001c00  32 2a 6e 6f 6c 69 6e 65  73 28 73 29 2d 32 29 29  |2*nolines(s)-2))|
00001c10  2b 32 20 8b 20 67 61 70  25 3d 35 0d 0c a8 10 f1  |+2 . gap%=5.....|
00001c20  22 47 61 70 3d 22 3b 67  61 70 25 0d 0c b2 18 e3  |"Gap=";gap%.....|
00001c30  6c 69 6e 65 3d 30 b8 6e  6f 6c 69 6e 65 73 28 73  |line=0.nolines(s|
00001c40  29 2d 31 0d 0c bc 1a 20  e3 78 3d 73 74 61 72 74  |)-1.... .x=start|
00001c50  28 73 29 20 b8 20 73 74  6f 70 28 73 29 0d 0c c6  |(s) . stop(s)...|
00001c60  5c 20 20 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |\  .. "OS_Sprite|
00001c70  4f 70 22 2c 34 31 2b 32  35 36 2c 73 61 72 65 61  |Op",41+256,sarea|
00001c80  2c 74 78 74 25 2c 78 2c  73 74 61 76 65 28 73 2c  |,txt%,x,stave(s,|
00001c90  6c 69 6e 65 29 2b a8 28  6f 66 66 73 65 74 25 2a  |line)+.(offset%*|
00001ca0  78 2f 78 73 69 7a 65 25  29 2d 67 61 70 25 20 b8  |x/xsize%)-gap% .|
00001cb0  20 2c 2c 2c 2c 2c 63 6c  25 0d 0c d0 0e 20 20 e7  | ,,,,,cl%....  .|
00001cc0  63 6c 25 3d 31 20 8c 0d  0c da 0c 20 20 20 63 74  |cl%=1 .....   ct|
00001cd0  25 3d 30 0d 0c e4 12 20  20 20 e3 78 32 3d 78 20  |%=0....   .x2=x |
00001ce0  b8 20 78 2b 33 0d 0c ee  60 20 20 20 20 c8 99 20  |. x+3...`    .. |
00001cf0  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 34 31  |"OS_SpriteOp",41|
00001d00  2b 32 35 36 2c 73 61 72  65 61 2c 74 78 74 25 2c  |+256,sarea,txt%,|
00001d10  78 32 2c 73 74 61 76 65  28 73 2c 6c 69 6e 65 29  |x2,stave(s,line)|
00001d20  2b a8 28 6f 66 66 73 65  74 25 2a 78 32 2f 78 73  |+.(offset%*x2/xs|
00001d30  69 7a 65 25 29 2d 67 61  70 25 20 b8 20 2c 2c 2c  |ize%)-gap% . ,,,|
00001d40  2c 2c 63 6c 25 0d 0c f8  13 20 20 20 20 63 74 25  |,,cl%....    ct%|
00001d50  3d 63 74 25 2b 63 6c 25  0d 0d 02 08 20 20 20 ed  |=ct%+cl%....   .|
00001d60  0d 0d 0c 1c 20 20 20 e7  20 63 74 25 3e 32 20 8c  |....   . ct%>2 .|
00001d70  20 f2 66 69 6c 6c 65 64  6e 6f 74 65 0d 0d 16 07  | .fillednote....|
00001d80  20 20 cd 0d 0d 20 06 20  ed 0d 0d 2a 05 ed 0d 0d  |  ... . ...*....|
00001d90  34 05 e1 0d 0d 3e 05 3a  0d 0d 48 10 dd f2 66 69  |4....>.:..H...fi|
00001da0  6c 6c 65 64 6e 6f 74 65  0d 0d 52 31 ea 78 73 77  |llednote..R1.xsw|
00001db0  25 2c 6c 65 66 74 25 2c  72 69 67 68 74 25 2c 74  |%,left%,right%,t|
00001dc0  6f 70 25 2c 62 6f 74 74  6f 6d 25 2c 6d 69 64 64  |op%,bottom%,midd|
00001dd0  6c 65 25 2c 79 6d 69 64  25 0d 0d 5c 34 6c 65 66  |le%,ymid%..\4lef|
00001de0  74 25 3d 78 3a 79 3d 73  74 61 76 65 28 73 2c 6c  |t%=x:y=stave(s,l|
00001df0  69 6e 65 29 2d 67 61 70  25 2b a8 28 6f 66 66 73  |ine)-gap%+.(offs|
00001e00  65 74 25 2a 78 2f 78 73  69 7a 65 25 29 0d 0d 66  |et%*x/xsize%)..f|
00001e10  05 f5 0d 0d 70 36 20 c8  99 20 22 4f 53 5f 53 70  |....p6 .. "OS_Sp|
00001e20  72 69 74 65 4f 70 22 2c  34 31 2b 32 35 36 2c 73  |riteOp",41+256,s|
00001e30  61 72 65 61 2c 74 78 74  25 2c 78 2c 79 20 b8 20  |area,txt%,x,y . |
00001e40  2c 2c 2c 2c 2c 63 6c 25  0d 0d 7a 39 20 c8 99 20  |,,,,,cl%..z9 .. |
00001e50  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 34 31  |"OS_SpriteOp",41|
00001e60  2b 32 35 36 2c 73 61 72  65 61 2c 74 78 74 25 2c  |+256,sarea,txt%,|
00001e70  78 2b 31 2c 79 20 b8 20  2c 2c 2c 2c 2c 63 6c 32  |x+1,y . ,,,,,cl2|
00001e80  25 0d 0d 84 1d 20 e7 20  63 6c 32 25 3d 31 20 8c  |%.... . cl2%=1 .|
00001e90  20 78 3d 78 2b 32 20 8b  20 78 3d 78 2b 31 0d 0d  | x=x+2 . x=x+1..|
00001ea0  8e 28 fd 20 28 63 6c 25  3d 30 20 80 20 63 6c 32  |.(. (cl%=0 . cl2|
00001eb0  25 3d 30 29 20 84 20 28  78 3e 28 73 74 6f 70 28  |%=0) . (x>(stop(|
00001ec0  73 29 2d 32 29 29 0d 0d  98 17 6d 69 64 64 6c 65  |s)-2))....middle|
00001ed0  25 3d 28 6c 65 66 74 25  2b 78 29 81 32 0d 0d a2  |%=(left%+x).2...|
00001ee0  55 74 6f 70 25 3d a4 6d  65 61 73 75 72 65 76 65  |Utop%=.measureve|
00001ef0  72 74 28 30 2e 33 33 2c  6c 65 66 74 25 2c 78 2c  |rt(0.33,left%,x,|
00001f00  73 74 61 76 65 28 73 2c  6c 69 6e 65 29 2d 67 61  |stave(s,line)-ga|
00001f10  70 25 2b a8 28 6f 66 66  73 65 74 25 2a 78 2f 78  |p%+.(offset%*x/x|
00001f20  73 69 7a 65 25 29 2c 31  2c 79 73 69 7a 65 25 2d  |size%),1,ysize%-|
00001f30  32 29 0d 0d ac 52 62 6f  74 74 6f 6d 25 3d a4 6d  |2)...Rbottom%=.m|
00001f40  65 61 73 75 72 65 76 65  72 74 28 30 2e 33 33 2c  |easurevert(0.33,|
00001f50  6c 65 66 74 25 2c 78 2c  73 74 61 76 65 28 73 2c  |left%,x,stave(s,|
00001f60  6c 69 6e 65 29 2d 67 61  70 25 2b a8 28 6f 66 66  |line)-gap%+.(off|
00001f70  73 65 74 25 2a 78 2f 78  73 69 7a 65 25 29 2c 2d  |set%*x/xsize%),-|
00001f80  31 2c 32 29 0d 0d b6 1a  79 6d 69 64 25 3d 28 74  |1,2)....ymid%=(t|
00001f90  6f 70 25 2b 62 6f 74 74  6f 6d 25 29 81 32 0d 0d  |op%+bottom%).2..|
00001fa0  c0 36 6c 65 66 74 25 3d  a4 6d 65 61 73 75 72 65  |.6left%=.measure|
00001fb0  68 6f 72 69 28 30 2e 33  33 2c 62 6f 74 74 6f 6d  |hori(0.33,bottom|
00001fc0  25 2c 74 6f 70 25 2c 6d  69 64 64 6c 65 25 2c 2d  |%,top%,middle%,-|
00001fd0  31 2c 32 29 0d 0d ca 3d  72 69 67 68 74 25 3d a4  |1,2)...=right%=.|
00001fe0  6d 65 61 73 75 72 65 68  6f 72 69 28 30 2e 33 33  |measurehori(0.33|
00001ff0  2c 62 6f 74 74 6f 6d 25  2c 74 6f 70 25 2c 6d 69  |,bottom%,top%,mi|
00002000  64 64 6c 65 25 2c 31 2c  78 73 69 7a 65 25 2d 32  |ddle%,1,xsize%-2|
00002010  29 0d 0d d4 2d e7 20 28  74 6f 70 25 2d 62 6f 74  |)...-. (top%-bot|
00002020  74 6f 6d 25 29 3c 36 20  8c 20 f2 68 6f 6c 6c 6f  |tom%)<6 . .hollo|
00002030  77 6e 6f 74 65 28 6d 69  64 64 6c 65 25 29 0d 0d  |wnote(middle%)..|
00002040  de 36 e7 20 28 74 6f 70  25 2d 62 6f 74 74 6f 6d  |.6. (top%-bottom|
00002050  25 29 3e 34 2a 67 61 70  25 20 8c 20 f1 22 21 40  |%)>4*gap% . ."!@|
00002060  21 20 22 3b 28 74 6f 70  25 2d 62 6f 74 74 6f 6d  |! ";(top%-bottom|
00002070  25 29 3a e1 0d 0d e8 50  e7 20 28 72 69 67 68 74  |%):....P. (right|
00002080  25 2d 6c 65 66 74 25 29  3c 30 2e 32 35 2a 28 74  |%-left%)<0.25*(t|
00002090  6f 70 25 2d 62 6f 74 74  6f 6d 25 29 20 84 20 28  |op%-bottom%) . (|
000020a0  72 69 67 68 74 25 2d 6c  65 66 74 25 29 3e 31 2e  |right%-left%)>1.|
000020b0  35 2a 28 74 6f 70 25 2d  62 6f 74 74 6f 6d 25 29  |5*(top%-bottom%)|
000020c0  20 8c 20 e1 0d 0d f2 15  6e 6f 74 65 70 6f 73 3d  | . .....notepos=|
000020d0  32 30 2d 32 2a 6c 69 6e  65 0d 0d fc 27 e7 79 6d  |20-2*line...'.ym|
000020e0  69 64 25 3c 28 73 74 61  76 65 28 73 2c 6c 69 6e  |id%<(stave(s,lin|
000020f0  65 29 2d 31 2e 33 2a 67  61 70 25 29 20 8c 20 e1  |e)-1.3*gap%) . .|
00002100  0d 0e 06 30 e7 79 6d 69  64 25 3c 28 73 74 61 76  |...0.ymid%<(stav|
00002110  65 28 73 2c 6c 69 6e 65  29 2d 33 29 20 8c 20 6e  |e(s,line)-3) . n|
00002120  6f 74 65 70 6f 73 3d 6e  6f 74 65 70 6f 73 2d 31  |otepos=notepos-1|
00002130  0d 0e 10 46 e7 79 6d 69  64 25 3c 28 73 74 61 76  |...F.ymid%<(stav|
00002140  65 28 73 2c 6c 69 6e 65  29 2b 33 29 20 8c 20 f2  |e(s,line)+3) . .|
00002150  66 69 6c 65 6e 6f 74 65  28 6c 65 66 74 25 2c 72  |filenote(left%,r|
00002160  69 67 68 74 25 2c 79 6d  69 64 25 2c 73 2c 6e 6f  |ight%,ymid%,s,no|
00002170  74 65 70 6f 73 29 0d 0e  1a 05 e1 0d 0e 24 05 3a  |tepos).......$.:|
00002180  0d 0e 2e 34 dd a4 6d 65  61 73 75 72 65 76 65 72  |...4..measurever|
00002190  74 28 74 68 65 73 68 6f  6c 64 2c 78 73 74 61 72  |t(theshold,xstar|
000021a0  74 2c 78 73 74 6f 70 2c  79 2c 64 69 72 2c 79 73  |t,xstop,y,dir,ys|
000021b0  74 6f 70 29 0d 0e 38 12  ea 20 63 74 25 2c 63 6c  |top)..8.. ct%,cl|
000021c0  25 2c 78 73 77 25 0d 0e  42 05 f5 0d 0e 4c 0a 20  |%,xsw%..B....L. |
000021d0  63 74 25 3d 30 0d 0e 56  19 20 e3 78 73 77 25 3d  |ct%=0..V. .xsw%=|
000021e0  78 73 74 61 72 74 20 b8  20 78 73 74 6f 70 0d 0e  |xstart . xstop..|
000021f0  60 3a 20 20 c8 99 20 22  4f 53 5f 53 70 72 69 74  |`:  .. "OS_Sprit|
00002200  65 4f 70 22 2c 34 31 2b  32 35 36 2c 73 61 72 65  |eOp",41+256,sare|
00002210  61 2c 74 78 74 25 2c 78  73 77 25 2c 79 20 b8 20  |a,txt%,xsw%,y . |
00002220  2c 2c 2c 2c 2c 63 6c 25  0d 0e 6a 11 20 20 63 74  |,,,,,cl%..j.  ct|
00002230  25 3d 63 74 25 2b 63 6c  25 0d 0e 74 06 20 ed 0d  |%=ct%+cl%..t. ..|
00002240  0e 7e 0c 20 79 3d 79 2b  64 69 72 0d 0e 88 31 fd  |.~. y=y+dir...1.|
00002250  20 28 63 74 25 3c 28 74  68 65 73 68 6f 6c 64 2a  | (ct%<(theshold*|
00002260  28 78 73 74 6f 70 2d 78  73 74 61 72 74 29 29 29  |(xstop-xstart)))|
00002270  20 84 20 28 79 3d 79 73  74 6f 70 29 0d 0e 92 06  | . (y=ystop)....|
00002280  3d 79 0d 0e 9c 05 3a 0d  0e a6 34 dd a4 6d 65 61  |=y....:...4..mea|
00002290  73 75 72 65 68 6f 72 69  28 74 68 65 73 68 6f 6c  |surehori(theshol|
000022a0  64 2c 79 73 74 61 72 74  2c 79 73 74 6f 70 2c 78  |d,ystart,ystop,x|
000022b0  2c 64 69 72 2c 78 73 74  6f 70 29 0d 0e b0 12 ea  |,dir,xstop).....|
000022c0  20 63 74 25 2c 63 6c 25  2c 79 73 77 25 0d 0e ba  | ct%,cl%,ysw%...|
000022d0  05 f5 0d 0e c4 0a 20 63  74 25 3d 30 0d 0e ce 19  |...... ct%=0....|
000022e0  20 e3 79 73 77 25 3d 79  73 74 61 72 74 20 b8 20  | .ysw%=ystart . |
000022f0  79 73 74 6f 70 0d 0e d8  3a 20 20 c8 99 20 22 4f  |ystop...:  .. "O|
00002300  53 5f 53 70 72 69 74 65  4f 70 22 2c 34 31 2b 32  |S_SpriteOp",41+2|
00002310  35 36 2c 73 61 72 65 61  2c 74 78 74 25 2c 78 2c  |56,sarea,txt%,x,|
00002320  79 73 77 25 20 b8 20 2c  2c 2c 2c 2c 63 6c 25 0d  |ysw% . ,,,,,cl%.|
00002330  0e e2 11 20 20 63 74 25  3d 63 74 25 2b 63 6c 25  |...  ct%=ct%+cl%|
00002340  0d 0e ec 06 20 ed 0d 0e  f6 0c 20 78 3d 78 2b 64  |.... ..... x=x+d|
00002350  69 72 0d 0f 00 31 fd 20  28 63 74 25 3c 28 74 68  |ir...1. (ct%<(th|
00002360  65 73 68 6f 6c 64 2a 28  79 73 74 6f 70 2d 79 73  |eshold*(ystop-ys|
00002370  74 61 72 74 29 29 29 20  84 20 28 78 3d 78 73 74  |tart))) . (x=xst|
00002380  6f 70 29 0d 0f 0a 06 3d  78 0d 0f 14 05 3a 0d 0f  |op)....=x....:..|
00002390  1e 19 dd f2 68 6f 6c 6c  6f 77 6e 6f 74 65 28 6d  |....hollownote(m|
000023a0  69 64 64 6c 65 25 29 0d  0f 28 05 e1 0d 0f 32 05  |iddle%)..(....2.|
000023b0  3a 0d 0f 3c 28 dd f2 66  69 6c 65 6e 6f 74 65 28  |:..<(..filenote(|
000023c0  6c 65 66 74 25 2c 72 69  67 68 74 25 2c 79 2c 73  |left%,right%,y,s|
000023d0  2c 6e 6f 74 65 70 6f 73  29 0d 0f 46 59 f1 73 3b  |,notepos)..FY.s;|
000023e0  22 20 22 3b 6c 69 6e 65  3b 22 20 22 3b 6e 6f 74  |" ";line;" ";not|
000023f0  65 73 25 28 73 2c 6c 69  6e 65 29 3b 22 20 22 3b  |es%(s,line);" ";|
00002400  6c 65 66 74 25 3b 22 20  22 3b 6d 69 64 64 6c 65  |left%;" ";middle|
00002410  25 3b 22 20 22 3b 74 6f  70 25 3b 22 20 22 3b 62  |%;" ";top%;" ";b|
00002420  6f 74 74 6f 6d 25 3b 22  20 22 3b 6e 6f 74 65 70  |ottom%;" ";notep|
00002430  6f 73 0d 0f 50 27 6e 6f  74 65 78 25 28 73 2c 6c  |os..P'notex%(s,l|
00002440  69 6e 65 2c 6e 6f 74 65  73 25 28 73 2c 6c 69 6e  |ine,notes%(s,lin|
00002450  65 29 29 3d 6c 65 66 74  25 0d 0f 5a 29 6e 6f 74  |e))=left%..Z)not|
00002460  65 70 25 28 73 2c 6c 69  6e 65 2c 6e 6f 74 65 73  |ep%(s,line,notes|
00002470  25 28 73 2c 6c 69 6e 65  29 29 3d 6e 6f 74 65 70  |%(s,line))=notep|
00002480  6f 73 0d 0f 64 3a 6e 6f  74 65 76 25 28 73 2c 6c  |os..d:notev%(s,l|
00002490  69 6e 65 2c 6e 6f 74 65  73 25 28 73 2c 6c 69 6e  |ine,notes%(s,lin|
000024a0  65 29 29 3d a4 67 65 74  73 74 65 6d 28 6c 65 66  |e))=.getstem(lef|
000024b0  74 25 2c 72 69 67 68 74  25 2c 79 29 0d 0f 6e 23  |t%,right%,y)..n#|
000024c0  6e 6f 74 65 73 25 28 73  2c 6c 69 6e 65 29 3d 6e  |notes%(s,line)=n|
000024d0  6f 74 65 73 25 28 73 2c  6c 69 6e 65 29 2b 31 0d  |otes%(s,line)+1.|
000024e0  0f 78 05 e1 0d 0f 82 05  3a 0d 0f 8c 1d dd a4 67  |.x......:......g|
000024f0  65 74 73 74 65 6d 28 6c  65 66 74 25 2c 72 69 67  |etstem(left%,rig|
00002500  68 74 25 2c 79 29 0d 0f  96 20 ea 64 6f 77 6e 25  |ht%,y)... .down%|
00002510  2c 74 79 70 65 25 2c 6c  62 25 2c 6c 74 25 2c 72  |,type%,lb%,lt%,r|
00002520  62 25 2c 72 74 25 0d 0f  a0 35 6c 62 25 3d a4 6d  |b%,rt%...5lb%=.m|
00002530  65 61 73 75 72 65 76 65  72 74 28 30 2e 31 2c 6c  |easurevert(0.1,l|
00002540  65 66 74 25 2d 32 2c 6c  65 66 74 25 2b 34 2c 79  |eft%-2,left%+4,y|
00002550  2d 67 61 70 25 2c 2d 31  2c 32 29 0d 0f aa 3b 6c  |-gap%,-1,2)...;l|
00002560  74 25 3d a4 6d 65 61 73  75 72 65 76 65 72 74 28  |t%=.measurevert(|
00002570  30 2e 31 2c 6c 65 66 74  25 2d 32 2c 6c 65 66 74  |0.1,left%-2,left|
00002580  25 2b 34 2c 79 2b 67 61  70 25 2c 31 2c 79 73 69  |%+4,y+gap%,1,ysi|
00002590  7a 65 25 2d 32 29 0d 0f  b4 37 72 62 25 3d a4 6d  |ze%-2)...7rb%=.m|
000025a0  65 61 73 75 72 65 76 65  72 74 28 30 2e 31 2c 72  |easurevert(0.1,r|
000025b0  69 67 68 74 25 2d 34 2c  72 69 67 68 74 25 2b 32  |ight%-4,right%+2|
000025c0  2c 79 2d 67 61 70 25 2c  2d 31 2c 32 29 0d 0f be  |,y-gap%,-1,2)...|
000025d0  3d 72 74 25 3d a4 6d 65  61 73 75 72 65 76 65 72  |=rt%=.measurever|
000025e0  74 28 30 2e 31 2c 72 69  67 68 74 25 2d 34 2c 72  |t(0.1,right%-4,r|
000025f0  69 67 68 74 25 2b 32 2c  79 2b 67 61 70 25 2c 31  |ight%+2,y+gap%,1|
00002600  2c 79 73 69 7a 65 25 2d  32 29 0d 0f c8 6a e7 6c  |,ysize%-2)...j.l|
00002610  62 25 3c 28 79 2d 33 2a  67 61 70 25 29 20 8c 64  |b%<(y-3*gap%) .d|
00002620  6f 77 6e 25 3d 31 3a 74  79 70 65 25 3d a4 63 6f  |own%=1:type%=.co|
00002630  75 6e 74 62 65 61 6d 73  28 6c 65 66 74 25 2c 79  |untbeams(left%,y|
00002640  2c 6c 62 25 2c 2d 31 29  20 8b 20 64 6f 77 6e 25  |,lb%,-1) . down%|
00002650  3d 30 3a 74 79 70 65 25  3d a4 63 6f 75 6e 74 62  |=0:type%=.countb|
00002660  65 61 6d 73 28 72 69 67  68 74 25 2c 79 2c 72 74  |eams(right%,y,rt|
00002670  25 2c 31 29 0d 0f d2 50  e7 28 6c 62 25 3e 28 79  |%,1)...P.(lb%>(y|
00002680  2d 33 2a 67 61 70 25 29  29 80 28 72 62 25 3e 28  |-3*gap%)).(rb%>(|
00002690  79 2d 33 2a 67 61 70 25  29 29 80 28 6c 74 25 3c  |y-3*gap%)).(lt%<|
000026a0  28 79 2b 33 2a 67 61 70  25 29 29 80 28 72 74 25  |(y+3*gap%)).(rt%|
000026b0  3c 28 79 2b 33 2a 67 61  70 25 29 29 8c 74 79 70  |<(y+3*gap%)).typ|
000026c0  65 25 3d 30 0d 0f dc 17  3d 33 32 2a 74 79 70 65  |e%=0....=32*type|
000026d0  25 2b 32 35 36 2a 64 6f  77 6e 25 0d 0f e6 05 3a  |%+256*down%....:|
000026e0  0d 0f f0 2a dd a4 63 6f  75 6e 74 62 65 61 6d 73  |...*..countbeams|
000026f0  28 78 73 25 2c 79 73 74  61 72 74 25 2c 79 73 74  |(xs%,ystart%,yst|
00002700  6f 70 25 2c 73 74 65 70  25 29 0d 0f fa 22 ea 78  |op%,step%)...".x|
00002710  2c 79 2c 74 79 70 65 25  2c 73 74 61 76 65 6c 69  |,y,type%,staveli|
00002720  6e 65 2c 73 74 61 74 2c  6c 69 6e 65 0d 10 04 12  |ne,stat,line....|
00002730  74 79 70 65 25 3d 33 3a  73 74 61 74 3d a3 0d 10  |type%=3:stat=...|
00002740  0e 1b e3 79 3d 79 73 74  61 72 74 25 b8 79 73 74  |...y=ystart%.yst|
00002750  6f 70 25 88 73 74 65 70  25 0d 10 18 10 20 73 74  |op%.step%.... st|
00002760  61 76 65 6c 69 6e 65 3d  a3 0d 10 22 19 20 e3 6c  |aveline=...". .l|
00002770  69 6e 65 3d 30 b8 6e 6f  6c 69 6e 65 73 28 73 29  |ine=0.nolines(s)|
00002780  2d 31 0d 10 2c 43 20 20  e7 20 28 73 74 61 76 65  |-1..,C  . (stave|
00002790  28 73 2c 6c 69 6e 65 29  3c 28 79 2b 34 29 29 20  |(s,line)<(y+4)) |
000027a0  80 20 28 73 74 61 76 65  28 73 2c 6c 69 6e 65 29  |. (stave(s,line)|
000027b0  3e 28 79 2d 31 29 29 20  8c 20 73 74 61 76 65 6c  |>(y-1)) . stavel|
000027c0  69 6e 65 3d b9 0d 10 36  06 20 ed 0d 10 40 14 20  |ine=...6. ...@. |
000027d0  e7 20 ac 20 73 74 61 76  65 6c 69 6e 65 20 8c 0d  |. . staveline ..|
000027e0  10 4a 0b 20 20 63 74 25  3d 30 0d 10 54 16 20 20  |.J.  ct%=0..T.  |
000027f0  e3 78 3d 78 73 25 2d 33  20 b8 20 78 73 25 2b 33  |.x=xs%-3 . xs%+3|
00002800  0d 10 5e 38 20 20 20 c8  99 20 22 4f 53 5f 53 70  |..^8   .. "OS_Sp|
00002810  72 69 74 65 4f 70 22 2c  34 31 2b 32 35 36 2c 73  |riteOp",41+256,s|
00002820  61 72 65 61 2c 74 78 74  25 2c 78 2c 79 20 b8 20  |area,txt%,x,y . |
00002830  2c 2c 2c 2c 2c 63 6c 25  0d 10 68 12 20 20 20 63  |,,,,,cl%..h.   c|
00002840  74 25 3d 63 74 25 2b 63  6c 25 0d 10 72 07 20 20  |t%=ct%+cl%..r.  |
00002850  ed 0d 10 7c 15 20 20 e7  63 74 25 3c 33 20 8c 20  |...|.  .ct%<3 . |
00002860  73 74 61 74 3d a3 0d 10  86 32 20 20 e7 28 63 74  |stat=....2  .(ct|
00002870  25 3e 32 29 80 28 ac 20  73 74 61 74 29 80 28 79  |%>2).(. stat).(y|
00002880  3c 3e 79 73 74 61 72 74  25 29 8c 74 79 70 65 25  |<>ystart%).type%|
00002890  3d 74 79 70 65 25 2b 31  0d 10 90 15 20 20 e7 63  |=type%+1....  .c|
000028a0  74 25 3e 32 20 8c 20 73  74 61 74 3d b9 0d 10 9a  |t%>2 . stat=....|
000028b0  06 20 cd 0d 10 a4 05 ed  0d 10 ae 17 e7 20 74 79  |. ........... ty|
000028c0  70 65 25 3e 36 20 8c 20  74 79 70 65 25 3d 36 0d  |pe%>6 . type%=6.|
000028d0  10 b8 0a 3d 74 79 70 65  25 0d 10 c2 05 3a 0d 10  |...=type%....:..|
000028e0  cc 0a dd f2 73 6f 72 74  0d 10 d6 21 67 61 74 65  |....sort...!gate|
000028f0  73 25 3d 30 3a e3 63 3d  30 b8 37 3a 71 75 65 75  |s%=0:.c=0.7:queu|
00002900  65 25 28 63 29 3d 30 3a  ed 0d 10 e0 1f e3 73 74  |e%(c)=0:......st|
00002910  61 76 65 3d 30 b8 28 73  74 61 76 65 73 25 81 69  |ave=0.(staves%.i|
00002920  6e 6d 61 78 25 29 2d 31  0d 10 ea 45 20 3f 28 67  |nmax%)-1...E ?(g|
00002930  61 74 65 73 25 2b 73 61  72 65 61 2b 26 31 30 30  |ates%+sarea+&100|
00002940  30 29 3d 30 3a 3f 28 67  61 74 65 73 25 2b 73 61  |0)=0:?(gates%+sa|
00002950  72 65 61 2b 26 31 30 30  31 29 3d 33 32 3a 67 61  |rea+&1001)=32:ga|
00002960  74 65 73 25 3d 67 61 74  65 73 25 2b 32 0d 10 f4  |tes%=gates%+2...|
00002970  23 20 f1 22 53 6f 72 74  69 6e 67 20 6c 69 6e 65  |# ."Sorting line|
00002980  20 22 3b 73 74 61 76 65  2b 31 3b 22 2e 2e 2e 22  | ";stave+1;"..."|
00002990  0d 10 fe 0e 20 f2 73 6f  72 74 6c 69 6e 65 0d 11  |.... .sortline..|
000029a0  08 05 ed 0d 11 12 44 3f  28 67 61 74 65 73 25 2b  |......D?(gates%+|
000029b0  73 61 72 65 61 2b 26 31  30 30 30 29 3d 30 3a 3f  |sarea+&1000)=0:?|
000029c0  28 67 61 74 65 73 25 2b  73 61 72 65 61 2b 26 31  |(gates%+sarea+&1|
000029d0  30 30 31 29 3d 33 32 3a  67 61 74 65 73 25 3d 67  |001)=32:gates%=g|
000029e0  61 74 65 73 25 2b 32 0d  11 1c 05 e1 0d 11 26 05  |ates%+2.......&.|
000029f0  3a 0d 11 30 0e dd f2 73  6f 72 74 6c 69 6e 65 0d  |:..0...sortline.|
00002a00  11 3a 05 f5 0d 11 44 15  20 6d 69 6e 3d a4 67 65  |.:....D. min=.ge|
00002a10  74 6e 65 78 74 6e 6f 74  65 0d 11 4e 10 20 f1 22  |tnextnote..N. ."|
00002a20  2d 2d 2d 20 22 3b 6d 69  6e 0d 11 58 0d 20 63 68  |--- ";min..X. ch|
00002a30  61 6e 73 25 3d 30 0d 11  62 4c 20 e7 20 6d 69 6e  |ans%=0..bL . min|
00002a40  3c 3e 30 20 8c 20 f2 73  6f 72 74 6e 6f 74 65 73  |<>0 . .sortnotes|
00002a50  28 6d 69 6e 29 3a 3f 28  73 61 72 65 61 2b 26 31  |(min):?(sarea+&1|
00002a60  30 30 30 2b 67 61 74 65  73 25 29 3d 63 68 61 6e  |000+gates%)=chan|
00002a70  73 25 3a 67 61 74 65 73  25 3d 67 61 74 65 73 25  |s%:gates%=gates%|
00002a80  2b 31 0d 11 6c 0a fd 6d  69 6e 3d 30 0d 11 76 05  |+1..l..min=0..v.|
00002a90  e1 0d 11 80 05 3a 0d 11  8a 11 dd a4 67 65 74 6e  |.....:......getn|
00002aa0  65 78 74 6e 6f 74 65 0d  11 94 0c 6d 69 6e 3d 39  |extnote....min=9|
00002ab0  39 39 39 0d 11 9e 29 e3  73 3d 28 73 74 61 76 65  |999...).s=(stave|
00002ac0  2a 69 6e 6d 61 78 25 2b  31 29 20 b8 28 73 74 61  |*inmax%+1) .(sta|
00002ad0  76 65 2b 31 29 2a 69 6e  6d 61 78 25 0d 11 a8 19  |ve+1)*inmax%....|
00002ae0  20 e3 6c 69 6e 65 3d 30  b8 6e 6f 6c 69 6e 65 73  | .line=0.nolines|
00002af0  28 73 29 2d 31 0d 11 b2  27 20 20 e7 6e 66 69 6c  |(s)-1...'  .nfil|
00002b00  65 25 28 73 2c 6c 69 6e  65 29 3c 3e 6e 6f 74 65  |e%(s,line)<>note|
00002b10  73 25 28 73 2c 6c 69 6e  65 29 20 8c 0d 11 bc 4e  |s%(s,line) ....N|
00002b20  20 20 20 e7 20 6e 6f 74  65 78 25 28 73 2c 6c 69  |   . notex%(s,li|
00002b30  6e 65 2c 6e 66 69 6c 65  25 28 73 2c 6c 69 6e 65  |ne,nfile%(s,line|
00002b40  29 29 3c 6d 69 6e 20 8c  20 6d 69 6e 3d 6e 6f 74  |))<min . min=not|
00002b50  65 78 25 28 73 2c 6c 69  6e 65 2c 6e 66 69 6c 65  |ex%(s,line,nfile|
00002b60  25 28 73 2c 6c 69 6e 65  29 29 0d 11 c6 07 20 20  |%(s,line))....  |
00002b70  cd 0d 11 d0 06 20 ed 0d  11 da 05 ed 0d 11 e4 12  |..... ..........|
00002b80  e7 6d 69 6e 3d 39 39 39  39 20 8c 20 3d 30 0d 11  |.min=9999 . =0..|
00002b90  ee 08 3d 6d 69 6e 0d 11  f8 05 3a 0d 12 02 14 dd  |..=min....:.....|
00002ba0  f2 73 6f 72 74 6e 6f 74  65 73 28 6d 69 6e 29 0d  |.sortnotes(min).|
00002bb0  12 0c 29 e3 73 3d 28 73  74 61 76 65 2a 69 6e 6d  |..).s=(stave*inm|
00002bc0  61 78 25 2b 31 29 20 b8  28 73 74 61 76 65 2b 31  |ax%+1) .(stave+1|
00002bd0  29 2a 69 6e 6d 61 78 25  0d 12 16 21 20 69 6e 73  |)*inmax%...! ins|
00002be0  74 6e 25 3d 6e 6f 6d 61  78 25 2a 28 28 73 2d 31  |tn%=nomax%*((s-1|
00002bf0  29 83 69 6e 6d 61 78 25  29 0d 12 20 19 20 e3 6c  |).inmax%).. . .l|
00002c00  69 6e 65 3d 30 b8 6e 6f  6c 69 6e 65 73 28 73 29  |ine=0.nolines(s)|
00002c10  2d 31 0d 12 2a 27 20 20  e7 6e 66 69 6c 65 25 28  |-1..*'  .nfile%(|
00002c20  73 2c 6c 69 6e 65 29 3c  3e 6e 6f 74 65 73 25 28  |s,line)<>notes%(|
00002c30  73 2c 6c 69 6e 65 29 20  8c 0d 12 34 31 20 20 20  |s,line) ...41   |
00002c40  e7 20 6e 6f 74 65 78 25  28 73 2c 6c 69 6e 65 2c  |. notex%(s,line,|
00002c50  6e 66 69 6c 65 25 28 73  2c 6c 69 6e 65 29 29 3c  |nfile%(s,line))<|
00002c60  28 6d 69 6e 2b 31 30 29  20 8c 0d 12 3e 2e 20 20  |(min+10) ...>.  |
00002c70  20 20 f1 73 2d 73 74 61  76 65 2c 6e 6f 74 65 70  |  .s-stave,notep|
00002c80  25 28 73 2c 6c 69 6e 65  2c 6e 66 69 6c 65 25 28  |%(s,line,nfile%(|
00002c90  73 2c 6c 69 6e 65 29 29  0d 12 48 29 20 20 20 20  |s,line))..H)    |
00002ca0  e3 69 6e 6e 6f 25 3d 69  6e 73 74 6e 25 20 b8 20  |.inno%=instn% . |
00002cb0  28 69 6e 73 74 6e 25 2b  6e 6f 6d 61 78 25 2d 31  |(instn%+nomax%-1|
00002cc0  29 0d 12 52 20 20 20 20  20 20 e7 28 63 68 61 6e  |)..R      .(chan|
00002cd0  73 25 20 80 28 32 5e 69  6e 6e 6f 25 29 29 3d 30  |s% .(2^inno%))=0|
00002ce0  8c 0d 12 5c 1f 20 20 20  20 20 20 63 68 61 6e 73  |...\.      chans|
00002cf0  25 3d 63 68 61 6e 73 25  2b 32 5e 69 6e 6e 6f 25  |%=chans%+2^inno%|
00002d00  0d 12 66 74 20 20 20 20  20 20 3f 28 73 61 72 65  |..ft      ?(sare|
00002d10  61 2b 26 38 30 30 30 2a  69 6e 6e 6f 25 2b 71 75  |a+&8000*inno%+qu|
00002d20  65 75 65 25 28 69 6e 6e  6f 25 29 2b 26 38 30 30  |eue%(inno%)+&800|
00002d30  30 29 3d 38 2a 6e 6f 74  65 70 25 28 73 2c 6c 69  |0)=8*notep%(s,li|
00002d40  6e 65 2c 6e 66 69 6c 65  25 28 73 2c 6c 69 6e 65  |ne,nfile%(s,line|
00002d50  29 29 2b 6e 6f 74 65 76  25 28 73 2c 6c 69 6e 65  |))+notev%(s,line|
00002d60  2c 6e 66 69 6c 65 25 28  73 2c 6c 69 6e 65 29 29  |,nfile%(s,line))|
00002d70  81 32 35 36 0d 12 70 54  20 20 20 20 20 20 3f 28  |.256..pT      ?(|
00002d80  73 61 72 65 61 2b 26 38  30 30 30 2a 69 6e 6e 6f  |sarea+&8000*inno|
00002d90  25 2b 71 75 65 75 65 25  28 69 6e 6e 6f 25 29 2b  |%+queue%(inno%)+|
00002da0  26 38 30 30 31 29 3d 6e  6f 74 65 76 25 28 73 2c  |&8001)=notev%(s,|
00002db0  6c 69 6e 65 2c 6e 66 69  6c 65 25 28 73 2c 6c 69  |line,nfile%(s,li|
00002dc0  6e 65 29 29 80 32 35 35  0d 12 7a 27 20 20 20 20  |ne)).255..z'    |
00002dd0  20 20 71 75 65 75 65 25  28 69 6e 6e 6f 25 29 3d  |  queue%(inno%)=|
00002de0  71 75 65 75 65 25 28 69  6e 6e 6f 25 29 2b 32 0d  |queue%(inno%)+2.|
00002df0  12 84 1d 20 20 20 20 20  20 69 6e 6e 6f 25 3d 69  |...      inno%=i|
00002e00  6e 73 74 6e 25 2b 6e 6f  6d 61 78 25 0d 12 8e 0a  |nstn%+nomax%....|
00002e10  20 20 20 20 20 cd 0d 12  98 09 20 20 20 20 ed 0d  |     .....    ..|
00002e20  12 a2 27 20 20 20 20 6e  66 69 6c 65 25 28 73 2c  |..'    nfile%(s,|
00002e30  6c 69 6e 65 29 3d 6e 66  69 6c 65 25 28 73 2c 6c  |line)=nfile%(s,l|
00002e40  69 6e 65 29 2b 31 0d 12  ac 08 20 20 20 cd 0d 12  |ine)+1....   ...|
00002e50  b6 07 20 20 cd 0d 12 c0  06 20 ed 0d 12 ca 05 ed  |..  ..... ......|
00002e60  0d 12 d4 05 e1 0d 12 de  05 3a 0d 12 e8 0b dd f2  |.........:......|
00002e70  63 6c 65 61 72 0d 12 f2  0b e3 73 3d 30 b8 33 32  |clear.....s=0.32|
00002e80  0d 12 fc 0b 20 e3 6c 3d  30 b8 35 0d 13 06 21 20  |.... .l=0.5...! |
00002e90  20 6e 6f 74 65 73 25 28  73 2c 6c 29 3d 30 3a 6e  | notes%(s,l)=0:n|
00002ea0  66 69 6c 65 25 28 73 2c  6c 29 3d 30 0d 13 10 06  |file%(s,l)=0....|
00002eb0  20 ed 0d 13 1a 05 ed 0d  13 24 05 e1 0d 13 2e 05  | ........$......|
00002ec0  3a 0d 13 38 11 dd f2 6d  61 6b 65 6d 61 65 73 74  |:..8...makemaest|
00002ed0  72 6f 0d 13 42 1d f1 22  4d 61 6b 69 6e 67 20 4d  |ro..B.."Making M|
00002ee0  61 65 73 74 72 6f 20 66  69 6c 65 2e 2e 2e 22 0d  |aestro file...".|
00002ef0  13 4c 21 66 69 6c 65 25  3d ae 22 3c 4f 62 65 79  |.L!file%=."<Obey|
00002f00  24 44 69 72 3e 2e 4d 75  73 69 63 53 63 61 6e 22  |$Dir>.MusicScan"|
00002f10  0d 13 56 0c 50 25 3d 73  61 72 65 61 0d 13 60 2d  |..V.P%=sarea..`-|
00002f20  5b 4f 50 54 20 30 3a 45  51 55 53 22 4d 61 65 73  |[OPT 0:EQUS"Maes|
00002f30  74 72 6f 22 3a 45 51 55  42 26 41 3a 45 51 55 42  |tro":EQUB&A:EQUB|
00002f40  32 3a 45 51 55 42 31 3a  5d 0d 13 6a 20 e3 72 3d  |2:EQUB1:]..j .r=|
00002f50  73 61 72 65 61 20 b8 20  50 25 2d 31 3a d5 23 66  |sarea . P%-1:.#f|
00002f60  69 6c 65 25 2c 3f 72 3a  ed 0d 13 74 05 3a 0d 13  |ile%,?r:...t.:..|
00002f70  7e 12 f1 23 66 69 6c 65  25 2c 67 61 74 65 73 25  |~..#file%,gates%|
00002f80  0d 13 88 1e e3 63 3d 30  b8 37 3a f1 23 66 69 6c  |.....c=0.7:.#fil|
00002f90  65 25 2c 71 75 65 75 65  25 28 63 29 3a ed 0d 13  |e%,queue%(c):...|
00002fa0  92 35 e3 72 3d 28 73 61  72 65 61 2b 26 31 30 30  |.5.r=(sarea+&100|
00002fb0  30 29 b8 28 73 61 72 65  61 2b 26 46 46 46 2b 67  |0).(sarea+&FFF+g|
00002fc0  61 74 65 73 25 29 3a d5  23 66 69 6c 65 25 2c 3f  |ates%):.#file%,?|
00002fd0  72 3a ed 0d 13 9c 0a e3  63 3d 31 b8 38 0d 13 a6  |r:......c=1.8...|
00002fe0  46 20 e7 71 75 65 75 65  25 28 63 2d 31 29 3c 3e  |F .queue%(c-1)<>|
00002ff0  30 20 8c 20 e3 72 3d 30  b8 71 75 65 75 65 25 28  |0 . .r=0.queue%(|
00003000  63 2d 31 29 2d 31 3a d5  23 66 69 6c 65 25 2c 3f  |c-1)-1:.#file%,?|
00003010  28 73 61 72 65 61 2b 26  38 30 30 30 2a 63 2b 72  |(sarea+&8000*c+r|
00003020  29 3a ed 0d 13 b0 05 ed  0d 13 ba 0c 50 25 3d 73  |):..........P%=s|
00003030  61 72 65 61 0d 13 c4 23  5b 4f 50 54 20 30 3a 45  |area...#[OPT 0:E|
00003040  51 55 42 32 3a 45 51 55  42 69 6e 6d 61 78 25 2d  |QUB2:EQUBinmax%-|
00003050  31 3a 45 51 55 42 30 0d  13 ce 30 45 51 55 42 33  |1:EQUB0...0EQUB3|
00003060  3a 5d 3a e3 63 3d 30 b8  37 3a 5b 4f 50 54 20 30  |:]:.c=0.7:[OPT 0|
00003070  3a 45 51 55 42 63 3a 45  51 55 42 31 3a 5d 3a ed  |:EQUBc:EQUB1:]:.|
00003080  3a 5b 4f 50 54 20 30 0d  13 d8 25 45 51 55 42 34  |:[OPT 0...%EQUB4|
00003090  3a 45 51 55 44 26 30 36  30 36 30 36 30 36 3a 45  |:EQUD&06060606:E|
000030a0  51 55 44 26 30 36 30 36  30 36 30 36 0d 13 e2 27  |QUD&06060606...'|
000030b0  45 51 55 42 35 3a 45 51  55 44 26 30 33 30 33 30  |EQUB5:EQUD&03030|
000030c0  33 30 33 3a 45 51 55 44  26 30 33 30 33 30 33 30  |303:EQUD&0303030|
000030d0  33 3a 5d 0d 13 ec 20 e3  72 3d 73 61 72 65 61 20  |3:]... .r=sarea |
000030e0  b8 20 50 25 2d 31 3a d5  23 66 69 6c 65 25 2c 3f  |. P%-1:.#file%,?|
000030f0  72 3a ed 0d 13 f6 05 3a  0d 14 00 0b d9 23 66 69  |r:.....:.....#fi|
00003100  6c 65 25 0d 14 0a 25 2a  53 45 54 54 59 50 45 20  |le%...%*SETTYPE |
00003110  3c 4f 62 65 79 24 44 69  72 3e 2e 4d 75 73 69 63  |<Obey$Dir>.Music|
00003120  53 63 61 6e 20 41 46 31  0d 14 14 05 e1 0d ff     |Scan AF1.......|
0000312f