Csound Csound-dev Csound-tekno Search About

[Csnd] problem using pvsftw and ftsave

Date2011-05-12 20:43
FromRoger Kelly
Subject[Csnd] problem using pvsftw and ftsave
I am trying to use pvsftw to write amp and freq to two tables. I would then like to save them in text using ftsave.

ifn ftgen 1,0,ifftsize,10,1 ; make ftable

ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable

fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal

kflag pvsftw fftin,ifn,ifn2

ftsave "table1.ftsave", 1, ifn

ftsave "table2.ftsave", 1, ifn2


Both files seem identical and have on the amplitude information. What am I doing wrong?



Date2011-05-12 22:15
FromVictor Lazzarini
SubjectRe: [Csnd] problem using pvsftw and ftsave
I think ftsave is i-time, so your tables are being saved before you can write to them. I modified your example and got a
result:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

On 12 May 2011, at 20:43, Roger Kelly wrote:

I am trying to use pvsftw to write amp and freq to two tables. I would then like to save them in text using ftsave.

ifn ftgen 1,0,ifftsize,10,1 ; make ftable
ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable

fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal

kflag pvsftw fftin,ifn,ifn2
ftsave "table1.ftsave", 1, ifn
ftsave "table2.ftsave", 1, ifn2

Both files seem identical and have on the amplitude information. What am I doing wrong?


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-05-12 22:20
FromVictor Lazzarini
SubjectRe: [Csnd] problem using pvsftw and ftsave
It helps to copy the whole CSD ... 

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

i1 0 0.5
i2 0.5 1

</CsScore>
</CsoundSynthesizer>


On 12 May 2011, at 22:15, Victor Lazzarini wrote:

I think ftsave is i-time, so your tables are being saved before you can write to them. I modified your example and got a
result:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

On 12 May 2011, at 20:43, Roger Kelly wrote:

I am trying to use pvsftw to write amp and freq to two tables. I would then like to save them in text using ftsave.

ifn ftgen 1,0,ifftsize,10,1 ; make ftable
ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable

fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal

kflag pvsftw fftin,ifn,ifn2
ftsave "table1.ftsave", 1, ifn
ftsave "table2.ftsave", 1, ifn2

Both files seem identical and have on the amplitude information. What am I doing wrong?


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-05-12 23:19
FromRoger Kelly
SubjectRe: [Csnd] problem using pvsftw and ftsave
Thank so much!  

I am fairly new to CSound.  The solution was to let instrument 1 finish the analysis and write the results at i-time using ftsave in instrument 2 in order to have a full i-time copy of the tables.    Is this a correct understanding on my part?

On Thu, May 12, 2011 at 4:20 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
It helps to copy the whole CSD ... 

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

i1 0 0.5
i2 0.5 1

</CsScore>
</CsoundSynthesizer>


On 12 May 2011, at 22:15, Victor Lazzarini wrote:

I think ftsave is i-time, so your tables are being saved before you can write to them. I modified your example and got a
result:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

On 12 May 2011, at 20:43, Roger Kelly wrote:

I am trying to use pvsftw to write amp and freq to two tables. I would then like to save them in text using ftsave.

ifn ftgen 1,0,ifftsize,10,1 ; make ftable
ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable

fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal

kflag pvsftw fftin,ifn,ifn2
ftsave "table1.ftsave", 1, ifn
ftsave "table2.ftsave", 1, ifn2

Both files seem identical and have on the amplitude information. What am I doing wrong?


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Date2011-05-12 23:29
FromVictor Lazzarini
SubjectRe: [Csnd] problem using pvsftw and ftsave
yes, exactly. But you can run instr 2 at any time to get snapshots of the sound as it gets analysed by pvsanal.

On 12 May 2011, at 23:19, Roger Kelly wrote:

Thank so much!  

I am fairly new to CSound.  The solution was to let instrument 1 finish the analysis and write the results at i-time using ftsave in instrument 2 in order to have a full i-time copy of the tables.    Is this a correct understanding on my part?

On Thu, May 12, 2011 at 4:20 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
It helps to copy the whole CSD ... 

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

i1 0 0.5
i2 0.5 1

</CsScore>
</CsoundSynthesizer>


