Csound Csound-dev Csound-tekno Search About

[Csnd] question about pvshift

Date2010-11-28 08:49
FromStefan Thomas
Subject[Csnd] question about pvshift
Dear community,
I've read in the manual:
pvshift — Shift the frequency components of a pv stream, stretching/compressing its spectrum.
But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
Is it possible, to freely change the pitches of the  partials in a  way like, e.g.

ioctave = 43/21
ifund = icps*2
ipartial2 = icps*ioctave
ipartial3 = icps*ioctave^(log10(3)/log10(2))
(etc.)

If I've understood it right, there is a tool available, which can do things like that
see http://www.dynamictonality.com/spectools.htm
I would be interested, if something like this can be done with csound.

Date2010-11-28 10:39
FromJustin Glenn Smith
Subject[Csnd] Re: question about pvshift
Stefan Thomas wrote:
> Dear community,
> I've read in the manual:
> 
>> pvshift — Shift the frequency components of a pv stream,
>> stretching/compressing its spectrum.
>>
> But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
> Is it possible, to freely change the pitches of the  partials in a  way
> like, e.g.
> 
> ioctave = 43/21
>> ifund = icps*2
>> ipartial2 = icps*ioctave
>> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>>
> (etc.)
> 
> If I've understood it right, there is a tool available, which can do things
> like that
> see http://www.dynamictonality.com/spectools.htm
> I would be interested, if something like this can be done with csound.
> 
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 

The current way to do this is to write the fsig to a pair of tables with pvsftw, then manipulate the table data as you see fit with the many facilities provided for manipulating tables, then read from the tables with pvsftr.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-11-28 10:47
FromVictor Lazzarini
Subject[Csnd] Re: question about pvshift
Maybe what you want to do is better done with pvsftr / pvsftw and tablew / table
using function tables.

