[Csnd] score loops inside macros

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] score loops inside macros

lucianozanattaterra
Hi
I have some questions about the sintax of score loop. 

There's a technical reason for the kind of code below be illegal or it's just a design option?

#define MACROWITHLOOP (nRep)
#
{$nRep

some score statements

}
#

$MACROWITHLOOP(2)
$MACROWITHLOOP(5)
$MACROWITHLOOP(3)

Also, would be feasible have a third optional argument 'wait', which if used specify a time between loop repetitions? 

{NN Macro 5; wait 5 seconds before the loop repeats 

some code

}
 Could these be feature requests?

Cheers
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] score loops inside macros

jpff
Yes there is a technical reason against your first macro.  The macros are expanded in a single pass (csound_prs) before read, so syntax that creates macros must be expanded.  I will have another look.

The other one is harder to consider.  Users can program it I think with existing score opcodes like b

⁣Sent from TypeApp ​

On Sep 18, 2017, 19:58, at 19:58, Luciano Zanatta <[hidden email]> wrote:

>Hi
>I have some questions about the sintax of score loop.
>
>There's a technical reason for the kind of code below be illegal or
>it's
>just a design option?
>
>#define MACROWITHLOOP (nRep)
>#
>{$nRep
>
>some score statements
>
>}
>#
>
>$MACROWITHLOOP(2)
>$MACROWITHLOOP(5)
>$MACROWITHLOOP(3)
>
>Also, would be feasible have a third optional argument 'wait', which if
>used specify a time between loop repetitions?
>
>{NN Macro 5; wait 5 seconds before the loop repeats
>
>some code
>
>}
> Could these be feature requests?
>
>Cheers
>
>Csound mailing list
>[hidden email]
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here