Csound Csound-dev Csound-tekno Search About

[Csnd] Error in documentation of loopsegp

Date2008-03-10 10:24
FromMark Van Peteghem
Subject[Csnd] Error in documentation of loopsegp
Hi,

It seems that the documentation of loopsegp is not correct. Instead of

ksig loopsegp  kphase, kvalue0, ktime0, kvalue1, ktime1 \
      [, ... , kvalueN, ktimeN]

it should be

ksig loopsegp  kphase, kvalue0, ktime0, kvalue1 \
      [, ktime1, ... , kvalueN]

so it ends with a value, not a time.

As an example, I wanted to start with a triangle, so I tried

ksig loopsegp kph, 1, 0, -1, 1, 1, 1

quite similar to what you would do with loopseg (except for reversing 
times and values), but after some trial and error I discovered it had to be

ksig loopsegp kph, 1, 1, -1, 1, 1

It would also help if they were called kdur0, kdur1, ... instead of 
ktime0, ktime1, ....

Finally the documentation mentions initphase, but it doesn't seem to be 
used.


-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-10 17:14
From"Andres Cabrera"
Subject[Csnd] Re: Error in documentation of loopsegp
AttachmentsNone  

Date2008-03-10 19:09
FromMark Van Peteghem
Subject[Csnd] Re: Re: Error in documentation of loopsegp
Thanks, but it still contains an error, the kdurN should be removed; at 
least judging by what I found by experimenting.
And perhaps there should be information on what kphase does, although 
the name makes it obvious.

Andres Cabrera schreef:
> Thanks for the feedback. The new manual entry attached below. If you
> have an example to share, it would be great.
>
> Cheers,
> Andrés
>
>
> loopsegp
>
> loopsegp — Control signals based on linear segments.
> Description
>
> Generate control signal consisiting of linear segments delimited by
> two or more specified points. The entire envelope can be looped at
> time-variant rate. Each segment coordinate can also be varied at
> k-rate.
> Syntax
>
> ksig loopsegp  kphase, kvalue0, kdur0, kvalue1 \
>       [, kdur1, ... , kvalueN, kdurN]
>
> Performance
>
> ksig - output signal
>
> kphase - NO INFORMATION
>
> kvalue0 ...kvalueN - values of points
>
> kdur0 ...kdurN - duration of points expessed in fraction of a cycle
>
> loopsegp opcode is similar to loopseg; the only difference is that,
> instead of frequency, a time-variant phase is required. If you use a
> phasor to get the phase value, you will have a behaviour identical to
> loopseg, but interesting results can be achieved when using phases
> having non-linear motions, making loopsegp more powerful and general
> than loopseg.
>
>
>
> On Mon, Mar 10, 2008 at 5:24 AM, Mark Van Peteghem
>  wrote:
>   
>> Hi,
>>
>>  It seems that the documentation of loopsegp is not correct. Instead of
>>
>>  ksig loopsegp  kphase, kvalue0, ktime0, kvalue1, ktime1 \
>>       [, ... , kvalueN, ktimeN]
>>
>>  it should be
>>
>>  ksig loopsegp  kphase, kvalue0, ktime0, kvalue1 \
>>       [, ktime1, ... , kvalueN]
>>
>>  so it ends with a value, not a time.
>>
>>  As an example, I wanted to start with a triangle, so I tried
>>
>>  ksig loopsegp kph, 1, 0, -1, 1, 1, 1
>>
>>  quite similar to what you would do with loopseg (except for reversing
>>  times and values), but after some trial and error I discovered it had to be
>>
>>  ksig loopsegp kph, 1, 1, -1, 1, 1
>>
>>  It would also help if they were called kdur0, kdur1, ... instead of
>>  ktime0, ktime1, ....
>>
>>  Finally the documentation mentions initphase, but it doesn't seem to be
>>  used.
>>
>>
>>  --
>>   Mark
>>   _________________________________________
>>   When you get lemons, you make lemonade.
>>   When you get hardware, you make software.
>>
>>
>>
>>  Send bugs reports to this list.
>>  To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>     
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>   

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-10 20:10
From"Andres Cabrera"
Subject[Csnd] Re: Re: Re: Error in documentation of loopsegp
AttachmentsNone  

Date2008-03-11 07:44
FromMark Van Peteghem
Subject[Csnd] Re: Re: Re: Re: Error in documentation of loopsegp
I took this from the documentation of oscil, omitting what is not 
applicable:

kphase: phase of sampling, expressed as a fraction of a cycle (0 to 1)

