| yes, it’s allowed alright.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952
> On 12 May 2016, at 09:13, Anders Genell wrote:
>
> That was my point. asig1 is initialized at init time, asig2 is not, but is still "allowed" (or did I missunderstand?)
>
> Regards,
> Anders
>
>
> On Thu, May 12, 2016 at 10:05 AM, Victor Lazzarini wrote:
> asig2 = asig1 is not an initialisation, it’s a perf-pass assignment.
>
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 12 May 2016, at 09:01, Anders Genell wrote:
> >
> > Maybe clarify to something like "Whenever a csound instrument is called, all calls to the init opcode will be performed and corresponding variables will thus be initialized. All other variables will retain their respective value from the last performance time cycle in the previous instrument instance."?
> > Maybe also add something about error messages received when not initializing variables before use, and how that relates to variables that are "allowed" to not be initialized, like
> >
> > asig1 init 0
> > asig2 = asig1
> >
> > and some complementary bits about what happens at the very first call to an csound instrument when there are no previous instances to inherit?
> >
> > Regards,
> > Anders
> >
> >> 12 maj 2016 kl. 00:53 skrev Oeyvind Brandtsegg :
> >>
> >> Indeed, when commenting on the text description I just meant that it
> >> can be assumed from:
> >> "Whenever a Csound instrument is called, all variables are set to
> >> initial values."
> >> ... that all variables are somehow implicitly initialized
> >> I know that they are not, it was just a comment on how the description
> >> can be interpreted by a novice reader.
> >>
> >> 2016-05-12 0:08 GMT+02:00 Victor Lazzarini :
> >>> All variables that are initialised:
> >>>
> >>> a1 init 0 is an init-pass op
> >>> a1 = 0 is a perf-pass op
> >>>
> >>> Victor Lazzarini
> >>> Dean of Arts, Celtic Studies, and Philosophy
> >>> Maynooth University
> >>> Ireland
> >>>
> >>>> On 11 May 2016, at 22:43, Oeyvind Brandtsegg wrote:
> >>>>
> >>>> Hi Joachim, thanks for the link. I must admit I had not read that part
> >>>> of the Floss manual with enough focus. It is very nice and
> >>>> informative, with good examples. As far as I can see they are all
> >>>> k-rate. Maybe an a-rate example could be used to show that also a-rate
> >>>> vectors keep their contents until explicitly overwritten? Something
> >>>> like the csd I posted at the start of this thread could do(?)
> >>>>
> >>>> There is also a lure in the formulation "Whenever a Csound instrument
> >>>> is called, all variables are set to initial values. This is called the
> >>>> initialization pass.",
> >>>> as it can lead one to think (as I did, wrongly) that all variables are
> >>>> reset whenever a new instance starts.
> >>>> Not sure how to phrase it better though :-)
> >>>>
> >>>>
> >>>>
> >>>> 2016-05-10 22:05 GMT+02:00 joachim heintz :
> >>>>> i have written something about it in the floss manual, as i came across
> >>>>> this, too, some time ago:
> >>>>> http://floss.booktype.pro/csound/a-initialization-and-performance-pass/
> >>>>>
> >>>>> "What happens on a k-variable if an instrument is called multiple times?
> >>>>> What is the initialization value of this variable on the first call, and on
> >>>>> the subsequent calls?
> >>>>>
> >>>>> If this variable is not set explicitely, the init value in the first call of
> >>>>> an instrument is zero, as usual. But, for the next calls, the k-variable is
> >>>>> initialized to the value which was left when the previous instance of the
> >>>>> same instrument turned off."
> >>>>>
> >>>>> and see the examples 03A08, 03A09 and 03A10.
> >>>>>
> >>>>> let me know if something can be expressed better, or is missing.
> >>>>>
> >>>>> joachim
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>> On 10/05/16 13:59, Victor Lazzarini wrote:
> >>>>>>
> >>>>>> yes, something that could go into the manual or even into the FLOSS
> >>>>>> manual.
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 10 May 2016, at 08:50, Oeyvind Brandtsegg
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>> I wonder how this could be documented so users don't stumble upon this
> >>>>>>> unknowingly.
> >>>>>>> As mentioned, this happened to some students working on an exam, when
> >>>>>>> they tried to build a keyboard split samples instrument (different
> >>>>>>> sounds for each key on the midi keyboard).They have not specifically
> >>>>>>> been taught how to do that, but musical need caused experimentation
> >>>>>>> and they did what they could. I must admit their assumption that this
> >>>>>>> should work is not totally unreasonable. Which is why it would be good
> >>>>>>> to document it somehow(?)
> >>>>>>>
> >>>>>>> 2016-05-10 9:38 GMT+02:00 Oeyvind Brandtsegg :
> >>>>>>>>
> >>>>>>>> Hi Victor,
> >>>>>>>> Thanks for the clarification.
> >>>>>>>> I was just surprised that this happens across instrument instances,
> >>>>>>>> i.e. that the audio variables are not zeroed when the next instance
> >>>>>>>> starts.
> >>>>>>>>
> >>>>>>>> 2016-05-10 9:19 GMT+02:00 Victor Lazzarini :
> >>>>>>>>>
> >>>>>>>>> yes, any perf time var (a or otherwise) will hold its last value. For
> >>>>>>>>> this reason if we want for instance to switch off audio, we need to zero a
> >>>>>>>>> variable when we stop filling it, e.g.
> >>>>>>>>>
> >>>>>>>>> if k1 < iend then
> >>>>>>>>> a1 oscili ...
> >>>>>>>>> else
> >>>>>>>>> a1 = 0
> >>>>>>>>> endif
> >>>>>>>>> out a1
> >>>>>>>>>
> >>>>>>>>> without the else part, whatever was last put in the a1 variable will be
> >>>>>>>>> looped over and over each kcycle.
> >>>>>>>>>
> >>>>>>>>> Victor Lazzarini
> >>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
> >>>>>>>>> Maynooth University
> >>>>>>>>> Ireland
> >>>>>>>>>
> >>>>>>>>>> On 10 May 2016, at 07:46, Oeyvind Brandtsegg
> >>>>>>>>>> wrote:
> >>>>>>>>>>
> >>>>>>>>>> Hi,
> >>>>>>>>>> Are audio variables saved between instrument instances?
> >>>>>>>>>> It may seem so from the example below, where I use a conditional to
> >>>>>>>>>> selectively process a section of the instrument. The first and second
> >>>>>>>>>> instances plays cleanly, then I change the conditional on the third
> >>>>>>>>>> instance and it seems like the audio variable a1 keeps its last ksmps
> >>>>>>>>>> values (from instrument instance number two). Similarly, instance 5
> >>>>>>>>>> has a residue of the last ksmps audio samples in the variable a2.
> >>>>>>>>>>
> >>>>>>>>>> Is this related to how conditionals are processed? I tried changing
> >>>>>>>>>> the conditional to k-rate, and the audio output is the same.
> >>>>>>>>>> This is not really the way I would have programmed this kind of signal
> >>>>>>>>>> switching, but some of our students stumbled upon this issue while
> >>>>>>>>>> they were experimenting.
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> sr = 44100
> >>>>>>>>>> ksmps = 10
> >>>>>>>>>> nchnls = 2
> >>>>>>>>>> 0dbfs = 1
> >>>>>>>>>>
> >>>>>>>>>> giSine ftgen 0, 0, 65536, 10, 1
> >>>>>>>>>>
> >>>>>>>>>> instr 1
> >>>>>>>>>> ;a1 = 0
> >>>>>>>>>> ;a2 = 0
> >>>>>>>>>> i1 = p4
> >>>>>>>>>> if i1 == 0 then
> >>>>>>>>>> a1 poscil 0.5, 220, giSine
> >>>>>>>>>> endif
> >>>>>>>>>> if i1 == 1 then
> >>>>>>>>>> a2 poscil 0.5, 2500, giSine
> >>>>>>>>>> endif
> >>>>>>>>>> outs a1, a2
> >>>>>>>>>> endin
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> ; start dur num
> >>>>>>>>>> i1 0 .1 0
> >>>>>>>>>> i1 1 . 0
> >>>>>>>>>> i1 2 . 1
> >>>>>>>>>> i1 3 . 1
> >>>>>>>>>> i1 4 . 0
> >>>>>>>>>> i1 5 . 0
> >>>>>>>>>> i1 6 . 1
> >>>>>>>>>> i1 7 . 1
> >>>>>>>>>> e
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>>
> >>>>>>>>>> Oeyvind Brandtsegg
> >>>>>>>>>> Professor of Music Technology
> >>>>>>>>>> NTNU
> >>>>>>>>>> 7491 Trondheim
> >>>>>>>>>> Norway
> >>>>>>>>>> Cell: +47 92 203 205
> >>>>>>>>>>
> >>>>>>>>>> http://www.partikkelaudio.com/
> >>>>>>>>>> http://soundcloud.com/brandtsegg
> >>>>>>>>>> http://flyndresang.no/
> >>>>>>>>>> http://soundcloud.com/t-emp
> >>>>>>>>>>
> >>>>>>>>>> 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
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>>
> >>>>>>>> Oeyvind Brandtsegg
> >>>>>>>> Professor of Music Technology
> >>>>>>>> NTNU
> >>>>>>>> 7491 Trondheim
> >>>>>>>> Norway
> >>>>>>>> Cell: +47 92 203 205
> >>>>>>>>
> >>>>>>>> http://www.partikkelaudio.com/
> >>>>>>>> http://soundcloud.com/brandtsegg
> >>>>>>>> http://flyndresang.no/
> >>>>>>>> http://soundcloud.com/t-emp
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> --
> >>>>>>>
> >>>>>>> Oeyvind Brandtsegg
> >>>>>>> Professor of Music Technology
> >>>>>>> NTNU
> >>>>>>> 7491 Trondheim
> >>>>>>> Norway
> >>>>>>> Cell: +47 92 203 205
> >>>>>>>
> >>>>>>> http://www.partikkelaudio.com/
> >>>>>>> http://soundcloud.com/brandtsegg
> >>>>>>> http://flyndresang.no/
> >>>>>>> http://soundcloud.com/t-emp
> >>>>>>>
> >>>>>>> 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
> >>>>>
> >>>>> 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
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>>
> >>>> Oeyvind Brandtsegg
> >>>> Professor of Music Technology
> >>>> NTNU
> >>>> 7491 Trondheim
> >>>> Norway
> >>>> Cell: +47 92 203 205
> >>>>
> >>>> http://www.partikkelaudio.com/
> >>>> http://soundcloud.com/brandtsegg
> >>>> http://flyndresang.no/
> >>>> http://soundcloud.com/t-emp
> >>>>
> >>>> 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
> >>
> >>
> >>
> >> --
> >>
> >> Oeyvind Brandtsegg
> >> Professor of Music Technology
> >> NTNU
> >> 7491 Trondheim
> >> Norway
> >> Cell: +47 92 203 205
> >>
> >> http://www.partikkelaudio.com/
> >> http://soundcloud.com/brandtsegg
> >> http://flyndresang.no/
> >> http://soundcloud.com/t-emp
> >>
> >> 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
>
> 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
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 |