Csound Csound-dev Csound-tekno Search About

[Csnd] Orch/sco MACRO?

Date2011-01-01 00:52
From"Art Hunkins"
Subject[Csnd] Orch/sco MACRO?
Is it possible to define a macro that works in both the orc and sco?

I want to define total duration and use that macro value in both places, as 
well as to define the macro toward the beginning of the .csd:

in header:
define DUR #360# ; overall duration

in an instrument:
instr 1
linseg 0, .5, $DUR -1, .5, 0

in score:
i1 0 $DUR

(If this is possible, some reference should be made to it in the manual. As 
it is, the docs seem to suggest it doesn't work.)

Art Hunkins 



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-01-01 01:07
FromJim Aikin
Subject[Csnd] Re: Orch/sco MACRO?
You could always define the macro in the score, then pass it to a global
setup instrument (at time 0) in a p-field, then assign the value in that
p-field to a global i-rate value called giDur, then use giDur in any
instrument. It's roundabout, but not cumbersome, and it ought to work.

To answer your specific question ... I don't know.

--JA

Date2011-01-01 06:31
From"Colman O'Reilly"
Subject[Csnd] Re: Re: Orch/sco MACRO?
Sorry if this seems like too basic of an answer, but is copy/pasting your macro definitions from the orc to the sco something you're trying to avoid?

This seems to be working:

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

#define MACRO #440#

instr 1

a1 oscil 10000, $MACRO, 1

out a1

endin

instr 2

a1 oscil 10000, p4, 1

out a1

endin

</CsInstruments>

<CsScore>
#define MACRO #440#

f1 0 4096 10 1

i1 0 1

i2 2 1 $MACRO

</CsScore>

</CsoundSynthesizer>


Best,

Colman


On Fri, Dec 31, 2010 at 8:07 PM, Jim Aikin <midiguru23@sbcglobal.net> wrote:

You could always define the macro in the score, then pass it to a global
setup instrument (at time 0) in a p-field, then assign the value in that
p-field to a global i-rate value called giDur, then use giDur in any
instrument. It's roundabout, but not cumbersome, and it ought to work.

To answer your specific question ... I don't know.

--JA
--
View this message in context: http://csound.1045644.n5.nabble.com/Orch-sco-MACRO-tp3324004p3324007.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--




Date2011-01-01 10:25
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: Orch/sco MACRO?
Aimple answer is no as the two languages are separate.
Longer answer is that both languages accept #include nd both have the same
macro syntax, so place in a file and include in each place.  Then u pnly
have to maintain one file

==John ff
> Is it possible to define a macro that works in both the orc and sco?
>
> I want to define total duration and use that macro value in both places,
> as
> well as to define the macro toward the beginning of the .csd:
>
> in header:
> define DUR #360# ; overall duration
>
> in an instrument:
> instr 1
> linseg 0, .5, $DUR -1, .5, 0
>
> in score:
> i1 0 $DUR
>
> (If this is possible, some reference should be made to it in the manual.
> As
> it is, the docs seem to suggest it doesn't work.)
>
> Art Hunkins
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>




Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"