Andres Cabrera schreef:
> Thanks for checking, I just fixed kdurN. Can you draft a small line
> describing kphase?
>
> Cheers,
> Andrés
>
>
> On Mon, Mar 10, 2008 at 2:09 PM, Mark Van Peteghem
>  wrote:
>   
>> Thanks, but it still contains an error, the kdurN should be removed; at
>>  least judging by what I found by experimenting.
>>  And perhaps there should be information on what kphase does, although
>>  the name makes it obvious.
>>
>>  Andres Cabrera schreef:
>>
>>
>>     
>>> Thanks for the feedback. The new manual entry attached below. If you
>>>       
>>  > have an example to share, it would be great.
>>  >
>>  > Cheers,
>>  > Andrés
>>  >
>>  >
>>  > loopsegp
>>  >
>>  > loopsegp — Control signals based on linear segments.
>>  > Description
>>  >
>>  > Generate control signal consisiting of linear segments delimited by
>>  > two or more specified points. The entire envelope can be looped at
>>  > time-variant rate. Each segment coordinate can also be varied at
>>  > k-rate.
>>  > Syntax
>>  >
>>  > ksig loopsegp  kphase, kvalue0, kdur0, kvalue1 \
>>  >       [, kdur1, ... , kvalueN, kdurN]
>>  >
>>  > Performance
>>  >
>>  > ksig - output signal
>>  >
>>  > kphase - NO INFORMATION
>>  >
>>  > kvalue0 ...kvalueN - values of points
>>  >
>>  > kdur0 ...kdurN - duration of points expessed in fraction of a cycle
>>  >
>>  > loopsegp opcode is similar to loopseg; the only difference is that,
>>  > instead of frequency, a time-variant phase is required. If you use a
>>  > phasor to get the phase value, you will have a behaviour identical to
>>  > loopseg, but interesting results can be achieved when using phases
>>  > having non-linear motions, making loopsegp more powerful and general
>>  > than loopseg.
>>  >
>>  >
>>  >
>>  > On Mon, Mar 10, 2008 at 5:24 AM, Mark Van Peteghem
>>  >  wrote:
>>  >
>>  >> Hi,
>>  >>
>>  >>  It seems that the documentation of loopsegp is not correct. Instead of
>>  >>
>>  >>  ksig loopsegp  kphase, kvalue0, ktime0, kvalue1, ktime1 \
>>  >>       [, ... , kvalueN, ktimeN]
>>  >>
>>  >>  it should be
>>  >>
>>  >>  ksig loopsegp  kphase, kvalue0, ktime0, kvalue1 \
>>  >>       [, ktime1, ... , kvalueN]
>>  >>
>>  >>  so it ends with a value, not a time.
>>  >>
>>  >>  As an example, I wanted to start with a triangle, so I tried
>>  >>
>>  >>  ksig loopsegp kph, 1, 0, -1, 1, 1, 1
>>  >>
>>  >>  quite similar to what you would do with loopseg (except for reversing
>>  >>  times and values), but after some trial and error I discovered it had to be
>>  >>
>>  >>  ksig loopsegp kph, 1, 1, -1, 1, 1
>>  >>
>>  >>  It would also help if they were called kdur0, kdur1, ... instead of
>>  >>  ktime0, ktime1, ....
>>  >>
>>  >>  Finally the documentation mentions initphase, but it doesn't seem to be
>>  >>  used.
>>  >>
>>  >>
>>  >>  --
>>  >>   Mark
>>  >>   _________________________________________
>>  >>   When you get lemons, you make lemonade.
>>  >>   When you get hardware, you make software.
>>  >>
>>  >>
>>  >>
>>  >>  Send bugs reports to this list.
>>  >>  To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>  >>
>>  >>
>>  >
>>  >
>>  > Send bugs reports to this list.
>>  > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>  >
>>  >
>>
>>  --
>>
>>
>>   Mark
>>   _________________________________________
>>   When you get lemons, you make lemonade.
>>   When you get hardware, you make software.
>>
>>
>>
>>  Send bugs reports to this list.
>>  To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>     
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>   

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-12 06:54
FromMark Van Peteghem
Subject[Csnd] Re: Re: Re: Re: Re: Error in documentation of loopsegp
I'm sorry, I was too hasty here. kphase in loopsegp is entirely 
different from the iphase in oscil. Therefore it may be better to call 
it kphasor (or maybe not, because it doesn't have to be generated with 
phasor, although it often is). Here is a better description:

kphasor: point where the sample is taken from, expressed as a fraction 
of a cycle (0 to 1)

Mark Van Peteghem schreef:
> I took this from the documentation of oscil, omitting what is not 
> applicable:
>
> kphase: phase of sampling, expressed as a fraction of a cycle (0 to 1)
>
> Andres Cabrera schreef:
>> Thanks for checking, I just fixed kdurN. Can you draft a small line
>> describing kphase?


