Welcome, Guest! Log In | Create Account

Changeset 1979

Show
Ignore:
Timestamp:
09/16/09 10:05:47 (3 months ago)
Author:
t-anders
Message:

Extensive change: now 41 ET notation uses HE font

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/strasheela/contributions/anders/ET41/source/Output.oz

    r1965 r1979  
    1313%% 
    1414%% TODO: 
     15%% 
     16%% - finish updating ET41_PCDecls 
     17%% - remove "upper markup" (upperMarkupMakers) and insert codeBeforeNoteMakers and codeBeforePcCollectionMakers 
     18%% 
    1519%% 
    1620%% - 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. 
     
    9599%%% 
    96100 
     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 
    97113   /** %% 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.  
    98114   %% */ 
    99115   ET41_PCDecls = unit(0:  c  
    100                        1:  c#'7' 
    101                        2:  des#'L' %  'C77':2   
    102                        3:  des  %              'C#L':3  
    103                        4:  cis  % 'Db7':4 
    104                        5:  cis#'7' %           'DLL':5 
    105                        6:  d#'L'   % 'C#77':6  
     116                       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  
    106122                       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 
    113130                       14: e 
    114                        15: e#'7' % 'Dx': 15   'FLL':15  
    115                        16: f#'L' %'Gbb': 16    'E77':16   
     131                       15: e#Natural7 % 'Dx': 15   'FLL':15  
     132                       16: f#NaturalL %'Gbb': 16    'E77':16   
    116133                       17: f 
    117                        18: f#'7' % 'E#': 18  % 'GbLL':18 
    118                        19: ges#'L' % 'F77':19 
    119                        20: ges   %          'F#L':20 
    120                        21: fis  %     'Gb7':21 
    121                        22: fis#'7' %'Ex': 22 'GLL':22  
    122                        23: g#'L' % 'Abb': 23    'F#77':23 
     134                       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 
    123140                       24: g     
    124                        25: g#'7' % 'Fx': 25  'AbLL':25  
    125                        26: as#'L' % 'G77':26  
    126                        27: as    %   'G#L':27 
    127                        28: gis   %    'Ab7':28 
    128                        29: gis#'7' %  'ALL':29  
    129                        30: a#'L' % 'Bbb': 30    'G#77':30 
     141                       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 
    130147                       31: a 
    131                        32: a#'7' % 'Gx': 32     'BbLL':32    
    132                        33: bes#'L' % 'A77':33 
    133                        34: bes %               'A#L':34 
    134                        35: ais %     'Bb7':35 
    135                        36: ais#'7' % 'BLL':36  
    136                        37: b#'L' %'A#77':37 
     148                       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 
    137154                       38: b 
    138                        39: b#'7' % 'Ax': 39 
    139                        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.. 
    140157                      ) 
     158 
    141159 
    142160   LilyEt41PCs = {Record.map ET41_PCDecls 
     
    144162                  fun {$ X} {CondSelect X 1 X} end} 
    145163    
    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 
    154171         {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.. 
    156189      else nil 
    157190      end 
    158       %% for sim of notes 
    159       %% 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. 
    163191   end 
    164192 
     
    188216   %% */ 
    189217   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]) 
    191233      As1 = {Adjoin Defaults Args} 
    192234      ET22Wrapper = [LilyHeader LilyFooter]