Commit df537fce authored by ROOL's avatar ROOL 🤖
Browse files

Time signature and positional improvements

Detail:
  * Time signatures are now displayed as sprites, both on screen and printed
  * Take the plunge and delete the sprites that are unused
  * Some minor positioning tweaks and updates to the sprite files
Admin:
  Submission from Chris Wraight.

Version 2.03. Tagged as 'Maestro-2_03'
parent d1726911
No preview for this file type
No preview for this file type
No preview for this file type
/* (2.02)
/* (2.03)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.02
#define Module_MajorVersion_CMHG 2.03
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 May 2017
#define Module_Date_CMHG 10 Jun 2017
#define Module_MajorVersion "2.02"
#define Module_Version 202
#define Module_MajorVersion "2.03"
#define Module_Version 203
#define Module_MinorVersion ""
#define Module_Date "27 May 2017"
#define Module_Date "10 Jun 2017"
#define Module_ApplicationDate "27-May-17"
#define Module_ApplicationDate "10-Jun-17"
#define Module_ComponentName "Maestro"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Maestro"
#define Module_FullVersion "2.02"
#define Module_HelpVersion "2.02 (27 May 2017)"
#define Module_LibraryVersionInfo "2:2"
#define Module_FullVersion "2.03"
#define Module_HelpVersion "2.03 (10 Jun 2017)"
#define Module_LibraryVersionInfo "2:3"
......@@ -1606,11 +1606,13 @@ ENDIF
ENDPROC
DEF PROCfloat_time_sig(X%,Y%)
SYS SetColour, 7 OR 3<<4
IF LEN($NoteValue%)>1 MOVE X%+C_Width%DIV2, Y%+C_Height% ELSE MOVE X%+C_Width%, Y%+C_Height%
PRINT $NoteValue%
IF LEN($BarLength%)>1 MOVE X%+C_Width%DIV2, Y%+2*C_Height% ELSE MOVE X%+C_Width%, Y%+2*C_Height%
PRINT $BarLength%
LOCAL s%,x%
IF LEN($BarLength%)<2 THEN x%=X%+14 ELSE x%=X%
s%=time%+VAL($BarLength%)
SYS SpriteOp%,SprPlot%,SprBlk%,S%(s%),x%-4,Y%+36,3,factors%,fpixtrans%
IF LEN($NoteValue%)<2 THEN x%=X%+14 ELSE x%=X%
s%=time%+VAL($NoteValue%)
SYS SpriteOp%,SprPlot%,SprBlk%,S%(s%),x%-4,Y%+4,3,factors%,fpixtrans%
ENDPROC
REM *********************************************************************** REM
......@@ -2201,20 +2203,19 @@ IFA%ANDPTYPE%(PX%+1)+TRUE ELSEIFA%ANDPTYPE%(PX%+1) ENDPROC
PX%-=1
ENDPROC
DEF PROCdraw_time_sig(A%)
SIG%(0)=A%
LOCALS%,B$,D$,w%
B$=STR$((A%>>1AND15)+1)
D$=STR$(%1<<(A%>>5)-1)
DEF PROCdraw_time_sig(a%)
LOCAL i%,b$,d$,w%
SIG%(0)=a%
b$=STR$((a%>>1 AND 15)+1)
d$=STR$(%1<<(a%>>5)-1)
w%=x%
IFLENB$<2 w%+=PW%(PX%)>>2
IFLEND$<2 x%+=PW%(PX%)>>2
FORS%=0TOSTAVE%+PERC%
MOVEw%,Y%+Y_STAVE%(S%)+Li%*4-Vi%:PRINTB$
MOVEx%,Y%+Y_STAVE%(S%)-Vi%:PRINTD$
IF LEN(b$)<2 THEN w%+=14
IF LEN(d$)<2 THEN x%+=14
FOR i%=0 TO STAVE%+PERC%
PROCsprite(time%+VAL(b$),w%,Y%+Y_STAVE%(i%))
PROCsprite(time%+VAL(d$),x%,Y%+Y_STAVE%(i%)-32)
NEXT
ENDIF
ENDPROC
ENDPROC
DEF PROCdraw_key_sig(A%)
LOCALS%,C%,N%,a%,W%
......@@ -2276,7 +2277,14 @@ s%=SCRIBE%(sprite%)
S%=SCRIBE%(stave%)
C%=SCRIBE%(sc%)
PROCrelease:REM undraw sprite being dragged
IFs%<accidental% PROCput_note ELSEIFs%<clef% PROCput_accidental ELSEIFs%<dot% PROCput_clef ELSEIFs%<bar% PROCput_dot ELSEIFs%<time% PROCput_bar ELSEIFs%<key% PROCput_time ELSEIFs%<tie% PROCput_key ELSEPROCput_tie
IF s%<accidental% THEN PROCput_note
IF s%>=accidental% AND s%<clef% THEN PROCput_accidental
IF s%>=clef% AND s%<=clef%+3 THEN PROCput_clef
IF s%>=dot% AND s%<=dot%+2 THEN PROCput_dot
IF s%>=bar% AND s%<=bar%+3 THEN PROCput_bar
IF s%>=tie% AND s%<=tie%+1 THEN PROCput_tie
IF s%=time% THEN PROCput_time
IF s%=key% THEN PROCput_key
GP%=SCRIBE%(sgp%)
FORC%=0TO7:N%(C%)=SCRIBE%(C%):NEXT
PROCarrange_stave(SCRIBE%(stave%))
......@@ -3014,14 +3022,12 @@ note%=0
rest%=16
accidental%=24
clef%=32
high%=36
dot%=44
ledger%=47
bar%=48
dot%=40
ledger%=43
tie%=44
bar%=51
time%=55
key%=56
tie%=57
pointer%=58
DIM SL%(Num%,1):REM List & item indexes for each sprite (set in list definitions)
SCORING%=FALSE:REM Flag indicating a sprite is to be drawn under the pointer
wasSCORING%=FALSE
......@@ -3047,20 +3053,24 @@ DIM fpixtrans% 15
PROCgetmodeinfo(FALSE)
ENDPROC
REM name, x, y, w, h
DATA B,7,3,24,6,SB,0,2,13,5,Mu,0,2,12,16,Cu,0,2,12,16
DATA Qu,0,2,19,16,SQu,0,2,20,16,DSQu,0,2,20,16,SDSQu,0,2,20,16
DATA B,7,3,24,6,SB,0,2,13,5,Md,0,14,12,16,Cd,0,14,12,16
DATA B,7,3,24,6,SB,0,2,13,5,Mu,0,2,12,17,Cu,0,2,12,17
DATA Qu,0,2,19,17,SQu,0,2,20,17,DSQu,0,2,20,17,SDSQu,0,2,20,17
DATA B,7,3,24,6,SB,0,2,13,5,Md,0,14,12,17,Cd,0,14,12,17
DATA Qd,0,14,12,17,SQd,0,14,12,17,DSQd,0,14,12,17,SDSQd,0,14,12,17
DATA Rest,-1,-1,10,4,Rest,-1,-2,10,4,Rest,-1,0,10,4,Rest4,-2,5,9,13
DATA Rest8,-1,4,9,9,Rest16,0,8,12,12,Rest32,1,8,15,16,Rest64,2,12,18,19
DATA M,0,2,11,5,Natural,8,6,7,12,Sharp,10,5,9,12,Flat,8,3,8,11
DATA Rest8,-1,4,9,9,Rest16,0,6,12,13,Rest32,1,7,15,16,Rest64,2,9,18,19
DATA Natural,8,6,7,12,Natural,8,6,7,12,Sharp,10,6,9,13,Flat,8,3,8,11
DATA Sharp2,9,2,10,5,Flat2,14,3,16,11,NSharp,17,6,17,12,NFlat,15,6,16,14
DATA Treble,0,14,23,31,Alto,0,8,23,17,Alto,0,4,23,17,Bass,0,5,24,14
DATA Bh,7,3,26,7,SBh,0,2,12,5,Mh,0,2,11,5,Ch,0,2,11,5
DATA ldg5,2,28,16,17,ldg4,2,24,16,13,ldg3,2,20,16,9,ldg2,2,16,16,5,ldg1,2,12,16,1
DATA Dot1,-12,2,4,2,Dot2,-12,2,9,2,Dot3,-12,2,14,2,Bar,-1,8,1,17,C,0,2,11,5
DATA Dot1,-14,1,4,2,Dot2,-14,1,9,2,Dot3,-14,1,14,2,Tie,-12,-3,23,3,Tie,-12,-3,23,3
DATA ldg1,2,-12,16,1,ldg2,2,-12,16,5,ldg3,2,-12,16,9,ldg4,2,-12,16,13,ldg5,2,-12,16,17
DATA Time,1,9,25,19,Key,0,13,0,30,Tie,-12,-3,23,3,""
DATA Bar,-1,8,1,17,Bar,-1,8,1,17,Bar,-1,8,1,17,Bar,-1,8,1,17
DATA Time,1,9,25,19,Key,0,13,0,30
DATA 2,3,0,14,8,3,3,0,14,8,4,3,0,14,8,5,3,0,14,8,6,3,0,14,8
DATA 7,3,0,14,8,8,3,0,14,8,9,3,0,14,8,10,3,0,26,8,11,3,0,26,8
DATA 12,3,0,26,8,13,3,0,26,8,14,3,0,26,8,15,3,0,26,8,16,3,0,26,8
DATA ""
DEF PROCinitialise_wimp
PROCenumerate_wimp_offsets
......@@ -4239,7 +4249,7 @@ REM ENDIF
IF (STAVE% + 1) AND 2 THEN
MOVE l_edge%-1+Hi%,y2%+Y_STAVE%(STAVE%)+Stave_Height% DIV 2
y% = Y_STAVE%(STAVE%-1)-Y_STAVE%(STAVE%)-Stave_Height%
DRAW BY 0, y% : MOVE BY Hi%, 0: DRAW BY 0, -y%
DRAW BY 0, y%
ENDIF
ENDIF
......@@ -4261,7 +4271,7 @@ REM ENDIF
IF (STAVE% + 1) AND 2 THEN
MOVE r_edge%-1+Hi%,y2%+Y_STAVE%(STAVE%)+Stave_Height% DIV 2
y% = Y_STAVE%(STAVE%-1)-Y_STAVE%(STAVE%)-Stave_Height%
DRAW BY 0, y% : MOVE BY Hi%, 0: DRAW BY 0, -y%
DRAW BY 0, y%
ENDIF
ENDIF
......@@ -4339,8 +4349,8 @@ REM ENDIF
IF LEN B$ < 2 THEN w1 += 5 * Hi%
IF LEN D$ < 2 THEN xs += 5 * Hi%
FOR S% = 0 TO STAVE%+PERC%
MOVE w1, y2% + Y_STAVE%(S%) + Li% * 4 - Vi%: PRINT B$
MOVE xs, y2% + Y_STAVE%(S%) - Vi%: PRINT D$
PROCprint_sprite(time%+VAL(B$),w1,y2% + Y_STAVE%(S%), note_factors%)
PROCprint_sprite(time%+VAL(D$),w1,y2% + Y_STAVE%(S%)-32, note_factors%)
NEXT S%
WHEN 1
REM Key Sig
......@@ -4386,7 +4396,7 @@ REM ENDIF
IF (STAVE% + 1) AND 2 THEN
MOVE r_edge%-2+Hi%,y2%+Y_STAVE%(STAVE%)+Stave_Height% DIV 2
y% = Y_STAVE%(STAVE%-1)-Y_STAVE%(STAVE%)-Stave_Height%
DRAW BY 0, y% : MOVE BY Hi%, 0: DRAW BY 0, -y%
DRAW BY 0, y%
ENDIF
on_page% = FALSE
IF (current_bar% + 1) MOD 5 = 0 THEN
......@@ -4406,7 +4416,7 @@ REM ENDIF
IF (STAVE% + 1) AND 2 THEN
MOVE xs+Hi% ,y2%+Y_STAVE%(STAVE%)+Stave_Height% DIV 2
y% = Y_STAVE%(STAVE%-1)-Y_STAVE%(STAVE%)-Stave_Height%
DRAW BY 0, y% : MOVE BY Hi%, 0: DRAW BY 0, -y%
DRAW BY 0, y%
ENDIF
IF (current_bar% + 1) MOD 5 = 0 THEN
MOVE xs-1-((LEN(STR$(current_bar%+1)))*16),y2% + (Y_STAVE%(0) / 2): REM ***
......@@ -4427,7 +4437,7 @@ REM ENDIF
IF (STAVE% + 1) AND 2 THEN
MOVE r_edge%-2+Hi%,y2%+Y_STAVE%(STAVE%)+Stave_Height% DIV 2
y% = Y_STAVE%(STAVE%-1)-Y_STAVE%(STAVE%)-Stave_Height%
DRAW BY 0, y% : MOVE BY Hi%, 0: DRAW BY 0, -y%
DRAW BY 0, y%
ENDIF
ENDIF
x2% += (last_pos% - l_edge%)
......@@ -4460,12 +4470,10 @@ DEF PROCprint_sprite(s%, X%, Y%, scale_factors%) : REM plot sprite S%(s%) at X%,
REM Below are various hack factors to deal with the fact that the sprites are scaled down.
CASE S$(s%) OF
WHEN "Md", "Cd"
y_add = (spr_y - scaled_y) * 1.5 : x_add = 6
WHEN "Qd", "SQd", "DSQd", "SDSQd"
y_add = (spr_y - scaled_y) * 1.6 : x_add = 6
WHEN "Md", "Cd","Qd", "SQd", "DSQd", "SDSQd"
x_add = 6
WHEN "Mu", "Cu", "Qu", "SQu", "DSQu", "SDSQu", "M", "SB", "Natural", "Sharp", "Flat", "Sharp2", "Flat2", "NSharp", "NFlat", "Tie", "Dot1", "Dot2", "Dot3"
y_add = 2.1 : x_add = 6
y_add = 2 : x_add = 6
WHEN "B"
y_add = 2.5 : x_add = 6
WHEN "Bar"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment