[Bluemusic-devel] Some feature requests to help me write LilyPond aware instruments
Brought to you by:
kunstmusik
From: Bernard H. <be...@ph...> - 2008-04-01 21:39:17
|
Hi All, First I will explain what I am doing. I am into music for electronic + live instruments. The basic idea is that some instruments could "represent" live instruments and could produce actual sound while I am composing, but could go into "LilyPond" mode, turning off their sound output but producing a LilyPond score instead when I finally produce my audio output. I am developing a "LilyWriter" instrument: A] In it's global ORC tab it would contain stuff like: ;[pre]{ #define LilyWriter #<INSTR_ID># pyinit pyruni {{ def hello(): \t print "hello - let's see if this works!!!" #------- lots of python code goes here ------- }} ;} "What's the '\t' for?" I hear you ask. Well, if it is not there, the python ends in the CSD file as: def hello(): print "hello - let's see if this works!!!" -- etc -- Python doesn't like this at all!! This leads to my first request: Request 1: would it be possible for blue NOT to reformat the code in an instrument's global ORC tab? - At least inside a Csound string of the form {{ ---- }} If you actually type this code into blue you will find that the Python gets highlighted as if it were Csound. Leading to: Request 2: Could syntax highlighting be turned off inside such strings? B] The "LilyWriter" global SCO tab contains: i <INSTR_ID> 0 <TOTAL_DUR> Now other instruments can be made LilyPond aware, just by using constructions like: #ifdef $LilyWriter ----- some stuff #endif This can be done inside the instrument itself or in the global ORC tab of the instrument. The upshot of this is that if the "LilyWriter" instrument is included in the orchestra, then it can write the LilyPond score. I won't go into details but I it is starting to work! If it is not included then no score is produced and maybe the Lily-aware instruments can produce sound. All this requires is ticking one box in blue - quite cool! However there is one place where this trick doesn't work - this is in the Global orchestra for the whole project. Code typed into the "Global Orchestra" box on the "global" tab for the project appears in the CSD file BEFORE code tagged with [pre] in an instrument - so it is not possible to use the macro $LilyWriter at this point. This leads to my third request: Request 3: Could [pre] be implemented so that it placed code BEFORE the project's global orchestra code? On second thought this might break some people's blue projects - so maybe a new tag [top] could be implemented. Requests 1 and 2 are not that urgent - being a matter of an ugly hack and eye candy respectively, but it would be REALLY USEFUL to me if 3, could be implemented. Thanks for reading all this! Regards, Bernard |