Csound Csound-dev Csound-tekno Search About

[Cs-dev] Command line macros

Date2005-05-09 20:56
Fromjpff@codemist.co.uk
Subject[Cs-dev] Command line macros
It would be very useful in a research project here to be able to
define orchestra macros from the command line.  In csound4 I have
hacked in a --macro:FOO=bar option, but that is not clean.  If we do
this in csound5 it either needs an API entry or it could be fakes as
in cs4, or made a little cleaner.  The purpose of this message is to
seek input form others as either why this should not be allowed or how
to do it nicely
==John ffitch


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-09 21:12
FromIstvan Varga
SubjectRe: [Cs-dev] Command line macros
jpff@codemist.co.uk wrote:

> It would be very useful in a research project here to be able to
> define orchestra macros from the command line.  In csound4 I have
> hacked in a --macro:FOO=bar option, but that is not clean.  If we do
> this in csound5 it either needs an API entry or it could be fakes as
> in cs4, or made a little cleaner.  The purpose of this message is to
> seek input form others as either why this should not be allowed or how
> to do it nicely

I already had options in my old "unofficial" Csound4 version to define
any number of orchestra or score macros from the command line, although
I am not sure if it is done in an elegant way.
By the way, I do not know if this is useful for the project, but Csound5
allows defining strset strings from the command line. These are suitable
for passing arguments like file names to the orchestra, but for special
purposes like defining an opcode name (which needs actual text replacement),
macros are needed.
An example of using --strset, that you can try with Csound5:

csound -d -m231 -H0 -f -h -n --strset1="Hello, world" --strset2=1.23 strset.csd



sr	=  48000
ksmps	=  32
nchnls	=  1
0dbfs	=  1

gSfoo	strget 1
gSbar	strget 2
gibar	strtod gSbar

	instr 1

Stmp	sprintf "gSfoo = '%s', gibar = '%g'\n", gSfoo, gibar
	puts Stmp, 1

	endin




i 1 0 1
e





-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-14 03:34
FromAnthony Kozar
SubjectRe: [Cs-dev] Command line macros
This is something that I have been interested in having for a while now.  An
API function certainly would be very useful to hosts.  What about the
command-line syntax below do you not like?

Anthony

On 5/9/05 3:56 PM, jpff@codemist.co.uk  etched in
stone:

> In csound4 I have
> hacked in a --macro:FOO=bar option, but that is not clean.  If we do
> this in csound5 it either needs an API entry or it could be fakes as
> in cs4, or made a little cleaner. 



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-14 06:34
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] Command line macros
>>>>> "Anthony" == Anthony Kozar  writes:

 Anthony> This is something that I have been interested in having for
 Anthony> a while now.  An API function certainly would be very useful
 Anthony> to hosts.  What about the command-line syntax below do you
 Anthony> not like?

It is not so much the syntax but the implementation.  The CS4 version
only allows one such macro, and only an orchestra macro.  I suspect I
need --omacro:FOO=bar and --smacro:HUM=bug

In the same vein I have also written code for #ifdef...#end for
conditional compilation.  The code is low quality; does not allow
nesting of #ifdef at all as skipping is to next #end

Currently in csound4 only.  In cs5 I would still rather do this
properly.  I want the functionality for sure.

 >> In csound4 I have
 >> hacked in a --macro:FOO=bar option, but that is not clean.  If we do
 >> this in csound5 it either needs an API entry or it could be fakes as
 >> in cs4, or made a little cleaner. 

==John ffitch


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net