Csound Csound-dev Csound-tekno Search About

[Csnd] Phasor with variable phase

Date2009-03-06 16:36
FromMark Van Peteghem
Subject[Csnd] Phasor with variable phase
Hi,

I'm looking for a way to make a phasor with a varying phase; with the 
phasor opcode the phase is fixed. Note that it should work for negative 
values of the phase, so a simple frac(x) doesn't work. So far the only 
two solutions I thought of are

aphasor phasor kfreq
aphasor = frac(frac(aphasor+kphase)-1)+1

and

setksmps 1
kphasor phasor kfreq
kphasor loopsegp kphasor+kphase, 0, 1, 1
aphasor upsamp kphasor

which look quite clumsy and maybe consume more CPU-time than necessary.

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


Date2009-03-06 18:21
FromVictor.Lazzarini@nuim.ie
Subject[Csnd] Re: Phasor with variable phase
AttachmentsNone  None  

Date2009-03-06 19:36
FromMichael Gogins
Subject[Csnd] Re: Re: Phasor with variable phase
I think he means phase modulation.

Regards,
Mike

On Fri, Mar 6, 2009 at 1:21 PM,   wrote:
> I am not sure I understand what you want to do; phasor
> outputs a varying phase, so I don't know what you mean
> by a 'variable phase'.
>
> Victor
>
> ----- Original Message -----
> From: Mark Van Peteghem 
> Date: Friday, March 6, 2009 4:36 pm
> Subject: [Csnd] Phasor with variable phase
> To: csound@lists.bath.ac.uk
>
>> Hi,
>>
>> I'm looking for a way to make a phasor with a varying phase;
>> with the
>> phasor opcode the phase is fixed. Note that it should work for
>> negative
>> values of the phase, so a simple frac(x) doesn't work. So far
>> the only
>> two solutions I thought of are
>>
>> aphasor phasor kfreq
>> aphasor = frac(frac(aphasor+kphase)-1)+1
>>
>> and
>>
>> setksmps 1
>> kphasor phasor kfreq
>> kphasor loopsegp kphasor+kphase, 0, 1, 1
>> aphasor upsamp kphasor
>>
>> which look quite clumsy and maybe consume more CPU-time than
>> necessary.
>> --
>>   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"
>
> ========================
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> National University of Ireland, Maynooth
>



-- 
Michael Gogins
Irreducible Productions
Michael dot Gogins at gmail dot com


Date2009-03-06 20:04
FromVictor.Lazzarini@nuim.ie
Subject[Csnd] Re: Re: Re: Phasor with variable phase
AttachmentsNone  None  

Date2009-03-06 20:47
FromMark Van Peteghem
Subject[Csnd] Re: Re: Phasor with variable phase
By variable phase I meant a phase that is a k-rate variable. So what I 
want is something like

aphasor phasor kfreq, kphase

which is not possible now because the second argument of phasor can only 
be a i-rate variable. The two solutions that I mentioned do that, but I 
wonder if there is a simpler way.

Victor.Lazzarini@nuim.ie wrote:
> I am not sure I understand what you want to do; phasor
> outputs a varying phase, so I don't know what you mean
> by a 'variable phase'.
>
> Victor
>
> ----- Original Message -----
> From: Mark Van Peteghem 
> Date: Friday, March 6, 2009 4:36 pm
> Subject: [Csnd] Phasor with variable phase
> To: csound@lists.bath.ac.uk
>
> > Hi,
> >
> > I'm looking for a way to make a phasor with a varying phase;
> > with the
> > phasor opcode the phase is fixed. Note that it should work for
> > negative
> > values of the phase, so a simple frac(x) doesn't work. So far
> > the only
> > two solutions I thought of are
> >
> > aphasor phasor kfreq
> > aphasor = frac(frac(aphasor+kphase)-1)+1
> >
> > and
> >
> > setksmps 1
> > kphasor phasor kfreq
> > kphasor loopsegp kphasor+kphase, 0, 1, 1
> > aphasor upsamp kphasor
> >
> > which look quite clumsy and maybe consume more CPU-time than
> > necessary.
> > --
> >   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"
>
> ========================
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> National University of Ireland, Maynooth

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


Date2009-03-06 21:01
FromMark Van Peteghem
Subject[Csnd] Re: Re: Re: Re: Phasor with variable phase
A hypothetical example is

aphasor phasor kfreq, kphase
aphasor = aphasor + aphasor*(1-aphasor)*imult
asig tablei kphasor, cosine, 1, 0, 1

If I then add two signals like this together but one with a varying 
kphase and another with a constant kphase, you get nice effects of 
interference, like I already did with signals generated with vco2.


Victor.Lazzarini@nuim.ie wrote:
> So I can't see the need for anything extra; I am not
> sure I understand the need for the frac() functions.
>
> Perhaps an usage example would help.
>
> Victor
>
> ----- Original Message -----
> From: Michael Gogins 
> Date: Friday, March 6, 2009 7:37 pm
> Subject: [Csnd] Re: Re: Phasor with variable phase
> To: csound@lists.bath.ac.uk
>
> > I think he means phase modulation.
> >
> > Regards,
> > Mike
> >
> > On Fri, Mar 6, 2009 at 1:21 PM, 
> >  wrote:
> > > I am not sure I understand what you want to do; phasor
> > > outputs a varying phase, so I don't know what you mean
> > > by a 'variable phase'.
> > >
> > > Victor
> > >
> > > ----- Original Message -----
> > > From: Mark Van Peteghem 
> > > Date: Friday, March 6, 2009 4:36 pm
> > > Subject: [Csnd] Phasor with variable phase
> > > To: csound@lists.bath.ac.uk
> > >
> > >> Hi,
> > >>
> > >> I'm looking for a way to make a phasor with a varying phase;
> > >> with the
> > >> phasor opcode the phase is fixed. Note that it should work for
> > >> negative
> > >> values of the phase, so a simple frac(x) doesn't work. So far
> > >> the only
> > >> two solutions I thought of are
> > >>
> > >> aphasor phasor kfreq
> > >> aphasor = frac(frac(aphasor+kphase)-1)+1
> > >>
> > >> and
> > >>
> > >> setksmps 1
> > >> kphasor phasor kfreq
> > >> kphasor loopsegp kphasor+kphase, 0, 1, 1
> > >> aphasor upsamp kphasor
> > >>
> > >> which look quite clumsy and maybe consume more CPU-time than
> > >> necessary.
> > >> --
> > >>   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"
> > >
> > > ========================
> > > Dr Victor Lazzarini
> > > Senior Lecturer
> > > Dept. of Music
> > > National University of Ireland, Maynooth
> > >
> >
> >
> >
> > --
> > Michael Gogins
> > Irreducible Productions
> > Michael dot Gogins at gmail dot com
> >
> >
> > Send bugs reports to this list.
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body
> > "unsubscribe csound"
>
> ========================
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> National University of Ireland, Maynooth

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