[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Scheme function for tempo marking -- "hash" for names?
From: |
Dmytro O. Redchuk |
Subject: |
Scheme function for tempo marking -- "hash" for names? |
Date: |
Mon, 29 Sep 2008 14:54:37 +0300 |
Hi, all,
i'm sorry, this is, probably, purely-scheme-related-question.
Sorry, i'm not a programmer.
I wanted to align tempo mark ("Adagio", "Moderato" etc)
left-side-centered on key signature
if it is not C-dur or A-moll, otherwise aligned left-side above left
side of time signature.
I wrote small function for tempo marking:
tempoMark =
#(define-music-function (parser location mark anchor offset)
(string? list? number?)
#{
\once \override Score.RehearsalMark #'self-alignment-X = #-1
\once \override Score.KeySignature
#'break-align-anchor-alignment = #CENTER
\once \override Score.TimeSignature
#'break-align-anchor-alignment = #LEFT
\once \override Score.RehearsalMark
#'break-align-symbols = #$anchor
\once \override Score.RehearsalMark #'Y-offset = #$offset
\mark \markup { \bold \smaller $mark }
#})
I use it like this:
\tempoMark "Moderato" #'(key-signature) #0
Next, let's say, i would like to have tempo marking translated into Ukrainian
("Швидко" instead of "Allegro" etc.). But i'm not sure that i will not
change those
translations, so i would like to have a function like this:
moderato =
#(define-music-function (parser location anchor offset)
(list? number?)
#{
\tempoMark "Помірно" $anchor #$offset
#})
and to use it like this:
\moderato #'(key-signature) #0
So, if i decide to "translate back", or to change translations, i can
modify function definition.
But in this case i need to write a lot of identical functions.
So, two questions:
1. Is it possible to define a "hash" (key->value) and use it in a
single function?
I am not a programmer [*], so please give me a clue.
2. May be, i am quite *wrong*, and should use some different approach?
Thank you.
________
* I know how to program this in Python, perl, awk, bash;
however i'm not a programmer at all, that's why i'm asking
for "keyword" or "template", or smth like this.
--
Dmytro O. Redchuk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Scheme function for tempo marking -- "hash" for names?,
Dmytro O. Redchuk <=