On 2015-09-19 13:52, Johan Vromans wrote:
On Sat, 19 Sep 2015 01:05:12 +0200
address@hidden wrote:
This should, by means of a translation table, take my input and
translate it into LP code. So when I write c:sus this will be changed
to
e.g. c:sus4 (or perhaps c:1.4.5) before it is dealt with by LP, and
when
I write c:5 it is translated into c:1.5.
This can easily be done with small Perl script. Even a one-liner like
perl -pe 's/:sus(?!4)/:sus4/g;' -e 's/:5(?![.\/])/:5.1/g;'
myfile.ly | lilypond -o myout -
A table-driven solution would require a couple of more lines.
If you give me the exact transformations I'll write it for you.
-- Johan
You are certainly completely right. The transformation is quite
simple, so a script in perl or awk or any similar program can easily
solve the task. But can you use it in an integrated environment, like
Frescobaldi-LilyPond, which I have come to appreciate a lot. I can
think you have to write my (version of) LP code, run it through the
filter (the script) then import this new file into Frescobaldi to run
it in LP, or possibly put it directly into LP. Well possibly you can
use a pipe, but I do not see how.
My dream is to have all this integrated in the environment, so, to
make it flexible, you feed some database or table or something with
your transforms, preferable only once, and then you can forget it.
Thereafter you write your code, and on its way into LP it is
transformed according to the content in the table. So from LP you get
the correct printout and midi and so on despite the code is written
"my" way.
Thomas Morley has written a procedure in scheme, which therefore has
the better opportunities for integration, but I have not yet had the
time to test it.
/Kaj
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user