Csound Csound-dev Csound-tekno Search About

[Csnd] loopseg syntax

Date2013-09-05 14:07
Fromjean-pierre lemoine
Subject[Csnd] loopseg syntax
Please help to me to correctly understand the syntax of loopseg. I am puzzled by my code that was working as I expect, but as I have a warning message "wrong number of argument", I am trying to figure out how to correctly code loopseg. For this I am trying this little code extracted from the doc

From the manual

ksig loopseg kfreq, ktrig, iphase, ktime0, kvalue0 [, ktime1] [, kvalue1] \

      [, ktime2] [, kvalue2] [...] 
But the following code display only one value change, not what is expected

<CsoundSynthesizer>

<CsOptions>

-iadc0 -odac0 -b1024

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 1

nchnls = 2

instr 300

klp loopseg 10, 0, 0, 0,0, 1,1, 1, 0

printk2 klp

endin

</CsInstruments>


<CsScore>

i300 0 20

</CsScore>


</CsoundSynthesizer>

I understand the parameters as loop frequency of 10 Hz, no retrigger, phase 0 (start immediately), first segment 0,0 - 2nd segment 1,1 - third segment 1,0

I understand (and maybe I am wrong here): value starts at 0, then increases to 1, then go back to 0, each time interval is the same and is 1/3 of 1/10 seconds


By changing to klp loopseg 10, 0, 0, 0,1, 1,1, 0, 0

printk2 displays many different values, but the meaning is

loop frequency of 10 Hz, no retrigger, phase 0 (start immediately), first segment 0,1 - 2nd segment 1,1 - third segment 0,0



Thanks











Date2013-09-05 19:07
Fromjoachim heintz
SubjectRe: [Csnd] loopseg syntax
which version of csound, and of the manual, do you use? there was a 
change / correction, in 5.13 as i just read.

iain has some examples and explanations here:
http://en.flossmanuals.net/csound/a-envelopes/

have a look at 05A10_lpshold_loopseg.csd.

best -

	joachim


Am 05.09.2013 15:07, schrieb jean-pierre lemoine:
> Please help to me to correctly understand the syntax of loopseg. I am
> puzzled by my code that was working as I expect, but as I have a warning
> message "wrong number of argument", I am trying to figure out how to
> correctly code loopseg. For this I am trying this little code extracted
> from the doc
>
>  From the manual
>
> ksig loopsegkfreq, ktrig, iphase, ktime0, kvalue0 [, ktime1] [, kvalue1] \
>
>        [, ktime2] [, kvalue2] [...]
>
> But the following code display only one value change, not what is expected
>
> 
>
> 
>
> -iadc0 -odac0 -b1024
>
> 
>
> 
>
> sr = 44100
>
> ksmps = 1
>
>
> nchnls = 2
>
>
> instr 300
>
> klp loopseg 10, 0, 0, 0,0, 1,1, 1, 0
>
> printk2 klp
>
> endin
>
>
> 
>
>
> 
>
> i300 0 20
>
> 
>
>
>
> 
>
>
> I understand the parameters as loop frequency of 10 Hz, no retrigger,
> phase 0 (start immediately), first segment 0,0 - 2nd segment 1,1 - third
> segment 1,0
>
> I understand (and maybe I am wrong here): value starts at 0, then
> increases to 1, then go back to 0, each time interval is the same and is
> 1/3 of 1/10 seconds
>
>
>
> By changing to klp loopseg 10, 0, 0, 0,1, 1,1, 0, 0
>
> printk2 displays many different values, but the meaning is
>
> loop frequency of 10 Hz, no retrigger, phase 0 (start immediately),
> first segment 0,1 - 2nd segment 1,1 - third segment 0,0
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>
>

Date2013-09-05 22:21
Fromjean-pierre lemoine
SubjectRe: [Csnd] loopseg syntax
Thanks Joachim for looking at this question.

I am using the csound 6 documentation. Where the phase parameter must be? after the trigger parameter or at the end?
Base on my test, this is working only at the end, which is not what the documentation describes.

If I decode the example you suggest to look at, I interpret, assuming that ktemp must be related to a time value
trigger =0
pair 1 = 0,0
pair 2 = 0.1, 1
pair 3 = 55/kTempo, 1
pair 4 = 0.1, 0
pair 5 = 5/kTempo, 0
phase = 0

Phase is at the end 
kAmpEnv   loopseg      kBtFreq, 0, 0, 0,0.1, 1, 55/kTempo, 1, 0.1,0, 5/kTempo,0,0



On Thu, Sep 5, 2013 at 8:07 PM, joachim heintz <jh@joachimheintz.de> wrote:
which version of csound, and of the manual, do you use? there was a change / correction, in 5.13 as i just read.

iain has some examples and explanations here:
http://en.flossmanuals.net/csound/a-envelopes/

have a look at 05A10_lpshold_loopseg.csd.

best -

        joachim


Am 05.09.2013 15:07, schrieb jean-pierre lemoine:
Please help to me to correctly understand the syntax of loopseg. I am
puzzled by my code that was working as I expect, but as I have a warning
message "wrong number of argument", I am trying to figure out how to
correctly code loopseg. For this I am trying this little code extracted
from the doc

 From the manual

ksig loopsegkfreq, ktrig, iphase, ktime0, kvalue0 [, ktime1] [, kvalue1] \


       [, ktime2] [, kvalue2] [...]

But the following code display only one value change, not what is expected

<CsoundSynthesizer>

<CsOptions>

-iadc0 -odac0 -b1024

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 1


nchnls = 2


instr 300

klp loopseg 10, 0, 0, 0,0, 1,1, 1, 0

printk2 klp

endin


</CsInstruments>


<CsScore>

i300 0 20

</CsScore>



</CsoundSynthesizer>


I understand the parameters as loop frequency of 10 Hz, no retrigger,
phase 0 (start immediately), first segment 0,0 - 2nd segment 1,1 - third
segment 1,0

I understand (and maybe I am wrong here): value starts at 0, then
increases to 1, then go back to 0, each time interval is the same and is
1/3 of 1/10 seconds



By changing to klp loopseg 10, 0, 0, 0,1, 1,1, 0, 0

printk2 displays many different values, but the meaning is

loop frequency of 10 Hz, no retrigger, phase 0 (start immediately),
first segment 0,1 - 2nd segment 1,1 - third segment 0,0



Thanks












Send bugs reports to the Sourceforge bug trackers
csound6:
           https://sourceforge.net/p/csound/tickets/
csound5:
           https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"