On 12 May 2011, at 22:15, Victor Lazzarini wrote:

I think ftsave is i-time, so your tables are being saved before you can write to them. I modified your example and got a
result:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

ifftsize = 1024
ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable

instr 1

ifftsize = 1024
ain vco2 0dbfs/2, 440
ain2 =0
fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the audio-signal
kflag pvsftw fs1,2,3
a1 pvsynth fs1

out a1

endin

instr 2
ftsave "table1.ftsave", 1, 2
ftsave "table2.ftsave", 1, 3
turnoff
endin

</CsInstruments>
<CsScore>

On 12 May 2011, at 20:43, Roger Kelly wrote:

I am trying to use pvsftw to write amp and freq to two tables. I would then like to save them in text using ftsave.

ifn ftgen 1,0,ifftsize,10,1 ; make ftable
ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable

fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal

kflag pvsftw fftin,ifn,ifn2
ftsave "table1.ftsave", 1, ifn
ftsave "table2.ftsave", 1, ifn2

Both files seem identical and have on the amplitude information. What am I doing wrong?


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-05-13 00:03
FromRory Walsh
SubjectRe: [Csnd] problem using pvsftw and ftsave
I haven't used these opcodes at all but between this thread and the
great instrument Joachim showed at LAC I'm definitely going to take a
look. It looks like it would be quite easy to build a spectral
sampler.

Rory.


On 12 May 2011 23:29, Victor Lazzarini  wrote:
> yes, exactly. But you can run instr 2 at any time to get snapshots of the
> sound as it gets analysed by pvsanal.
> On 12 May 2011, at 23:19, Roger Kelly wrote:
>
> Thank so much!
> I am fairly new to CSound.  The solution was to let instrument 1 finish the
> analysis and write the results at i-time using ftsave in instrument 2 in
> order to have a full i-time copy of the tables.    Is this a correct
> understanding on my part?
>
> On Thu, May 12, 2011 at 4:20 PM, Victor Lazzarini 
> wrote:
>>
>> It helps to copy the whole CSD ...
>> 
>> 
>> 
>> 
>>
>> ifftsize = 1024
>> ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
>> ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>
>> instr 1
>>
>> ifftsize = 1024
>> ain vco2 0dbfs/2, 440
>> ain2 =0
>> fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the
>> audio-signal
>> kflag pvsftw fs1,2,3
>> a1 pvsynth fs1
>>
>> out a1
>>
>> endin
>>
>> instr 2
>> ftsave "table1.ftsave", 1, 2
>> ftsave "table2.ftsave", 1, 3
>> turnoff
>> endin
>>
>> 
>> 
>>
>> i1 0 0.5
>> i2 0.5 1
>>
>> 
>> 
>>
>> On 12 May 2011, at 22:15, Victor Lazzarini wrote:
>>
>> I think ftsave is i-time, so your tables are being saved before you can
>> write to them. I modified your example and got a
>> result:
>> 
>> 
>> 
>> 
>>
>> ifftsize = 1024
>> ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
>> ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>
>> instr 1
>>
>> ifftsize = 1024
>> ain vco2 0dbfs/2, 440
>> ain2 =0
>> fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis of the
>> audio-signal
>> kflag pvsftw fs1,2,3
>> a1 pvsynth fs1
>>
>> out a1
>>
>> endin
>>
>> instr 2
>> ftsave "table1.ftsave", 1, 2
>> ftsave "table2.ftsave", 1, 3
>> turnoff
>> endin
>>
>> 
>> 
>> On 12 May 2011, at 20:43, Roger Kelly wrote:
>>
>> I am trying to use pvsftw to write amp and freq to two tables. I would
>> then like to save them in text using ftsave.
>> ifn ftgen 1,0,ifftsize,10,1 ; make ftable
>> ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable
>>
>> fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis
>> of the audio-signal
>>
>> kflag pvsftw fftin,ifn,ifn2
>> ftsave "table1.ftsave", 1, ifn
>> ftsave "table2.ftsave", 1, ifn2
>> Both files seem identical and have on the amplitude information. What am I
>> doing wrong?
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>


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"