But remember that pvs bins are not partials and their freq values cannot be wildly changed
(it just won't work). The pvs opcodes shift and scale freqs, but data gets moved from one bin
to another.

Victor

On 28 Nov 2010, at 08:49, Stefan Thomas wrote:

Dear community,
I've read in the manual:
pvshift — Shift the frequency components of a pv stream, stretching/compressing its spectrum.
But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
Is it possible, to freely change the pitches of the  partials in a  way like, e.g.

ioctave = 43/21
ifund = icps*2
ipartial2 = icps*ioctave
ipartial3 = icps*ioctave^(log10(3)/log10(2))
(etc.)

If I've understood it right, there is a tool available, which can do things like that
see http://www.dynamictonality.com/spectools.htm
I would be interested, if something like this can be done with csound.


Date2010-11-28 11:33
Frompeiman khosravi
Subject[Csnd] Re: Re: question about pvshift
You may also want to look at the ATS opcodes for partial manipulation.

P

On 28 November 2010 11:47, Victor Lazzarini  wrote:
> Maybe what you want to do is better done with pvsftr / pvsftw and tablew /
> table
> using function tables.
> But remember that pvs bins are not partials and their freq values cannot be
> wildly changed
> (it just won't work). The pvs opcodes shift and scale freqs, but data gets
> moved from one bin
> to another.
> Victor
> On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>
> Dear community,
> I've read in the manual:
>>
>> pvshift — Shift the frequency components of a pv stream,
>> stretching/compressing its spectrum.
>
> But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
> Is it possible, to freely change the pitches of the  partials in a  way
> like, e.g.
>
>> ioctave = 43/21
>> ifund = icps*2
>> ipartial2 = icps*ioctave
>> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>
> (etc.)
>
> If I've understood it right, there is a tool available, which can do things
> like that
> see http://www.dynamictonality.com/spectools.htm
> I would be interested, if something like this can be done with csound.
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-28 13:05
FromStefan Thomas
Subject[Csnd] Re: Re: Re: question about pvshift
Ok, I will have a look at the ats-opcodes.
Which one would You recommand for my aim, ATScross or ATSsinnoi?

2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
You may also want to look at the ATS opcodes for partial manipulation.

P

On 28 November 2010 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> Maybe what you want to do is better done with pvsftr / pvsftw and tablew /
> table
> using function tables.
> But remember that pvs bins are not partials and their freq values cannot be
> wildly changed
> (it just won't work). The pvs opcodes shift and scale freqs, but data gets
> moved from one bin
> to another.
> Victor
> On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>
> Dear community,
> I've read in the manual:
>>
>> pvshift — Shift the frequency components of a pv stream,
>> stretching/compressing its spectrum.
>
> But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
> Is it possible, to freely change the pitches of the  partials in a  way
> like, e.g.
>
>> ioctave = 43/21
>> ifund = icps*2
>> ipartial2 = icps*ioctave
>> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>
> (etc.)
>
> If I've understood it right, there is a tool available, which can do things
> like that
> see http://www.dynamictonality.com/spectools.htm
> I would be interested, if something like this can be done with csound.
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-28 23:34
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: question about pvshift
ATSpartialtap is probably the one. Use the output data to control an
oscillator's frequency and amplitude.

Note that you need to set 0dbfs=1 in the orchestra header.

Best,

Peiman


On 28 November 2010 13:05, Stefan Thomas
 wrote:
> Ok, I will have a look at the ats-opcodes.
> Which one would You recommand for my aim, ATScross or ATSsinnoi?
>
> 2010/11/28 peiman khosravi 
>>
>> You may also want to look at the ATS opcodes for partial manipulation.
>>
>> P
>>
>> On 28 November 2010 11:47, Victor Lazzarini 
>> wrote:
>> > Maybe what you want to do is better done with pvsftr / pvsftw and tablew
>> > /
>> > table
>> > using function tables.
>> > But remember that pvs bins are not partials and their freq values cannot
>> > be
>> > wildly changed
>> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> > gets
>> > moved from one bin
>> > to another.
>> > Victor
>> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >
>> > Dear community,
>> > I've read in the manual:
>> >>
>> >> pvshift — Shift the frequency components of a pv stream,
>> >> stretching/compressing its spectrum.
>> >
>> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> > Is it possible, to freely change the pitches of the  partials in a  way
>> > like, e.g.
>> >
>> >> ioctave = 43/21
>> >> ifund = icps*2
>> >> ipartial2 = icps*ioctave
>> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >
>> > (etc.)
>> >
>> > If I've understood it right, there is a tool available, which can do
>> > things
>> > like that
>> > see http://www.dynamictonality.com/spectools.htm
>> > I would be interested, if something like this can be done with csound.
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-29 09:06
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: question about pvshift
Dear Peiman,
Do I have to send the output to an oscil-opcode or is there another possibilitie?

2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
ATSpartialtap is probably the one. Use the output data to control an
oscillator's frequency and amplitude.

Note that you need to set 0dbfs=1 in the orchestra header.

Best,

Peiman


On 28 November 2010 13:05, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Ok, I will have a look at the ats-opcodes.
> Which one would You recommand for my aim, ATScross or ATSsinnoi?
>
> 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>>
>> You may also want to look at the ATS opcodes for partial manipulation.
>>
>> P
>>
>> On 28 November 2010 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie>
>> wrote:
>> > Maybe what you want to do is better done with pvsftr / pvsftw and tablew
>> > /
>> > table
>> > using function tables.
>> > But remember that pvs bins are not partials and their freq values cannot
>> > be
>> > wildly changed
>> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> > gets
>> > moved from one bin
>> > to another.
>> > Victor
>> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >
>> > Dear community,
>> > I've read in the manual:
>> >>
>> >> pvshift — Shift the frequency components of a pv stream,
>> >> stretching/compressing its spectrum.
>> >
>> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> > Is it possible, to freely change the pitches of the  partials in a  way
>> > like, e.g.
>> >
>> >> ioctave = 43/21
>> >> ifund = icps*2
>> >> ipartial2 = icps*ioctave
>> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >
>> > (etc.)
>> >
>> > If I've understood it right, there is a tool available, which can do
>> > things
>> > like that
>> > see http://www.dynamictonality.com/spectools.htm
>> > I would be interested, if something like this can be done with csound.
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-29 10:53
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: question about pvshift
Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
better sound quality. You need to set the kr very high as well since
the returned frequencies and amplitudes are control-rate.

;;;;;;;;;;;;;

iduration ATSinfo 7, "filepath"


ktime         line           0, p3, iduration
              ATSbufread     ktime, 1, "filepath", 20

  kfreq1, kamp1 ATSpartialtap  1
  kfreq2, kamp2 ATSpartialtap  10
  kfreq3, kamp3 ATSpartialtap  20

kfreq1 = kfreq1 * 2
kfreq2 = kfreq2 * .5
kfreq3 = kfreq3 *3

apar1 poscil3 kamp1, kfreq1, 1
apar2 poscil3 kamp2, kfreq2, 1
apar3 poscil3 kamp3, kfreq3, 1

aout = apar1+apar2+apar3

	out aout

;;;;;;;;;;;;;;;;;;;;;

P

On 29 November 2010 09:06, Stefan Thomas
 wrote:
> Dear Peiman,
> Do I have to send the output to an oscil-opcode or is there another
> possibilitie?
>
> 2010/11/29 peiman khosravi 
>>
>> ATSpartialtap is probably the one. Use the output data to control an
>> oscillator's frequency and amplitude.
>>
>> Note that you need to set 0dbfs=1 in the orchestra header.
>>
>> Best,
>>
>> Peiman
>>
>>
>> On 28 November 2010 13:05, Stefan Thomas
>>  wrote:
>> > Ok, I will have a look at the ats-opcodes.
>> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >
>> > 2010/11/28 peiman khosravi 
>> >>
>> >> You may also want to look at the ATS opcodes for partial manipulation.
>> >>
>> >> P
>> >>
>> >> On 28 November 2010 11:47, Victor Lazzarini 
>> >> wrote:
>> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>> >> > tablew
>> >> > /
>> >> > table
>> >> > using function tables.
>> >> > But remember that pvs bins are not partials and their freq values
>> >> > cannot
>> >> > be
>> >> > wildly changed
>> >> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> >> > gets
>> >> > moved from one bin
>> >> > to another.
>> >> > Victor
>> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >> >
>> >> > Dear community,
>> >> > I've read in the manual:
>> >> >>
>> >> >> pvshift — Shift the frequency components of a pv stream,
>> >> >> stretching/compressing its spectrum.
>> >> >
>> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> >> > Is it possible, to freely change the pitches of the  partials in a
>> >> > way
>> >> > like, e.g.
>> >> >
>> >> >> ioctave = 43/21
>> >> >> ifund = icps*2
>> >> >> ipartial2 = icps*ioctave
>> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >> >
>> >> > (etc.)
>> >> >
>> >> > If I've understood it right, there is a tool available, which can do
>> >> > things
>> >> > like that
>> >> > see http://www.dynamictonality.com/spectools.htm
>> >> > I would be interested, if something like this can be done with
>> >> > csound.
>> >> >
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-29 12:57
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: question about pvshift
Dear Peiman,
thanks for Your tipp.
For sure I will try Your code.
But let me ask me one more question:
Will ATSpartialtap also "know" the attack and decay times of the the individual partials?

2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
better sound quality. You need to set the kr very high as well since
the returned frequencies and amplitudes are control-rate.

;;;;;;;;;;;;;

iduration ATSinfo 7, "filepath"


ktime         line           0, p3, iduration
             ATSbufread     ktime, 1, "filepath", 20

 kfreq1, kamp1 ATSpartialtap  1
 kfreq2, kamp2 ATSpartialtap  10
 kfreq3, kamp3 ATSpartialtap  20

kfreq1 = kfreq1 * 2
kfreq2 = kfreq2 * .5
kfreq3 = kfreq3 *3

apar1 poscil3 kamp1, kfreq1, 1
apar2 poscil3 kamp2, kfreq2, 1
apar3 poscil3 kamp3, kfreq3, 1

aout = apar1+apar2+apar3

       out aout

;;;;;;;;;;;;;;;;;;;;;

P

On 29 November 2010 09:06, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Dear Peiman,
> Do I have to send the output to an oscil-opcode or is there another
> possibilitie?
>
> 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>>
>> ATSpartialtap is probably the one. Use the output data to control an
>> oscillator's frequency and amplitude.
>>
>> Note that you need to set 0dbfs=1 in the orchestra header.
>>
>> Best,
>>
>> Peiman
>>
>>
>> On 28 November 2010 13:05, Stefan Thomas
>> <kontrapunktstefan@googlemail.com> wrote:
>> > Ok, I will have a look at the ats-opcodes.
>> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >
>> > 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>> >>
>> >> You may also want to look at the ATS opcodes for partial manipulation.
>> >>
>> >> P
>> >>
>> >> On 28 November 2010 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie>
>> >> wrote:
>> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>> >> > tablew
>> >> > /
>> >> > table
>> >> > using function tables.
>> >> > But remember that pvs bins are not partials and their freq values
>> >> > cannot
>> >> > be
>> >> > wildly changed
>> >> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> >> > gets
>> >> > moved from one bin
>> >> > to another.
>> >> > Victor
>> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >> >
>> >> > Dear community,
>> >> > I've read in the manual:
>> >> >>
>> >> >> pvshift — Shift the frequency components of a pv stream,
>> >> >> stretching/compressing its spectrum.
>> >> >
>> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> >> > Is it possible, to freely change the pitches of the  partials in a
>> >> > way
>> >> > like, e.g.
>> >> >
>> >> >> ioctave = 43/21
>> >> >> ifund = icps*2
>> >> >> ipartial2 = icps*ioctave
>> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >> >
>> >> > (etc.)
>> >> >
>> >> > If I've understood it right, there is a tool available, which can do
>> >> > things
>> >> > like that
>> >> > see http://www.dynamictonality.com/spectools.htm
>> >> > I would be interested, if something like this can be done with
>> >> > csound.
>> >> >
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-12-04 18:11
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: question about pvshift
Dear Peiman,
thank You very much!
Your code works fantastic.
I'd never thought that changing the partials of an natural sound could be done in such an easy way.
I've just two more questions:
1. Sometimes I get the error message
ATSBUFREAD: time pointer out of range, truncating to last frame.
          What does it mean and how can I avoid it?
2. I've read in the csound manual about ATSbufred:
 ipartials – number of partials that will be used in the resynthesis (the noise has a maximum of 25 bands).
            Does it mean that I can't use more than 25 partials?


2010/11/29 Stefan Thomas <kontrapunktstefan@googlemail.com>
Dear Peiman,
thanks for Your tipp.
For sure I will try Your code.
But let me ask me one more question:
Will ATSpartialtap also "know" the attack and decay times of the the individual partials?


2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
better sound quality. You need to set the kr very high as well since
the returned frequencies and amplitudes are control-rate.

;;;;;;;;;;;;;

iduration ATSinfo 7, "filepath"


ktime         line           0, p3, iduration
             ATSbufread     ktime, 1, "filepath", 20

 kfreq1, kamp1 ATSpartialtap  1
 kfreq2, kamp2 ATSpartialtap  10
 kfreq3, kamp3 ATSpartialtap  20

kfreq1 = kfreq1 * 2
kfreq2 = kfreq2 * .5
kfreq3 = kfreq3 *3

apar1 poscil3 kamp1, kfreq1, 1
apar2 poscil3 kamp2, kfreq2, 1
apar3 poscil3 kamp3, kfreq3, 1

aout = apar1+apar2+apar3

       out aout

;;;;;;;;;;;;;;;;;;;;;

P

On 29 November 2010 09:06, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Dear Peiman,
> Do I have to send the output to an oscil-opcode or is there another
> possibilitie?
>
> 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>>
>> ATSpartialtap is probably the one. Use the output data to control an
>> oscillator's frequency and amplitude.
>>
>> Note that you need to set 0dbfs=1 in the orchestra header.
>>
>> Best,
>>
>> Peiman
>>
>>
>> On 28 November 2010 13:05, Stefan Thomas
>> <kontrapunktstefan@googlemail.com> wrote:
>> > Ok, I will have a look at the ats-opcodes.
>> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >
>> > 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>> >>
>> >> You may also want to look at the ATS opcodes for partial manipulation.
>> >>
>> >> P
>> >>
>> >> On 28 November 2010 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie>
>> >> wrote:
>> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>> >> > tablew
>> >> > /
>> >> > table
>> >> > using function tables.
>> >> > But remember that pvs bins are not partials and their freq values
>> >> > cannot
>> >> > be
>> >> > wildly changed
>> >> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> >> > gets
>> >> > moved from one bin
>> >> > to another.
>> >> > Victor
>> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >> >
>> >> > Dear community,
>> >> > I've read in the manual:
>> >> >>
>> >> >> pvshift — Shift the frequency components of a pv stream,
>> >> >> stretching/compressing its spectrum.
>> >> >
>> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> >> > Is it possible, to freely change the pitches of the  partials in a
>> >> > way
>> >> > like, e.g.
>> >> >
>> >> >> ioctave = 43/21
>> >> >> ifund = icps*2
>> >> >> ipartial2 = icps*ioctave
>> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >> >
>> >> > (etc.)
>> >> >
>> >> > If I've understood it right, there is a tool available, which can do
>> >> > things
>> >> > like that
>> >> > see http://www.dynamictonality.com/spectools.htm
>> >> > I would be interested, if something like this can be done with
>> >> > csound.
>> >> >
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2010-12-05 00:23
FromAidan Collins
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift
I think that first error means that the index moving through the analysis file is going too far. For example if the last bit of data is at 9.99 but the index goes  all the way to 10. 
I used to use pvoc often and frequently got that message. It wouldn't stop the csd from rendering, but slowed it down a lot.
Try lowering the max value of your index.

A

Sent from my iPhone

On Dec 4, 2010, at 1:11 PM, Stefan Thomas <kontrapunktstefan@googlemail.com> wrote:

Dear Peiman,
thank You very much!
Your code works fantastic.
I'd never thought that changing the partials of an natural sound could be done in such an easy way.
I've just two more questions:
1. Sometimes I get the error message
ATSBUFREAD: time pointer out of range, truncating to last frame.
          What does it mean and how can I avoid it?
2. I've read in the csound manual about ATSbufred:
 ipartials – number of partials that will be used in the resynthesis (the noise has a maximum of 25 bands).
            Does it mean that I can't use more than 25 partials?


2010/11/29 Stefan Thomas <kontrapunktstefan@googlemail.com>
Dear Peiman,
thanks for Your tipp.
For sure I will try Your code.
But let me ask me one more question:
Will ATSpartialtap also "know" the attack and decay times of the the individual partials?


2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
better sound quality. You need to set the kr very high as well since
the returned frequencies and amplitudes are control-rate.

;;;;;;;;;;;;;

iduration ATSinfo 7, "filepath"


ktime         line           0, p3, iduration
             ATSbufread     ktime, 1, "filepath", 20

 kfreq1, kamp1 ATSpartialtap  1
 kfreq2, kamp2 ATSpartialtap  10
 kfreq3, kamp3 ATSpartialtap  20

kfreq1 = kfreq1 * 2
kfreq2 = kfreq2 * .5
kfreq3 = kfreq3 *3

apar1 poscil3 kamp1, kfreq1, 1
apar2 poscil3 kamp2, kfreq2, 1
apar3 poscil3 kamp3, kfreq3, 1

aout = apar1+apar2+apar3

       out aout

;;;;;;;;;;;;;;;;;;;;;

P

On 29 November 2010 09:06, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Dear Peiman,
> Do I have to send the output to an oscil-opcode or is there another
> possibilitie?
>
> 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>>
>> ATSpartialtap is probably the one. Use the output data to control an
>> oscillator's frequency and amplitude.
>>
>> Note that you need to set 0dbfs=1 in the orchestra header.
>>
>> Best,
>>
>> Peiman
>>
>>
>> On 28 November 2010 13:05, Stefan Thomas
>> <kontrapunktstefan@googlemail.com> wrote:
>> > Ok, I will have a look at the ats-opcodes.
>> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >
>> > 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>> >>
>> >> You may also want to look at the ATS opcodes for partial manipulation.
>> >>
>> >> P
>> >>
>> >> On 28 November 2010 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie>
>> >> wrote:
>> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>> >> > tablew
>> >> > /
>> >> > table
>> >> > using function tables.
>> >> > But remember that pvs bins are not partials and their freq values
>> >> > cannot
>> >> > be
>> >> > wildly changed
>> >> > (it just won't work). The pvs opcodes shift and scale freqs, but data
>> >> > gets
>> >> > moved from one bin
>> >> > to another.
>> >> > Victor
>> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >> >
>> >> > Dear community,
>> >> > I've read in the manual:
>> >> >>
>> >> >> pvshift — Shift the frequency components of a pv stream,
>> >> >> stretching/compressing its spectrum.
>> >> >
>> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials.
>> >> > Is it possible, to freely change the pitches of the  partials in a
>> >> > way
>> >> > like, e.g.
>> >> >
>> >> >> ioctave = 43/21
>> >> >> ifund = icps*2
>> >> >> ipartial2 = icps*ioctave
>> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >> >
>> >> > (etc.)
>> >> >
>> >> > If I've understood it right, there is a tool available, which can do
>> >> > things
>> >> > like that
>> >> > see http://www.dynamictonality.com/spectools.htm
>> >> > I would be interested, if something like this can be done with
>> >> > csound.
>> >> >
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2010-12-05 00:36
FromRichard Dobson
Subject[Csnd] Re: : question about pvshift
On 05/12/2010 00:23, Aidan Collins wrote:
> I think that first error means that the index moving through the
> analysis file is going too far. For example if the last bit of data is
> at 9.99 but the index goes all the way to 10.
> I used to use pvoc often and frequently got that message. It wouldn't
> stop the csd from rendering, but slowed it down a lot.
> Try lowering the max value of your index.
>


By way of a side note on such things - if one wants to be sure the 
target pitch as such is perceived by the user,  at the end of the sound, 
the pitch needs to be reached (and maybe held) a little before the end.


Richard Dobson



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-12-05 12:53
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift
On 5 December 2010 00:23, Aidan Collins  wrote:
> I think that first error means that the index moving through the analysis
> file is going too far. For example if the last bit of data is at 9.99 but
> the index goes  all the way to 10.

1- Yes exactly. This error can be ignored.

2- The second point is related to the noise bands not the partials.
The residual part of the signal (the part that cannot be broken into
individual sine components) is written in the analysis file as a
collection of band-pass filters (with different band-widths) and used
to filter noise to synthesize the residual signal (this is useful for
say re-synthesizing a flute sound). If you are just working with the
partials and ignoring the noise part then the 25 band limit does not
apply.

Best,

Peiman



> I used to use pvoc often and frequently got that message. It wouldn't stop
> the csd from rendering, but slowed it down a lot.
> Try lowering the max value of your index.
> A
>
> Sent from my iPhone
> On Dec 4, 2010, at 1:11 PM, Stefan Thomas 
> wrote:
>
> Dear Peiman,
> thank You very much!
> Your code works fantastic.
> I'd never thought that changing the partials of an natural sound could be
> done in such an easy way.
> I've just two more questions:
> 1. Sometimes I get the error message
>>
>> ATSBUFREAD: time pointer out of range, truncating to last frame.
>
>           What does it mean and how can I avoid it?
> 2. I've read in the csound manual about ATSbufred:
>>
>>  ipartials – number of partials that will be used in the resynthesis (the
>> noise has a maximum of 25 bands).
>
>             Does it mean that I can't use more than 25 partials?
>
>
> 2010/11/29 Stefan Thomas 
>>
>> Dear Peiman,
>> thanks for Your tipp.
>> For sure I will try Your code.
>> But let me ask me one more question:
>> Will ATSpartialtap also "know" the attack and decay times of the the
>> individual partials?
>>
>> 2010/11/29 peiman khosravi 
>>>
>>> Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
>>> better sound quality. You need to set the kr very high as well since
>>> the returned frequencies and amplitudes are control-rate.
>>>
>>> ;;;;;;;;;;;;;
>>>
>>> iduration ATSinfo 7, "filepath"
>>>
>>>
>>> ktime         line           0, p3, iduration
>>>              ATSbufread     ktime, 1, "filepath", 20
>>>
>>>  kfreq1, kamp1 ATSpartialtap  1
>>>  kfreq2, kamp2 ATSpartialtap  10
>>>  kfreq3, kamp3 ATSpartialtap  20
>>>
>>> kfreq1 = kfreq1 * 2
>>> kfreq2 = kfreq2 * .5
>>> kfreq3 = kfreq3 *3
>>>
>>> apar1 poscil3 kamp1, kfreq1, 1
>>> apar2 poscil3 kamp2, kfreq2, 1
>>> apar3 poscil3 kamp3, kfreq3, 1
>>>
>>> aout = apar1+apar2+apar3
>>>
>>>        out aout
>>>
>>> ;;;;;;;;;;;;;;;;;;;;;
>>>
>>> P
>>>
>>> On 29 November 2010 09:06, Stefan Thomas
>>>  wrote:
>>> > Dear Peiman,
>>> > Do I have to send the output to an oscil-opcode or is there another
>>> > possibilitie?
>>> >
>>> > 2010/11/29 peiman khosravi 
>>> >>
>>> >> ATSpartialtap is probably the one. Use the output data to control an
>>> >> oscillator's frequency and amplitude.
>>> >>
>>> >> Note that you need to set 0dbfs=1 in the orchestra header.
>>> >>
>>> >> Best,
>>> >>
>>> >> Peiman
>>> >>
>>> >>
>>> >> On 28 November 2010 13:05, Stefan Thomas
>>> >>  wrote:
>>> >> > Ok, I will have a look at the ats-opcodes.
>>> >> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>>> >> >
>>> >> > 2010/11/28 peiman khosravi 
>>> >> >>
>>> >> >> You may also want to look at the ATS opcodes for partial
>>> >> >> manipulation.
>>> >> >>
>>> >> >> P
>>> >> >>
>>> >> >> On 28 November 2010 11:47, Victor Lazzarini
>>> >> >> 
>>> >> >> wrote:
>>> >> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>>> >> >> > tablew
>>> >> >> > /
>>> >> >> > table
>>> >> >> > using function tables.
>>> >> >> > But remember that pvs bins are not partials and their freq values
>>> >> >> > cannot
>>> >> >> > be
>>> >> >> > wildly changed
>>> >> >> > (it just won't work). The pvs opcodes shift and scale freqs, but
>>> >> >> > data
>>> >> >> > gets
>>> >> >> > moved from one bin
>>> >> >> > to another.
>>> >> >> > Victor
>>> >> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>>> >> >> >
>>> >> >> > Dear community,
>>> >> >> > I've read in the manual:
>>> >> >> >>
>>> >> >> >> pvshift — Shift the frequency components of a pv stream,
>>> >> >> >> stretching/compressing its spectrum.
>>> >> >> >
>>> >> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all
>>> >> >> > partials.
>>> >> >> > Is it possible, to freely change the pitches of the  partials in
>>> >> >> > a
>>> >> >> > way
>>> >> >> > like, e.g.
>>> >> >> >
>>> >> >> >> ioctave = 43/21
>>> >> >> >> ifund = icps*2
>>> >> >> >> ipartial2 = icps*ioctave
>>> >> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>>> >> >> >
>>> >> >> > (etc.)
>>> >> >> >
>>> >> >> > If I've understood it right, there is a tool available, which can
>>> >> >> > do
>>> >> >> > things
>>> >> >> > like that
>>> >> >> > see http://www.dynamictonality.com/spectools.htm
>>> >> >> > I would be interested, if something like this can be done with
>>> >> >> > csound.
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >> Send bugs reports to the Sourceforge bug tracker
>>> >> >>
>>> >> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> >> >> Discussions of bugs and features can be posted here
>>> >> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> >> >> "unsubscribe
>>> >> >> csound"
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >> Send bugs reports to the Sourceforge bug tracker
>>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> >> Discussions of bugs and features can be posted here
>>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> >> "unsubscribe
>>> >> csound"
>>> >>
>>> >
>>> >
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-12-05 16:30
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift
Ok, I think I've got it now.
What I now would like to know is:
is it possible to write the output of ATSpartialtap into an table?


2010/12/5 peiman khosravi <peimankhosravi@gmail.com>
On 5 December 2010 00:23, Aidan Collins <mr.aidan.collins@gmail.com> wrote:
> I think that first error means that the index moving through the analysis
> file is going too far. For example if the last bit of data is at 9.99 but
> the index goes  all the way to 10.

1- Yes exactly. This error can be ignored.

2- The second point is related to the noise bands not the partials.
The residual part of the signal (the part that cannot be broken into
individual sine components) is written in the analysis file as a
collection of band-pass filters (with different band-widths) and used
to filter noise to synthesize the residual signal (this is useful for
say re-synthesizing a flute sound). If you are just working with the
partials and ignoring the noise part then the 25 band limit does not
apply.

Best,

Peiman



> I used to use pvoc often and frequently got that message. It wouldn't stop
> the csd from rendering, but slowed it down a lot.
> Try lowering the max value of your index.
> A
>
> Sent from my iPhone
> On Dec 4, 2010, at 1:11 PM, Stefan Thomas <kontrapunktstefan@googlemail.com>
> wrote:
>
> Dear Peiman,
> thank You very much!
> Your code works fantastic.
> I'd never thought that changing the partials of an natural sound could be
> done in such an easy way.
> I've just two more questions:
> 1. Sometimes I get the error message
>>
>> ATSBUFREAD: time pointer out of range, truncating to last frame.
>
>           What does it mean and how can I avoid it?
> 2. I've read in the csound manual about ATSbufred:
>>
>>  ipartials – number of partials that will be used in the resynthesis (the
>> noise has a maximum of 25 bands).
>
>             Does it mean that I can't use more than 25 partials?
>
>
> 2010/11/29 Stefan Thomas <kontrapunktstefan@googlemail.com>
>>
>> Dear Peiman,
>> thanks for Your tipp.
>> For sure I will try Your code.
>> But let me ask me one more question:
>> Will ATSpartialtap also "know" the attack and decay times of the the
>> individual partials?
>>
>> 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>>>
>>> Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
>>> better sound quality. You need to set the kr very high as well since
>>> the returned frequencies and amplitudes are control-rate.
>>>
>>> ;;;;;;;;;;;;;
>>>
>>> iduration ATSinfo 7, "filepath"
>>>
>>>
>>> ktime         line           0, p3, iduration
>>>              ATSbufread     ktime, 1, "filepath", 20
>>>
>>>  kfreq1, kamp1 ATSpartialtap  1
>>>  kfreq2, kamp2 ATSpartialtap  10
>>>  kfreq3, kamp3 ATSpartialtap  20
>>>
>>> kfreq1 = kfreq1 * 2
>>> kfreq2 = kfreq2 * .5
>>> kfreq3 = kfreq3 *3
>>>
>>> apar1 poscil3 kamp1, kfreq1, 1
>>> apar2 poscil3 kamp2, kfreq2, 1
>>> apar3 poscil3 kamp3, kfreq3, 1
>>>
>>> aout = apar1+apar2+apar3
>>>
>>>        out aout
>>>
>>> ;;;;;;;;;;;;;;;;;;;;;
>>>
>>> P
>>>
>>> On 29 November 2010 09:06, Stefan Thomas
>>> <kontrapunktstefan@googlemail.com> wrote:
>>> > Dear Peiman,
>>> > Do I have to send the output to an oscil-opcode or is there another
>>> > possibilitie?
>>> >
>>> > 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>>> >>
>>> >> ATSpartialtap is probably the one. Use the output data to control an
>>> >> oscillator's frequency and amplitude.
>>> >>
>>> >> Note that you need to set 0dbfs=1 in the orchestra header.
>>> >>
>>> >> Best,
>>> >>
>>> >> Peiman
>>> >>
>>> >>
>>> >> On 28 November 2010 13:05, Stefan Thomas
>>> >> <kontrapunktstefan@googlemail.com> wrote:
>>> >> > Ok, I will have a look at the ats-opcodes.
>>> >> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>>> >> >
>>> >> > 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>>> >> >>
>>> >> >> You may also want to look at the ATS opcodes for partial
>>> >> >> manipulation.
>>> >> >>
>>> >> >> P
>>> >> >>
>>> >> >> On 28 November 2010 11:47, Victor Lazzarini
>>> >> >> <Victor.Lazzarini@nuim.ie>
>>> >> >> wrote:
>>> >> >> > Maybe what you want to do is better done with pvsftr / pvsftw and
>>> >> >> > tablew
>>> >> >> > /
>>> >> >> > table
>>> >> >> > using function tables.
>>> >> >> > But remember that pvs bins are not partials and their freq values
>>> >> >> > cannot
>>> >> >> > be
>>> >> >> > wildly changed
>>> >> >> > (it just won't work). The pvs opcodes shift and scale freqs, but
>>> >> >> > data
>>> >> >> > gets
>>> >> >> > moved from one bin
>>> >> >> > to another.
>>> >> >> > Victor
>>> >> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>>> >> >> >
>>> >> >> > Dear community,
>>> >> >> > I've read in the manual:
>>> >> >> >>
>>> >> >> >> pvshift — Shift the frequency components of a pv stream,
>>> >> >> >> stretching/compressing its spectrum.
>>> >> >> >
>>> >> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all
>>> >> >> > partials.
>>> >> >> > Is it possible, to freely change the pitches of the  partials in
>>> >> >> > a
>>> >> >> > way
>>> >> >> > like, e.g.
>>> >> >> >
>>> >> >> >> ioctave = 43/21
>>> >> >> >> ifund = icps*2
>>> >> >> >> ipartial2 = icps*ioctave
>>> >> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>>> >> >> >
>>> >> >> > (etc.)
>>> >> >> >
>>> >> >> > If I've understood it right, there is a tool available, which can
>>> >> >> > do
>>> >> >> > things
>>> >> >> > like that
>>> >> >> > see http://www.dynamictonality.com/spectools.htm
>>> >> >> > I would be interested, if something like this can be done with
>>> >> >> > csound.
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >> Send bugs reports to the Sourceforge bug tracker
>>> >> >>
>>> >> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> >> >> Discussions of bugs and features can be posted here
>>> >> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> >> >> "unsubscribe
>>> >> >> csound"
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >> Send bugs reports to the Sourceforge bug tracker
>>> >>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> >> Discussions of bugs and features can be posted here
>>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> >> "unsubscribe
>>> >> csound"
>>> >>
>>> >
>>> >
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-12-06 10:38
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift
Do you mean th efrequency and amplitude values?

You can just write them into a table by using tabw oe something.

P.

On 5 December 2010 16:30, Stefan Thomas
 wrote:
> Ok, I think I've got it now.
> What I now would like to know is:
> is it possible to write the output of ATSpartialtap into an table?
>
>
> 2010/12/5 peiman khosravi 
>>
>> On 5 December 2010 00:23, Aidan Collins 
>> wrote:
>> > I think that first error means that the index moving through the
>> > analysis
>> > file is going too far. For example if the last bit of data is at 9.99
>> > but
>> > the index goes  all the way to 10.
>>
>> 1- Yes exactly. This error can be ignored.
>>
>> 2- The second point is related to the noise bands not the partials.
>> The residual part of the signal (the part that cannot be broken into
>> individual sine components) is written in the analysis file as a
>> collection of band-pass filters (with different band-widths) and used
>> to filter noise to synthesize the residual signal (this is useful for
>> say re-synthesizing a flute sound). If you are just working with the
>> partials and ignoring the noise part then the 25 band limit does not
>> apply.
>>
>> Best,
>>
>> Peiman
>>
>>
>>
>> > I used to use pvoc often and frequently got that message. It wouldn't
>> > stop
>> > the csd from rendering, but slowed it down a lot.
>> > Try lowering the max value of your index.
>> > A
>> >
>> > Sent from my iPhone
>> > On Dec 4, 2010, at 1:11 PM, Stefan Thomas
>> > 
>> > wrote:
>> >
>> > Dear Peiman,
>> > thank You very much!
>> > Your code works fantastic.
>> > I'd never thought that changing the partials of an natural sound could
>> > be
>> > done in such an easy way.
>> > I've just two more questions:
>> > 1. Sometimes I get the error message
>> >>
>> >> ATSBUFREAD: time pointer out of range, truncating to last frame.
>> >
>> >           What does it mean and how can I avoid it?
>> > 2. I've read in the csound manual about ATSbufred:
>> >>
>> >>  ipartials – number of partials that will be used in the resynthesis
>> >> (the
>> >> noise has a maximum of 25 bands).
>> >
>> >             Does it mean that I can't use more than 25 partials?
>> >
>> >
>> > 2010/11/29 Stefan Thomas 
>> >>
>> >> Dear Peiman,
>> >> thanks for Your tipp.
>> >> For sure I will try Your code.
>> >> But let me ask me one more question:
>> >> Will ATSpartialtap also "know" the attack and decay times of the the
>> >> individual partials?
>> >>
>> >> 2010/11/29 peiman khosravi 
>> >>>
>> >>> Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
>> >>> better sound quality. You need to set the kr very high as well since
>> >>> the returned frequencies and amplitudes are control-rate.
>> >>>
>> >>> ;;;;;;;;;;;;;
>> >>>
>> >>> iduration ATSinfo 7, "filepath"
>> >>>
>> >>>
>> >>> ktime         line           0, p3, iduration
>> >>>              ATSbufread     ktime, 1, "filepath", 20
>> >>>
>> >>>  kfreq1, kamp1 ATSpartialtap  1
>> >>>  kfreq2, kamp2 ATSpartialtap  10
>> >>>  kfreq3, kamp3 ATSpartialtap  20
>> >>>
>> >>> kfreq1 = kfreq1 * 2
>> >>> kfreq2 = kfreq2 * .5
>> >>> kfreq3 = kfreq3 *3
>> >>>
>> >>> apar1 poscil3 kamp1, kfreq1, 1
>> >>> apar2 poscil3 kamp2, kfreq2, 1
>> >>> apar3 poscil3 kamp3, kfreq3, 1
>> >>>
>> >>> aout = apar1+apar2+apar3
>> >>>
>> >>>        out aout
>> >>>
>> >>> ;;;;;;;;;;;;;;;;;;;;;
>> >>>
>> >>> P
>> >>>
>> >>> On 29 November 2010 09:06, Stefan Thomas
>> >>>  wrote:
>> >>> > Dear Peiman,
>> >>> > Do I have to send the output to an oscil-opcode or is there another
>> >>> > possibilitie?
>> >>> >
>> >>> > 2010/11/29 peiman khosravi 
>> >>> >>
>> >>> >> ATSpartialtap is probably the one. Use the output data to control
>> >>> >> an
>> >>> >> oscillator's frequency and amplitude.
>> >>> >>
>> >>> >> Note that you need to set 0dbfs=1 in the orchestra header.
>> >>> >>
>> >>> >> Best,
>> >>> >>
>> >>> >> Peiman
>> >>> >>
>> >>> >>
>> >>> >> On 28 November 2010 13:05, Stefan Thomas
>> >>> >>  wrote:
>> >>> >> > Ok, I will have a look at the ats-opcodes.
>> >>> >> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >>> >> >
>> >>> >> > 2010/11/28 peiman khosravi 
>> >>> >> >>
>> >>> >> >> You may also want to look at the ATS opcodes for partial
>> >>> >> >> manipulation.
>> >>> >> >>
>> >>> >> >> P
>> >>> >> >>
>> >>> >> >> On 28 November 2010 11:47, Victor Lazzarini
>> >>> >> >> 
>> >>> >> >> wrote:
>> >>> >> >> > Maybe what you want to do is better done with pvsftr / pvsftw
>> >>> >> >> > and
>> >>> >> >> > tablew
>> >>> >> >> > /
>> >>> >> >> > table
>> >>> >> >> > using function tables.
>> >>> >> >> > But remember that pvs bins are not partials and their freq
>> >>> >> >> > values
>> >>> >> >> > cannot
>> >>> >> >> > be
>> >>> >> >> > wildly changed
>> >>> >> >> > (it just won't work). The pvs opcodes shift and scale freqs,
>> >>> >> >> > but
>> >>> >> >> > data
>> >>> >> >> > gets
>> >>> >> >> > moved from one bin
>> >>> >> >> > to another.
>> >>> >> >> > Victor
>> >>> >> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >>> >> >> >
>> >>> >> >> > Dear community,
>> >>> >> >> > I've read in the manual:
>> >>> >> >> >>
>> >>> >> >> >> pvshift — Shift the frequency components of a pv stream,
>> >>> >> >> >> stretching/compressing its spectrum.
>> >>> >> >> >
>> >>> >> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all
>> >>> >> >> > partials.
>> >>> >> >> > Is it possible, to freely change the pitches of the  partials
>> >>> >> >> > in
>> >>> >> >> > a
>> >>> >> >> > way
>> >>> >> >> > like, e.g.
>> >>> >> >> >
>> >>> >> >> >> ioctave = 43/21
>> >>> >> >> >> ifund = icps*2
>> >>> >> >> >> ipartial2 = icps*ioctave
>> >>> >> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >>> >> >> >
>> >>> >> >> > (etc.)
>> >>> >> >> >
>> >>> >> >> > If I've understood it right, there is a tool available, which
>> >>> >> >> > can
>> >>> >> >> > do
>> >>> >> >> > things
>> >>> >> >> > like that
>> >>> >> >> > see http://www.dynamictonality.com/spectools.htm
>> >>> >> >> > I would be interested, if something like this can be done with
>> >>> >> >> > csound.
>> >>> >> >> >
>> >>> >> >> >
>> >>> >> >>
>> >>> >> >>
>> >>> >> >> Send bugs reports to the Sourceforge bug tracker
>> >>> >> >>
>> >>> >> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> >> >> Discussions of bugs and features can be posted here
>> >>> >> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> >> >> "unsubscribe
>> >>> >> >> csound"
>> >>> >> >>
>> >>> >> >
>> >>> >> >
>> >>> >>
>> >>> >>
>> >>> >> Send bugs reports to the Sourceforge bug tracker
>> >>> >>
>> >>> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> >> Discussions of bugs and features can be posted here
>> >>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> >> "unsubscribe
>> >>> >> csound"
>> >>> >>
>> >>> >
>> >>> >
>> >>>
>> >>>
>> >>> Send bugs reports to the Sourceforge bug tracker
>> >>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> Discussions of bugs and features can be posted here
>> >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> "unsubscribe
>> >>> csound"
>> >>>
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-12-06 12:23
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift
AttachmentsguitarE.ats  
Dear Peiman,
I tried it with the following code.
I've got the idea with the looping by Joachim.
The problem with the code is:
although there is no error message, I can't hear any sound.

<CsoundSynthesizer>
<CsOptions>

</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 100
nchnls = 2
0dbfs = 1


giPartfreqs    ftgen        0, 0, -30, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30


giSine        ftgen        0, 0, 2^10, 10, 1
        massign     0, 1
instr 10
gimaxdur    =        16 ; maximum duration
endin

instr 1 ;triggered by midi. Calls  inumparts instances of instr 100
inumparts    =        19 ; number of  partials
imidinot    notnum
icps         cpsmidi      
idur        =        gimaxdur
indx        =        1 ; start with first partial
isubinstr    =        100+imidinot/1000 ;e.g 100.060 für c
loop:
ipartfreq    tab_i        indx-1, giPartfreqs
ipartfreq    =        ipartfreq * icps
        event_i    "i", isubinstr, 0, idur, ipartfreq,  indx
        loop_le    indx, 1, inumparts, loop
krelease    release   
 if krelease == 1 then ; for the noteoff-event
         turnoff2    isubinstr, 4, 1
 endif
endin


instr 100 ;spielt einen teilton: hohe teiltöne sind kürzer
iamp ampmidi 1
idur        =        p3 ; duration
ifreq        =        p4 ;partial frequency
ittnr        =        p5 ; partial number
ifiledur     =         4
ktime         line           0, 15, ifiledur
ifilecode     =             1
imaxpartials    =        19
             ATSbufread     ktime, 1, "guitarE.ats", imaxpartials
 krealfreq,     kamp     ATSpartialtap      ittnr


asig        poscil        iamp*kamp, ifreq, giSine
aout        =        asig

        outs         aout, aout
endin


</CsInstruments>
<CsScore>
f 0 36
i 1 0 36 ;
i 10 0 36

</CsScore>
</CsoundSynthesizer>



2010/12/6 peiman khosravi <peimankhosravi@gmail.com>
Do you mean th efrequency and amplitude values?

You can just write them into a table by using tabw oe something.

P.

On 5 December 2010 16:30, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Ok, I think I've got it now.
> What I now would like to know is:
> is it possible to write the output of ATSpartialtap into an table?
>
>
> 2010/12/5 peiman khosravi <peimankhosravi@gmail.com>
>>
>> On 5 December 2010 00:23, Aidan Collins <mr.aidan.collins@gmail.com>
>> wrote:
>> > I think that first error means that the index moving through the
>> > analysis
>> > file is going too far. For example if the last bit of data is at 9.99
>> > but
>> > the index goes  all the way to 10.
>>
>> 1- Yes exactly. This error can be ignored.
>>
>> 2- The second point is related to the noise bands not the partials.
>> The residual part of the signal (the part that cannot be broken into
>> individual sine components) is written in the analysis file as a
>> collection of band-pass filters (with different band-widths) and used
>> to filter noise to synthesize the residual signal (this is useful for
>> say re-synthesizing a flute sound). If you are just working with the
>> partials and ignoring the noise part then the 25 band limit does not
>> apply.
>>
>> Best,
>>
>> Peiman
>>
>>
>>
>> > I used to use pvoc often and frequently got that message. It wouldn't
>> > stop
>> > the csd from rendering, but slowed it down a lot.
>> > Try lowering the max value of your index.
>> > A
>> >
>> > Sent from my iPhone
>> > On Dec 4, 2010, at 1:11 PM, Stefan Thomas
>> > <kontrapunktstefan@googlemail.com>
>> > wrote:
>> >
>> > Dear Peiman,
>> > thank You very much!
>> > Your code works fantastic.
>> > I'd never thought that changing the partials of an natural sound could
>> > be
>> > done in such an easy way.
>> > I've just two more questions:
>> > 1. Sometimes I get the error message
>> >>
>> >> ATSBUFREAD: time pointer out of range, truncating to last frame.
>> >
>> >           What does it mean and how can I avoid it?
>> > 2. I've read in the csound manual about ATSbufred:
>> >>
>> >>  ipartials – number of partials that will be used in the resynthesis
>> >> (the
>> >> noise has a maximum of 25 bands).
>> >
>> >             Does it mean that I can't use more than 25 partials?
>> >
>> >
>> > 2010/11/29 Stefan Thomas <kontrapunktstefan@googlemail.com>
>> >>
>> >> Dear Peiman,
>> >> thanks for Your tipp.
>> >> For sure I will try Your code.
>> >> But let me ask me one more question:
>> >> Will ATSpartialtap also "know" the attack and decay times of the the
>> >> individual partials?
>> >>
>> >> 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>> >>>
>> >>> Yes one of the oscil opcodes. I'd use poscil3 for higher precision and
>> >>> better sound quality. You need to set the kr very high as well since
>> >>> the returned frequencies and amplitudes are control-rate.
>> >>>
>> >>> ;;;;;;;;;;;;;
>> >>>
>> >>> iduration ATSinfo 7, "filepath"
>> >>>
>> >>>
>> >>> ktime         line           0, p3, iduration
>> >>>              ATSbufread     ktime, 1, "filepath", 20
>> >>>
>> >>>  kfreq1, kamp1 ATSpartialtap  1
>> >>>  kfreq2, kamp2 ATSpartialtap  10
>> >>>  kfreq3, kamp3 ATSpartialtap  20
>> >>>
>> >>> kfreq1 = kfreq1 * 2
>> >>> kfreq2 = kfreq2 * .5
>> >>> kfreq3 = kfreq3 *3
>> >>>
>> >>> apar1 poscil3 kamp1, kfreq1, 1
>> >>> apar2 poscil3 kamp2, kfreq2, 1
>> >>> apar3 poscil3 kamp3, kfreq3, 1
>> >>>
>> >>> aout = apar1+apar2+apar3
>> >>>
>> >>>        out aout
>> >>>
>> >>> ;;;;;;;;;;;;;;;;;;;;;
>> >>>
>> >>> P
>> >>>
>> >>> On 29 November 2010 09:06, Stefan Thomas
>> >>> <kontrapunktstefan@googlemail.com> wrote:
>> >>> > Dear Peiman,
>> >>> > Do I have to send the output to an oscil-opcode or is there another
>> >>> > possibilitie?
>> >>> >
>> >>> > 2010/11/29 peiman khosravi <peimankhosravi@gmail.com>
>> >>> >>
>> >>> >> ATSpartialtap is probably the one. Use the output data to control
>> >>> >> an
>> >>> >> oscillator's frequency and amplitude.
>> >>> >>
>> >>> >> Note that you need to set 0dbfs=1 in the orchestra header.
>> >>> >>
>> >>> >> Best,
>> >>> >>
>> >>> >> Peiman
>> >>> >>
>> >>> >>
>> >>> >> On 28 November 2010 13:05, Stefan Thomas
>> >>> >> <kontrapunktstefan@googlemail.com> wrote:
>> >>> >> > Ok, I will have a look at the ats-opcodes.
>> >>> >> > Which one would You recommand for my aim, ATScross or ATSsinnoi?
>> >>> >> >
>> >>> >> > 2010/11/28 peiman khosravi <peimankhosravi@gmail.com>
>> >>> >> >>
>> >>> >> >> You may also want to look at the ATS opcodes for partial
>> >>> >> >> manipulation.
>> >>> >> >>
>> >>> >> >> P
>> >>> >> >>
>> >>> >> >> On 28 November 2010 11:47, Victor Lazzarini
>> >>> >> >> <Victor.Lazzarini@nuim.ie>
>> >>> >> >> wrote:
>> >>> >> >> > Maybe what you want to do is better done with pvsftr / pvsftw
>> >>> >> >> > and
>> >>> >> >> > tablew
>> >>> >> >> > /
>> >>> >> >> > table
>> >>> >> >> > using function tables.
>> >>> >> >> > But remember that pvs bins are not partials and their freq
>> >>> >> >> > values
>> >>> >> >> > cannot
>> >>> >> >> > be
>> >>> >> >> > wildly changed
>> >>> >> >> > (it just won't work). The pvs opcodes shift and scale freqs,
>> >>> >> >> > but
>> >>> >> >> > data
>> >>> >> >> > gets
>> >>> >> >> > moved from one bin
>> >>> >> >> > to another.
>> >>> >> >> > Victor
>> >>> >> >> > On 28 Nov 2010, at 08:49, Stefan Thomas wrote:
>> >>> >> >> >
>> >>> >> >> > Dear community,
>> >>> >> >> > I've read in the manual:
>> >>> >> >> >>
>> >>> >> >> >> pvshift — Shift the frequency components of a pv stream,
>> >>> >> >> >> stretching/compressing its spectrum.
>> >>> >> >> >
>> >>> >> >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all
>> >>> >> >> > partials.
>> >>> >> >> > Is it possible, to freely change the pitches of the  partials
>> >>> >> >> > in
>> >>> >> >> > a
>> >>> >> >> > way
>> >>> >> >> > like, e.g.
>> >>> >> >> >
>> >>> >> >> >> ioctave = 43/21
>> >>> >> >> >> ifund = icps*2
>> >>> >> >> >> ipartial2 = icps*ioctave
>> >>> >> >> >> ipartial3 = icps*ioctave^(log10(3)/log10(2))
>> >>> >> >> >
>> >>> >> >> > (etc.)
>> >>> >> >> >
>> >>> >> >> > If I've understood it right, there is a tool available, which
>> >>> >> >> > can
>> >>> >> >> > do
>> >>> >> >> > things
>> >>> >> >> > like that
>> >>> >> >> > see http://www.dynamictonality.com/spectools.htm
>> >>> >> >> > I would be interested, if something like this can be done with
>> >>> >> >> > csound.
>> >>> >> >> >
>> >>> >> >> >
>> >>> >> >>
>> >>> >> >>
>> >>> >> >> Send bugs reports to the Sourceforge bug tracker
>> >>> >> >>
>> >>> >> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> >> >> Discussions of bugs and features can be posted here
>> >>> >> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> >> >> "unsubscribe
>> >>> >> >> csound"
>> >>> >> >>
>> >>> >> >
>> >>> >> >
>> >>> >>
>> >>> >>
>> >>> >> Send bugs reports to the Sourceforge bug tracker
>> >>> >>
>> >>> >>  https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> >> Discussions of bugs and features can be posted here
>> >>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> >> "unsubscribe
>> >>> >> csound"
>> >>> >>
>> >>> >
>> >>> >
>> >>>
>> >>>
>> >>> Send bugs reports to the Sourceforge bug tracker
>> >>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>> Discussions of bugs and features can be posted here
>> >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>> "unsubscribe
>> >>> csound"
>> >>>
>> >>
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"