Csound Csound-dev Csound-tekno Search About

[Csnd] gfsig possible?

Date2011-10-23 21:11
Fromk_o_m_p
Subject[Csnd] gfsig possible?
According to the manual it is possible to use global f-streaming variables. I tried a simple example where instr 1 does all the pitch shifting which works fine. Instr 2 and 3 should do the same but passing the f-stream from one instrument to the other which doesn't work. Can gf-variables be used like the other global variables or is there something I am missing?
Thanks for any help,
Luis

<CsoundSynthesizer>

<CsOptions>

-odac -d -m0 -iadc -b512 -B1024

</CsOptions>

<CsInstruments>

0dbfs = 1

instr 1

ain inch 1

ifftsize = 1024

ioverlap = 256

iwinsize = ifftsize

iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype

kscal = 1.5

fsig pvscale fsigin, kscal

ares pvsynth fsig

out ares

endin

instr 2

ain inch 1

ifftsize = 1024

ioverlap = 256

iwinsize = ifftsize

iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype

gfsigin = fsigin

endin

instr 3

kscal = 1.5

fsigin = gfsigin

fsig pvscale fsigin, kscal

ares pvsynth fsig

out ares

endin

</CsInstruments>

<CsScore>

i 1 0 2

i 2 2 2

i 3 2 2

e

</CsScore>

</CsoundSynthesizer>



--
signatur http://luisantunespena.eu


Date2011-10-23 21:17
Frompeiman khosravi
SubjectRe: [Csnd] gfsig possible?
Hello,

I believe you need to use pvsmix as a workaround (assignment is not working).

Take a look at this csd that Victor posted a while ago.

P

;;;;;;;;;This is Victor's CSD showing spectral delay, posted on the
list a few months ago;;;;;;;;;;;


-d


sr= 44100
ksmps = 10
nchnls= 2
giffts init 2048
gibuf init 0
gkt init 0
gfmix1 pvsinit giffts,giffts/4,giffts,1
gfmix2 pvsinit giffts,giffts/4,giffts,1
instr 1 ; this instrument continually fills the buffer
ichn filenchnls p4
if ichn == 2 then
asig,asig2 diskin2 p4, 1,0,1
else
asig diskin2 p4, 1,0,1
endif
asig = asig*0.3
fsig1 pvsanal asig,giffts,giffts/4,giffts,1
gibuf,gkt pvsbuffer fsig1,10
endin
instr 2 ; this reads a certain band region, delayed
icf = p5 ; centre freq
ihbw = p6 ; bandwidth
idel = p8
fsig pvsbufread gkt-idel,gibuf,icf-ihbw,icf+ihbw
; add the signal to the global bus
; assignment is not working
; so we use pvsmix
if p7 == 1 then
fmix pvsmix fsig, gfmix1
gfmix1 pvsmix fmix, fmix
else
fmix pvsmix fsig, gfmix2
gfmix2 pvsmix fmix, fmix
endif
endin
instr 3 ; this instrument resynthesises the audio
kenv linseg 0, 0.01, 1, p3-5,1,5,0
fzero pvsinit 1024
asig1 pvsynth gfmix1
asig2 pvsynth gfmix2
asig1 = kenv*asig1
asig2 = kenv*asig2
outs asig1, asig2
endin
instr 4
kst init p5 ; lowest freq band
kcnt init 0
kdel init 0
ibands = p6
kq = p7
kch init 1
even:
kpow pow sr/(2*kst), kcnt/ibands
kcf = kst*kpow
kdel = kdel + p8 ; each band is delayed p8 secs more
event "i",2,0,p4,p4,kcf,kcf/kq,kch,kdel
kcnt = kcnt + 1
if kch >= 1 then
kch = 0
endif
if kcnt < ibands kgoto even
turnoff
endin


i1 0 205 "newpiano.wav"
i4 0 1 150 50 120 20 0.05
i3 0 205 0



