Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Orch/sco MACRO?

Date2011-01-01 23:57
From"Art Hunkins"
Subject[Csnd] Re: Re: Orch/sco MACRO?
This is a user-defined performance situation, so I'd like to: 1) keep to a 
single file for simplicity's sake; 2) have all the macros in one place 
(toward the beginning of the file), all of them being preset by users on a 
potentially per-performance basis.

So, would the following work?

in header:
define DUR #360# ; overall duration

in 2 instruments:
instr 1
event_i "i" 5 0 $DUR

instr 5
linseg 0, .5, $DUR -1, .5, 0

in score:
i1 0 .1


----- Original Message ----- 
From: 
To: 
Sent: Saturday, January 01, 2011 5:25 AM
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"
> 



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-02 09:52
From"Colman O'Reilly"
Subject[Csnd] Re: Re: Re: Orch/sco MACRO?
Awesome - that is a very useful way of handling things, and I reworked my example to get it the way I think you (Art) want it.  You need two files, the CSD, and a separate text file with a ".inc" extension (this might not be mandatory, but the example I found online used it).

I have a file called "test.inc" containing just this text kept in the same folder as the CSD:


#define MACRO #440#


And my CSD is as follows:

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

#include "test.inc"

instr 1

a1 oscil 10000, $MACRO, 1

out a1

endin

instr 2

a1 oscil 10000, p4, 1

out a1

endin

</CsInstruments>

<CsScore>

#include "test.inc"

f1 0 4096 10 1

i1 0 1

i2 2 1 $MACRO

</CsScore>

</CsoundSynthesizer>



I'm pretty sure that's the syntax for what you were after?


C



On Sat, Jan 1, 2011 at 6:57 PM, Art Hunkins <abhunkin@uncg.edu> wrote:
This is a user-defined performance situation, so I'd like to: 1) keep to a single file for simplicity's sake; 2) have all the macros in one place (toward the beginning of the file), all of them being preset by users on a potentially per-performance basis.

So, would the following work?


in header:
define DUR #360# ; overall duration

in 2 instruments:
instr 1
event_i "i" 5 0 $DUR


instr 5
linseg 0, .5, $DUR -1, .5, 0

in score:
i1 0 .1


----- Original Message ----- From: <jpff@cs.bath.ac.uk> Sent: Saturday, January 01, 2011 5:25 AM
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"




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"




--