Csound Csound-dev Csound-tekno Search About

[Csnd] about Macros

Date2008-02-15 15:54
FromLuís Antunes Pena
Subject[Csnd] about Macros
I'm not sure if there are many persons using Macros, but now that we have the CSD-File wouldn't make sense to have only one definition for the macro instead of separated orc and sco macros?

- Luis


Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail.

Date2008-02-15 17:48
FromJacob Joaquin
Subject[Csnd] Re: about Macros
Universal macros certainly have my vote.  Something like:

# definecsd  sinewave # 1 #


However, there is a way to define macros in one place and have them be used
by both the orchestra and score.  I put all my macros in a separate file,
and then use the include statement in both the orchestra and score.  Saves
me a lot of time.  Here's an (untested) example:



/* -------- foo.csmacro -------- */

# define sinewave # 1 #
# define squaretone # 2 #


/* --------- foo.csd -------- */



sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 1

# include "./foo.csmacro"

instr $sinewave
	; stuff goes here
endin

instr $squaretone
	; stuff goes here
endin



# include "./foo.csmacro"

i $sinewave   0 1 440
i $squaretone 1 4 880




Hope this helps.

Best, 
Jake 
---- 
The Csound Blog 
http://www.thumbuki.com/csound/blog/



k_o_m_p wrote:
> 
> I'm not sure if there are many persons using Macros, but now that we have
> the CSD-File wouldn't make sense to have only one definition for the macro
> instead of separated orc and sco macros?
> 
> - Luis
> 

-- 
View this message in context: http://www.nabble.com/about-Macros-tp15504252p15505032.html
Sent from the Csound - General mailing list archive at Nabble.com.


Date2008-02-23 10:23
From"Chuckk Hubbard"
Subject[Csnd] Re: about Macros
AttachmentsNone