On 23 October 2011 21:11, k_o_m_p  wrote:
> According to the manual it is possible to use global f-streaming variables.
> I tried a simple example where instr 1 does all the pitch shifting which
> works fine. Instr 2 and 3 should do the same but passing the f-stream from
> one instrument to the other which doesn't work. Can gf-variables be used
> like the other global variables or is there something I am missing?
> Thanks for any help,
> Luis
>
> 
>
> 
>
> -odac -d -m0 -iadc -b512 -B1024
>
> 
>
> 
>
> 0dbfs = 1
>
> instr 1
>
> ain inch 1
>
> ifftsize = 1024
>
> ioverlap = 256
>
> iwinsize = ifftsize
>
> iwintype = 1
>
> ainpvs = ain * 4
>
> fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
>
> kscal = 1.5
>
> fsig pvscale fsigin, kscal
>
> ares pvsynth fsig
>
> out ares
>
> endin
>
> instr 2
>
> ain inch 1
>
> ifftsize = 1024
>
> ioverlap = 256
>
> iwinsize = ifftsize
>
> iwintype = 1
>
> ainpvs = ain * 4
>
> fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
>
> gfsigin = fsigin
>
> endin
>
> instr 3
>
> kscal = 1.5
>
> fsigin = gfsigin
>
> fsig pvscale fsigin, kscal
>
> ares pvsynth fsig
>
> out ares
>
> endin
>
> 
>
> 
>
> i 1 0 2
>
> i 2 2 2
>
> i 3 2 2
>
> e
>
> 
>
> 
>
> --
> http://luisantunespena.eu
>
>


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-10-23 21:41
FromVictor Lazzarini
SubjectRe: [Csnd] gfsig possible?
yes, it is possible to use gfsigs. There might be an issue with assignment, but you have two workarounds 

gfsig  pvsmix fsig, fsig

or

gfsig  pvsgain fsig, 1  ; this after 5.14


Victors


On 23 Oct 2011, at 21:11, k_o_m_p wrote:

According to the manual it is possible to use global f-streaming variables. I tried a simple example where instr 1 does all the pitch shifting which works fine. Instr 2 and 3 should do the same but passing the f-stream from one instrument to the other which doesn't work. Can gf-variables be used like the other global variables or is there something I am missing?
Thanks for any help,
Luis 

<CsoundSynthesizer>
<CsOptions>
-odac -d -m0 -iadc -b512 -B1024
</CsOptions>
<CsInstruments>

0dbfs = 1

instr 1

ain inch 1

ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
kscal = 1.5

fsig pvscale fsigin, kscal
ares pvsynth fsig
out ares
endin

instr 2
ain inch 1

ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
gfsigin = fsigin
endin

instr 3
kscal = 1.5
fsigin = gfsigin
fsig pvscale fsigin, kscal
ares pvsynth fsig

out ares

endin

</CsInstruments>
<CsScore>

i 1 0 2
i 2 2 2
i 3 2 2

e
</CsScore>
</CsoundSynthesizer>



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




Date2011-10-23 21:47
Fromk_o_m_p
SubjectRe: [Csnd] gfsig possible?
Thanks Peiman. I'll take a look at this instrument.
Best,
Luis

