Changeset 1979
- Timestamp:
- 09/16/09 10:05:47 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/strasheela/contributions/anders/ET41/source/Output.oz
r1965 r1979 13 13 %% 14 14 %% TODO: 15 %% 16 %% - finish updating ET41_PCDecls 17 %% - remove "upper markup" (upperMarkupMakers) and insert codeBeforeNoteMakers and codeBeforePcCollectionMakers 18 %% 15 19 %% 16 20 %% - all accidental markups at the same height? Otherwise for chords one cannot see to which note in chord accidental belongs. Or I do for chords something like neutral sign for chord tones without extra accidental over staff. … … 95 99 %%% 96 100 101 102 % Natural = "n" 103 Natural7 = ">" 104 Natural77 = "." 105 NaturalL = "<" 106 Sharp = "v" 107 Sharp7 = ">v" 108 % SharpL = "<v" 109 Flat = "e" 110 % Flat7 = ">e" 111 FlatL = "<e" 112 97 113 /** %% Format of each entry: LilyPC or LilyPC#AccidentalMarkup. LilyPC (a VS) is a Lily pitch name (e.g., c or cis). AccidentalMarkup (a VS) is a Lilypond markup used above the note to indicate its accidental. 98 114 %% */ 99 115 ET41_PCDecls = unit(0: c 100 1: c# '7'101 2: d es#'L'% 'C77':2102 3: d es% 'C#L':3103 4: c is% 'Db7':4104 5: c is#'7'% 'DLL':5105 6: d# 'L'% 'C#77':6116 1: c#Natural7 117 2: d#FlatL % 'C77':2 118 3: d#Flat % 'C#L':3 119 4: c#Sharp % 'Db7':4 120 5: c#Sharp7 % 'DLL':5 121 6: d#NaturalL % 'C#77':6 106 122 7: d 107 8: d#'7' %'Cx': 8 'EbLL':8 108 9: es#'L' % 'Fbb': 9 'D77':9 109 10: es % 'D#L':10 110 11: 'dis' % 'Eb7':11 111 12: 'dis'#'7' % 'ELL':12 112 13: fes % 'EL': 13 % 'D#77':13 123 8: d#Natural7 %'Cx': 8 'EbLL':8 124 %% TODO: only updated until here 125 9: e#FlatL % 'Fbb': 9 'D77':9 126 10: e#Flat % 'D#L':10 127 11: d#Sharp % 'Eb7':11 128 12: d#Sharp7 % 'ELL':12 129 13: e#NaturalL % f#Flat 'D#77':13 113 130 14: e 114 15: e# '7'% 'Dx': 15 'FLL':15115 16: f# 'L'%'Gbb': 16 'E77':16131 15: e#Natural7 % 'Dx': 15 'FLL':15 132 16: f#NaturalL %'Gbb': 16 'E77':16 116 133 17: f 117 18: f# '7'% 'E#': 18 % 'GbLL':18118 19: g es#'L'% 'F77':19119 20: g es% 'F#L':20120 21: f is% 'Gb7':21121 22: f is#'7'%'Ex': 22 'GLL':22122 23: g# 'L'% 'Abb': 23 'F#77':23134 18: f#Natural7 % 'E#': 18 % 'GbLL':18 135 19: g#FlatL % 'F77':19 136 20: g#Flat % 'F#L':20 137 21: f#Sharp % 'Gb7':21 138 22: f#Sharp7 %'Ex': 22 'GLL':22 139 23: g#NaturalL % 'Abb': 23 'F#77':23 123 140 24: g 124 25: g# '7'% 'Fx': 25 'AbLL':25125 26: a s#'L'% 'G77':26126 27: a s% 'G#L':27127 28: g is% 'Ab7':28128 29: g is#'7'% 'ALL':29129 30: a# 'L'% 'Bbb': 30 'G#77':30141 25: g#Natural7 % 'Fx': 25 'AbLL':25 142 26: a#FlatL % 'G77':26 143 27: a#Flat % 'G#L':27 144 28: g#Sharp % 'Ab7':28 145 29: g#Sharp7 % 'ALL':29 146 30: a#NaturalL % 'Bbb': 30 'G#77':30 130 147 31: a 131 32: a# '7'% 'Gx': 32 'BbLL':32132 33: b es#'L'% 'A77':33133 34: b es% 'A#L':34134 35: a is% 'Bb7':35135 36: a is#'7'% 'BLL':36136 37: b# 'L'%'A#77':37148 32: a#Natural7 % 'Gx': 32 'BbLL':32 149 33: b#FlatL % 'A77':33 150 34: b#Flat % 'A#L':34 151 35: a#Sharp % 'Bb7':35 152 36: a#Sharp7 % 'BLL':36 153 37: b#NaturalL %'A#77':37 137 154 38: b 138 39: b# '7'% 'Ax': 39139 40: b# '77'% c#'L' would result in octave problems..155 39: b#Natural7 % 'Ax': 39 156 40: b#Natural77 % c#'L' would result in octave problems.. 140 157 ) 158 141 159 142 160 LilyEt41PCs = {Record.map ET41_PCDecls … … 144 162 fun {$ X} {CondSelect X 1 X} end} 145 163 146 147 %% TODO: finish other cases 148 fun {MakeET41Accidentals_Markup X} 149 %% for note 150 if {X isNote($)} then 151 ET41_PCDecl = ET41_PCDecls.{X getPitchClass($)} 152 in 153 %% access Lily markup from X 164 /** %% 165 %% */ 166 fun {MakeET41Accidental X} 167 %% access Lily markup 168 fun {GetAccStringForNote N} 169 ET41_PCDecl = ET41_PCDecls.{N getPitchClass($)} 170 in 154 171 {CondSelect ET41_PCDecl 2 nil} 155 %% TMP: no accidental within lily chord or Strasheela chord/scale object 172 end 173 in 174 if {Out.isLilyChord {X getTemporalContainer($)}} then 175 %% X is a note in a Lilypond chord 176 Acc = {GetAccStringForNote X} 177 in 178 if Acc == nil then nil else 179 "\\chordHE \""#Acc#"\"" 180 end 181 elseif {X isNote($)} then 182 %% X is a note in general 183 Acc = {GetAccStringForNote X} 184 in 185 if Acc == nil then nil else 186 "\\HE \""#Acc#"\"" 187 end 188 %% this clause should never apply.. 156 189 else nil 157 190 end 158 %% for sim of notes159 %% for notes without extra accidental in a chord come up with some default sign meaning untransposed..160 %%161 %% for chord and scale root and their pitch classes (oh -- their pitch classes will even be harder...)162 %% NOTE: do this later. For now put in some note into score or browse warning saying that accidentals for analytical objects are not supported yet.163 191 end 164 192 … … 188 216 %% */ 189 217 proc {RenderAndShowLilypond MyScore Args} 190 Defaults = unit(upperMarkupMakers: [MakeET41Accidentals_Markup HS.out.makeNonChordTone_Markup]) 218 Defaults = unit(codeBeforeNoteMakers: [MakeET41Accidental] 219 codeBeforePcCollectionMakers: 220 [fun {$ MyChord PC} 221 fun {GetAccStringForPC} 222 ET41_PCDecl = ET41_PCDecls.PC 223 in 224 {CondSelect ET41_PCDecl 2 nil} 225 end 226 %% X is a note in general 227 Acc = {GetAccStringForPC} 228 in 229 if Acc == nil then nil else 230 "\\chordHE \""#Acc#"\"" 231 end 232 end]) 191 233 As1 = {Adjoin Defaults Args} 192 234 ET22Wrapper = [LilyHeader LilyFooter]