%%% ************************************************************* %%% Copyright (C) 2005-2009 Torsten Anders (www.torsten-anders.de) %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License %%% as published by the Free Software Foundation; either version 2 %%% of the License, or (at your option) any later version. %%% This program is distributed in the hope that it will be useful, %%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %%% GNU General Public License for more details. %%% ************************************************************* %% %% TODO: %% %% - finish updating ET41_PCDecls %% - remove "upper markup" (upperMarkupMakers) and insert codeBeforeNoteMakers and codeBeforePcCollectionMakers %% %% %% - 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. %% ?? property baseline-skip %% ?? at what position is markup drawn? Depends on note: can I change that?? %% %% - If the enharmonic notation should be adaptable, then make ET41_PCDecls user-definable (function SetET41_PCDecls). %% %% - ?? replace accidentals '7' and 'L' by some better markup? %% /** %% This functor defines Lilypond output and Explorer output actions for 41 ET. %% %% */ functor import Explorer Resolve %% !! tmp functor until next release with debugged Path of stdlib Path at 'x-ozlib://anders/tmp/Path/Path.ozf' GUtils at 'x-ozlib://anders/strasheela/source/GeneralUtils.ozf' MUtils at 'x-ozlib://anders/strasheela/source/MusicUtils.ozf' Score at 'x-ozlib://anders/strasheela/source/ScoreCore.ozf' Out at 'x-ozlib://anders/strasheela/source/Output.ozf' HS at 'x-ozlib://anders/strasheela/HarmonisedScore/HarmonisedScore.ozf' % DB at 'DB.ozf' export % AddExplorerOut_ChordsToScore AddExplorerOuts_ArchiveInitRecord pcDecls: ET41_PCDecls RenderAndShowLilypond ji_TuningTable: JI_TuningTable define %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Explorer Actions %%% %% Uncomment after defining ET41.score.chordsToScore %% % /** %% Creates an Explorer action for outputting a pure sequence of chords. This is a version of HS.out.addExplorerOut_ChordsToScore, customised for 41 ET. Please see the documentation of HS.out.addExplorerOut_ChordsToScore for further details such as supported arguments. % %% */ % proc {AddExplorerOut_ChordsToScore Args} % Defaults = unit(outname:out % % value:random % % ignoreSopranoChordDegree:true % renderAndShowLilypond: RenderAndShowLilypond % chordsToScore: ET41.score.chordsToScore % prefix:"declare \n [ET41] = {ModuleLink ['x-ozlib://anders/strasheela/ET41/ET41.ozf']} \n {HS.db.setDB ET41.db.fullDB}\n ChordSeq \n = {Score.makeScore\n") % As = {Adjoin Defaults Args} % in % {HS.out.addExplorerOut_ChordsToScore As} % end proc {ArchiveInitRecord I X} if {Score.isScoreObject X} then FileName = out#{GUtils.timeForFileName} in {Out.outputScoreConstructor X unit(file: FileName prefix:"declare \n [ET41] = {ModuleLink ['x-ozlib://anders/strasheela/ET41/ET41.ozf']} \n {HS.db.setDB ET41.db.fullDB} \n MyScore \n = ")} end end /** %% Adds ET22 declaration on top of *.ssco file and calls {HS.db.setDB ET22.db.fullDB} %% */ proc {AddExplorerOuts_ArchiveInitRecord} {Explorer.object add(information ArchiveInitRecord label: 'Archive initRecord (ET41)')} end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Customised Lilypond output %%% /** %% Record that maps 41-TET pitch classes to HE notation spec. Each entry is a pair Nominal#Accidental, where nominal is a symbol in {a, b, c, d, e, f, g, b} and Accidental is a symbol in {natural, flat, sharp, natural7, naturalL, sharp7, flatL, natural77}. %% This specification is used by the Lilypond output for the mapping of pitch classes to HE notation, and also for creating the tuning table ET41.out.ji_TuningTable. %% */ ET41_PCDecls = unit(0: c#natural 1: c#natural7 2: d#flatL % 'C77':2 3: d#flat % 'C#L':3 4: c#sharp % 'Db7':4 5: c#sharp7 % 'DLL':5 6: d#naturalL % 'C#77':6 7: d#natural 8: d#natural7 %'Cx': 8 'EbLL':8 9: e#flatL % 'Fbb': 9 'D77':9 10: e#flat % 'D#L':10 11: d#sharp % 'Eb7':11 12: d#sharp7 % 'ELL':12 13: e#naturalL % f#flat 'D#77':13 14: e#natural 15: e#natural7 % 'Dx': 15 'FLL':15 16: f#naturalL %'Gbb': 16 'E77':16 17: f#natural 18: f#natural7 % 'E#': 18 % 'GbLL':18 19: g#flatL % 'F77':19 20: g#flat % 'F#L':20 21: f#sharp % 'Gb7':21 22: f#sharp7 %'Ex': 22 'GLL':22 23: g#naturalL % 'Abb': 23 'F#77':23 24: g#natural 25: g#natural7 % 'Fx': 25 'AbLL':25 26: a#flatL % 'G77':26 27: a#flat % 'G#L':27 28: g#sharp % 'Ab7':28 29: g#sharp7 % 'ALL':29 30: a#naturalL % 'Bbb': 30 'G#77':30 31: a#natural 32: a#natural7 % 'Gx': 32 'BbLL':32 33: b#flatL % 'A77':33 34: b#flat % 'A#L':34 35: a#sharp % 'Bb7':35 36: a#sharp7 % 'BLL':36 37: b#naturalL %'A#77':37 38: b#natural 39: b#natural7 % 'Ax': 39 40: b#natural77 % c#'L' would result in octave problems.. ) ET41_PC_HE_Strings = {Record.map ET41_PCDecls fun {$ Nominal#Acc} HE_String = case Acc of natural then "" % "n" [] natural7 then ">" [] natural77 then "." [] naturalL then "<" [] sharp then "v" [] sharp7 then ">v" % [] SharpL then "e" [] flatL then "