Em 23.10.11 22:17, peiman khosravi escreveu:
;;;;;;;;;This is Victor's CSD showing spectral delay, posted on the
list a few months ago;;;;;;;;;;;
<CsoundSynthesizer>
<CsOptions>
-d
</CsOptions>
<CsInstruments>
sr= 44100
ksmps = 10
nchnls= 2
giffts init 2048
gibuf init 0
gkt init 0
gfmix1 pvsinit giffts,giffts/4,giffts,1
gfmix2 pvsinit giffts,giffts/4,giffts,1
instr 1 ; this instrument continually fills the buffer
ichn filenchnls p4
if ichn == 2 then
asig,asig2 diskin2 p4, 1,0,1
else
asig diskin2 p4, 1,0,1
endif
asig = asig*0.3
fsig1 pvsanal asig,giffts,giffts/4,giffts,1
gibuf,gkt pvsbuffer fsig1,10
endin
instr 2 ; this reads a certain band region, delayed
icf = p5 ; centre freq
ihbw = p6 ; bandwidth
idel = p8
fsig pvsbufread gkt-idel,gibuf,icf-ihbw,icf+ihbw
; add the signal to the global bus
; assignment is not working
; so we use pvsmix
if p7 == 1 then
fmix pvsmix fsig, gfmix1
gfmix1 pvsmix fmix, fmix
else
fmix pvsmix fsig, gfmix2
gfmix2 pvsmix fmix, fmix
endif
endin
instr 3 ; this instrument resynthesises the audio
kenv linseg 0, 0.01, 1, p3-5,1,5,0
fzero pvsinit 1024
asig1 pvsynth gfmix1
asig2 pvsynth gfmix2
asig1 = kenv*asig1
asig2 = kenv*asig2
outs asig1, asig2
endin
instr 4
kst init p5 ; lowest freq band
kcnt init 0
kdel init 0
ibands = p6
kq = p7
kch init 1
even:
kpow pow sr/(2*kst), kcnt/ibands
kcf = kst*kpow
kdel = kdel + p8 ; each band is delayed p8 secs more
event "i",2,0,p4,p4,kcf,kcf/kq,kch,kdel
kcnt = kcnt + 1
if kch >= 1 then
kch = 0
endif
if kcnt < ibands kgoto even
turnoff
endin
</CsInstruments>
<CsScore>
i1 0 205 "newpiano.wav"
i4 0 1 150 50 120 20 0.05
i3 0 205 0
</CsScore>
</CsoundSynthesizer>


--
signatur http://luisantunespena.eu


Date2011-10-23 21:49
Fromk_o_m_p
SubjectRe: [Csnd] gfsig possible?
OK, thanks. I'll try pvmix by now.

Em 23.10.11 22:41, Victor Lazzarini escreveu:
yes, it is possible to use gfsigs. There might be an issue with assignment, but you have two workarounds 


--
signatur luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)

Date2011-10-23 21:50
FromVictor Lazzarini
SubjectRe: [Csnd] gfsig possible?
This works:

instr 2
ain inch 1
ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1
ainpvs = ain * 4
fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
gfsigin pvsgain fsigin,1
endin

instr 3
kscal = 1.5
fsigin pvsgain gfsigin, 1
fsig pvscale fsigin, kscal
ares pvsynth fsig
out ares
endin

or this

instr 2
ain inch 1
ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1
ainpvs = ain * 4
fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
gfsigin pvsmix fsigin,fsigin
endin

instr 3
kscal = 1.5
fsigin pvsmix gfsigin, gfsigin
fsig pvscale fsigin, kscal
ares pvsynth fsig
out ares
endin



On 23 Oct 2011, at 21:11, k_o_m_p wrote:

According to the manual it is possible to use global f-streaming variables. I tried a simple example where instr 1 does all the pitch shifting which works fine. Instr 2 and 3 should do the same but passing the f-stream from one instrument to the other which doesn't work. Can gf-variables be used like the other global variables or is there something I am missing?
Thanks for any help,
Luis 

<CsoundSynthesizer>
<CsOptions>
-odac -d -m0 -iadc -b512 -B1024
</CsOptions>
<CsInstruments>

0dbfs = 1

instr 1

ain inch 1

ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
kscal = 1.5

fsig pvscale fsigin, kscal
ares pvsynth fsig
out ares
endin

instr 2
ain inch 1

ifftsize = 1024
ioverlap = 256
iwinsize = ifftsize
iwintype = 1

ainpvs = ain * 4

fsigin pvsanal ainpvs, ifftsize, ioverlap, iwinsize, iwintype
gfsigin = fsigin
endin

instr 3
kscal = 1.5
fsigin = gfsigin
fsig pvscale fsigin, kscal
ares pvsynth fsig

out ares

endin

</CsInstruments>
<CsScore>

i 1 0 2
i 2 2 2
i 3 2 2

e
</CsScore>
</CsoundSynthesizer>



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