Date2011-05-13 09:15
Fromjoachim heintz
SubjectRe: [Csnd] problem using pvsftw and ftsave
... also for realtime interaction; for instance with a button in
qutecsound which sends the event "i 2 0 .1", and each time you push the
button the values will be written.
the call of a subinstrument which victor has shown here solves many
problems, like writing values to a file or updating a widget value. as
more as i learn csound, i use this feature.

	joachim


Am 13.05.2011 00:29, schrieb Victor Lazzarini:
> yes, exactly. But you can run instr 2 at any time to get snapshots of
> the sound as it gets analysed by pvsanal.
> 
> On 12 May 2011, at 23:19, Roger Kelly wrote:
> 
>> Thank so much!  
>>
>> I am fairly new to CSound.  The solution was to let instrument 1
>> finish the analysis and write the results at i-time using ftsave in
>> instrument 2 in order to have a full i-time copy of the tables.    Is
>> this a correct understanding on my part?
>>
>> On Thu, May 12, 2011 at 4:20 PM, Victor Lazzarini
>> > wrote:
>>
>>     It helps to copy the whole CSD ... 
>>
>>     
>>     
>>     
>>     
>>
>>     ifftsize = 1024
>>     ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>     ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>
>>     instr 1
>>
>>     ifftsize = 1024
>>     ain vco2 0dbfs/2, 440
>>     ain2 =0
>>     fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis
>>     of the audio-signal
>>     kflag pvsftw fs1,2,3
>>     a1 pvsynth fs1
>>
>>     out a1
>>
>>     endin
>>
>>     instr 2
>>     ftsave "table1.ftsave", 1, 2
>>     ftsave "table2.ftsave", 1, 3
>>     turnoff
>>     endin
>>
>>     
>>     
>>
>>     i1 0 0.5
>>     i2 0.5 1
>>
>>     
>>     
>>
>>
>>     On 12 May 2011, at 22:15, Victor Lazzarini wrote:
>>
>>>     I think ftsave is i-time, so your tables are being saved before
>>>     you can write to them. I modified your example and got a
>>>     result:
>>>
>>>     
>>>     
>>>     
>>>     
>>>
>>>     ifftsize = 1024
>>>     ifn ftgen 2,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>>     ifn2 ftgen 3,0,ifftsize,7,0,ifftsize,0 ; make ftable
>>>
>>>     instr 1
>>>
>>>     ifftsize = 1024
>>>     ain vco2 0dbfs/2, 440
>>>     ain2 =0
>>>     fs1 pvsanal ain, ifftsize, ifftsize/4, ifftsize, 1; fft-analysis
>>>     of the audio-signal
>>>     kflag pvsftw fs1,2,3
>>>     a1 pvsynth fs1
>>>
>>>     out a1
>>>
>>>     endin
>>>
>>>     instr 2
>>>     ftsave "table1.ftsave", 1, 2
>>>     ftsave "table2.ftsave", 1, 3
>>>     turnoff
>>>     endin
>>>
>>>     
>>>     
>>>
>>>     On 12 May 2011, at 20:43, Roger Kelly wrote:
>>>
>>>>     I am trying to use pvsftw to write amp and freq to two tables. I
>>>>     would then like to save them in text using ftsave.
>>>>
>>>>     ifn ftgen 1,0,ifftsize,10,1 ; make ftable
>>>>     ifn2 ftgen 2,0,ifftsize,10,1 ; make ftable
>>>>
>>>>     fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape;
>>>>     fft-analysis of the audio-signal
>>>>
>>>>     kflag pvsftw fftin,ifn,ifn2
>>>>     ftsave "table1.ftsave", 1, ifn
>>>>     ftsave "table2.ftsave", 1, ifn2
>>>>
>>>>     Both files seem identical and have on the amplitude information.
>>>>     What am I doing wrong?
>>>>
>>>
>>>     Dr Victor Lazzarini
>>>     Senior Lecturer
>>>     Dept. of Music
>>>     NUI Maynooth Ireland
>>>     tel.: +353 1 708 3545 
>>>     Victor dot Lazzarini AT nuim dot ie
>>>
>>>
>>>
>>
>>     Dr Victor Lazzarini
>>     Senior Lecturer
>>     Dept. of Music
>>     NUI Maynooth Ireland
>>     tel.: +353 1 708 3545 
>>     Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 


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"