Csound Csound-dev Csound-tekno Search About

[Csnd] score loops inside macros

Date2017-09-18 17:25
FromLuciano Zanatta
Subject[Csnd] score loops inside macros
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 Csound@listserv.heanet.ie 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

Date2017-09-19 11:07
FromJohn ff
SubjectRe: [Csnd] score loops inside macros
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  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
>Csound@listserv.heanet.ie
>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
Csound@listserv.heanet.ie
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