-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-12 06:55
FromMark Van Peteghem
Subject[Csnd] Re: Re: Error in documentation of loopsegp
Andres Cabrera schreef:
> Thanks for the feedback. The new manual entry attached below. If you
> have an example to share, it would be great.
>   

Here is a simple example I just made. It demonstrates the advantage over 
loopseg by using the phase, and also varies one other argument of loopsegp.




sr=44100
ksmps=1
nchnls=2

    instr 1
iphase  = p4

kenv      linen 1, 0.1, p3, 0.1
kph_amp   phasor 2, 0
kamp      loopsegp kph_amp, 60, 1, 30, 1, 60
kamp    = ampdb(kamp)*kenv

kph_freq  phasor 2, iphase
klow_freq line 200, p3, 100
kfreq     loopsegp kph_freq, 400, 1, klow_freq, 1, 400

asig      vco2 kamp, kfreq, 2, 0.5

          outs asig, asig

    endin




i1 0 3 0
i1 + . 0.50





-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-12 14:28
FromCortaigne
Subject[Csnd] (Very minor) error in manual entry for eqfil?
The Syntax given for eqfil is:

asig eqfil ain, kcf, kbw, kgain[, istor]

And the Performance descriptions given are:

asig -- input signal.
kcf -- filter centre frequency
kbw -- peak/notch bandwidth (Hz).
kgain -- peak/notch gain.

Shouldn't that first Performance entry say ain rather than asig?   
Very minor, definitely, but potentially confusing for newbies like  
me.   ;-)

Date2008-03-12 14:40
From"Andres Cabrera"
Subject[Csnd] Re: (Very minor) error in manual entry for eqfil?
AttachmentsNone  

Date2008-03-12 15:50
From"Andres Cabrera"
Subject[Csnd] Re: Re: Re: Error in documentation of loopsegp
AttachmentsNone  

Date2008-03-12 16:20
FromMark Van Peteghem
Subject[Csnd] Re: Re: Re: Re: Error in documentation of loopsegp
Maybe some other name then? I just find kphase confusing, because it is 
not a phase.

Andres Cabrera schreef:
> Thanks for the example, it's now in cvs. I've also used your
> suggestion to write a description for parameter kphase, though I
> haven't changed the name since phasor suggests to me the thing that
> creates a moving phase value, rather than the phase itself.
>
> Cheers,
> Andrés
>
> PD. Here's what it looks like now:
>
> Syntax
>
> ksig loopsegp  kphase, kvalue0, kdur0, kvalue1 \
>       [, kdur1, ... , kdurN-1, kvalueN]
>
> Performance
>
> ksig - output signal
>
> kphase - point of the sequence read, expressed as a fraction of a cycle (0 to 1)
>
> kvalue0 ...kvalueN - values of points
>
> kdur0 ...kdurN-1 - duration of points expessed in fraction of a cycle
>
>
> On Wed, Mar 12, 2008 at 1:55 AM, Mark Van Peteghem
>  wrote:
>   
>> Andres Cabrera schreef:
>>
>>     
>>> Thanks for the feedback. The new manual entry attached below. If you
>>>       
>>  > have an example to share, it would be great.
>>  >
>>
>>  Here is a simple example I just made. It demonstrates the advantage over
>>  loopseg by using the phase, and also varies one other argument of loopsegp.
>>
>>  
>>
>>  
>>  sr=44100
>>  ksmps=1
>>  nchnls=2
>>
>>     instr 1
>>  iphase  = p4
>>
>>  kenv      linen 1, 0.1, p3, 0.1
>>  kph_amp   phasor 2, 0
>>  kamp      loopsegp kph_amp, 60, 1, 30, 1, 60
>>  kamp    = ampdb(kamp)*kenv
>>
>>  kph_freq  phasor 2, iphase
>>  klow_freq line 200, p3, 100
>>  kfreq     loopsegp kph_freq, 400, 1, klow_freq, 1, 400
>>
>>  asig      vco2 kamp, kfreq, 2, 0.5
>>
>>           outs asig, asig
>>
>>     endin
>>
>>  
>>
>>  
>>  i1 0 3 0
>>  i1 + . 0.50
>>  
>>
>>  
>>
>>
>>  --
>>
>>
>>   Mark
>>   _________________________________________
>>   When you get lemons, you make lemonade.
>>   When you get hardware, you make software.
>>
>>
>>
>>  Send bugs reports to this list.
>>  To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>     
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>   

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-03-12 17:24
From"Andres Cabrera"
Subject[Csnd] Re: Re: Re: Re: Re: Error in documentation of loopsegp
AttachmentsNone