[Csnd] loop iteration problem
Date | 2017-12-07 23:24 |
From | Oscar Pablo Di Liscia |
Subject | [Csnd] loop iteration problem |
Attachments | test-cnt.csd |
I've attached a score which uses a macro containing an iteration of notes through the { n CNT} statement.and issue the following error: Compiler Info/Warnings/Errors: {: invalid repeat count ;sec note macro #define sec_1(it'gap'start'dur'amp' # {10 CNT i "ADSR" [$start+$gap*$CNT] $dur $amp $frec $tabl $at $dect $decv $rel 0.5 } # ;sec note macro #define sec_1(it'gap'start'dur'amp' # {$it CNT i "ADSR" [$start+$gap*$CNT] $dur $amp $frec $tabl $at $dect $decv $rel 0.5 } # Thanks for your help. Pablo -- Dr. Oscar Pablo Di Liscia Profesor Titular Director Programa de Investigación "Sistemas Temporales y Síntesis Espacial de Sonido en el Arte Sonoro"Escuela Universitaria de Artes Universidad Nacional de Quilmes |
Date | 2017-12-08 14:03 |
From | jpff |
Subject | Re: [Csnd] loop iteration problem |
Macros are expanded in one pass. The count is an integer not an expression. It might be possible to make a exception for this case but it may ope up other semantic quirks On Thu, 7 Dec 2017, Oscar Pablo Di Liscia wrote: > I've attached a score which uses a macro containing an iteration > of notes through the { n CNT} statement. > I tried to run it and it returns an error. > If n is a fix numerical value, there is no problem, but when I try to > use this in a macro and to pass the number of repetitions it fails > and issue the following error: > > Compiler Info/Warnings/Errors: > {: invalid repeat count > > That is: > > ;sec note macro > #define sec_1(it'gap'start'dur'amp'frec'tabl'at'dect'decv'rel) > # > {10 CNT > i "ADSR" [$start+$gap*$CNT] $dur $amp $frec $tabl $at $dect $decv $rel 0.5 > } > # > > Will work and repeat 10 times the i action. > But: > > ;sec note macro > #define sec_1(it'gap'start'dur'amp'frec'tabl'at'dect'decv'rel) > # > {$it CNT > i "ADSR" [$start+$gap*$CNT] $dur $amp $frec $tabl $at $dect $decv $rel 0.5 > } > # > > Will fail. > May be I'm doing something clumsy, but i'm pretty sure of being using this > without any problem in the past. > Thanks for your help. > Pablo > > > -- > Dr. Oscar Pablo Di Liscia > Profesor Titular > Director Programa de Investigación "Sistemas Temporales y Síntesis Espacial de > Sonido en el Arte Sonoro" > Escuela Universitaria de Artes > Universidad Nacional de Quilmes > Argentina > 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 |
Date | 2017-12-08 18:26 |
From | Oscar Pablo Di Liscia |
Subject | Re: [Csnd] loop iteration problem |
Thanks for your answer Jonh. I´ve found this kind of use of the iteration in some Csound code that I wroteI did not know that this changed...When was it? Of course I know that I can do the same using other strategies. Best Pablo 2017-12-08 11:03 GMT-03:00 jpff <jpff@codemist.co.uk>:
-- Dr. Oscar Pablo Di Liscia Profesor Titular Director Programa de Investigación "Sistemas Temporales y Síntesis Espacial de Sonido en el Arte Sonoro"Escuela Universitaria de Artes Universidad Nacional de Quilmes |
Date | 2017-12-10 15:22 |
From | jpff |
Subject | Re: [Csnd] loop iteration problem |
Not sure whe but the wole mcro i score was rewritten about Auturm 2015 It all seems like https://xkcd.com/1172/ The code was full of oddities and incnsistecies I will look at allowing a acro as the nuber bt not an exression ..... On Fri, 8 Dec 2017, Oscar Pablo Di Liscia wrote: > Thanks for your answer Jonh. > I´ve found this kind of use of the iteration in some Csound code that I wrote > two years ago. And it worked to this time, but now is not working. > I did not know that this changed...When was it? > Of course I know that I can do the same using other strategies. > Best > Pablo > > > > 2017-12-08 11:03 GMT-03:00 jpff |
Date | 2017-12-10 16:30 |
From | Oscar Pablo Di Liscia |
Subject | Re: [Csnd] loop iteration problem |
many thanks! El domingo, 10 de diciembre de 2017, jpff <jpff@codemist.co.uk> escribió: Not sure whe but the wole mcro i score was rewritten about Auturm 2015 -- Dr. Oscar Pablo Di Liscia Profesor Titular Director Programa de Investigación "Sistemas Temporales y Síntesis Espacial de Sonido en el Arte Sonoro"Escuela Universitaria de Artes Universidad Nacional de QuilmesCsound 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 |
Date | 2017-12-10 18:52 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] loop iteration problem |
Sadly, all of my macro teaching examples broke with the latest version. Happy to send what used to work.. so that you could see. Sent from my iPhone
|
Date | 2017-12-10 21:44 |
From | jpff |
Subject | Re: [Csnd] loop iteration problem |
i have code that allows a simple macro as the count as in #define xx #12# { $xx J .... } Mildly tested. Thin it will do { $xx. J .... } as well. Is tat sufficient? Versions with $xx(12) etc could be possible at much more expense. Expressions much less likely What suffices? On Sun, 10 Dec 2017, Dr. Richard Boulanger wrote: > Sadly, all of my macro teaching examples broke with the latest version. > Happy to send what used to work.. so that you could see. > > Sent from my iPhone > > On Dec 10, 2017, at 11:30 AM, Oscar Pablo Di Liscia > |