[Csnd] what's wrong with looping?
Date | 2011-05-23 15:03 |
From | Matti Koskinen |
Subject | [Csnd] what's wrong with looping? |
this simply doesn't work, nor it prints anything. Tried osx 5.13 and win 5.13 sr = 44100 kr = 44100 ksmps = 1 nchnls = 2 gi1 ftgen 0, 0, 8192, 10, 1 gktrigamp init 0.1 gkbin init 2 gkupbin init 250 gktimeout init 0.5 gklowbin init 2 gkamp init 2 gktimenow init 0 gigrainlen init 0.5 gimaxosc init 400 instr 1 ifftsize = 1024 iwtype = 1 /* cleaner with hanning window */ kbins = ifftsize/2 zakinit 1,ifftsize loop0: a1 soundin "hi.aiff" ;select a soundifle ;a1 inch 1 ;Use realtime input fsig pvsanal a1, ifftsize, ifftsize/4, ifftsize, iwtype kzakpt = 0 knumbins = 0 loop1: kamp, kfr pvsbin fsig, gkbin printks "bin ",0,kamp,kfr zkw kamp,kzakpt kzakpt = kzakpt+1 zkw kfr,kzakpt kzakpt = kzakpt +1 gkbin =gkbin+1 knumbins = knumbins+1 printk 0,kzakpt cggoto (gkbin |
Date | 2011-05-23 15:25 |
From | Steven Yi |
Subject | Re: [Csnd] what's wrong with looping? |
Hi Matti, It looks like you have an infinite loop the performace of instr 1, as you end the instrument with "goto loop0", which will always go back to the beginning of the instrument. Looks like to me that once csound goes to performance instr 1, it won't ever get out of performing it. This may account for the not-seeing the printing, though it may have to do with the implementation of the printXXX opcodes you are using. Regardless, the goto loop0 looks like an error to me. steven On Mon, May 23, 2011 at 7:03 AM, Matti Koskinen |
Date | 2011-05-23 15:30 |
From | Victor Lazzarini |
Subject | Re: [Csnd] what's wrong with looping? |
Notice that printk only prints once per k-cycle (at max). Try printk2 to print every time the k-var changes. As for the other things not working, maybe you need to simplify your code to see what is going on. Loops do work, as you can try this: knumbins init 0 loop1: knumbins = knumbins+1 printk2 knumbins if knumbins<10 kgoto loop1 Regards Victor On 23 May 2011, at 15:03, Matti Koskinen wrote: > this simply doesn't work, nor it prints anything. Tried osx 5.13 and > win 5.13 > > sr = 44100 > kr = 44100 > ksmps = 1 > nchnls = 2 > > gi1 ftgen 0, 0, 8192, 10, 1 > gktrigamp init 0.1 > gkbin init 2 > gkupbin init 250 > gktimeout init 0.5 > gklowbin init 2 > gkamp init 2 > gktimenow init 0 > gigrainlen init 0.5 > gimaxosc init 400 > instr 1 > ifftsize = 1024 > iwtype = 1 /* cleaner with hanning window */ > kbins = ifftsize/2 > zakinit 1,ifftsize > loop0: > a1 soundin "hi.aiff" ;select a soundifle > ;a1 inch 1 ;Use realtime input > > fsig pvsanal a1, ifftsize, ifftsize/4, ifftsize, iwtype > > kzakpt = 0 > knumbins = 0 > loop1: > kamp, kfr pvsbin fsig, gkbin > printks "bin ",0,kamp,kfr > zkw kamp,kzakpt > kzakpt = kzakpt+1 > zkw kfr,kzakpt > kzakpt = kzakpt +1 > gkbin =gkbin+1 > knumbins = knumbins+1 > printk 0,kzakpt > cggoto (gkbin |
Date | 2011-05-23 16:15 |
From | Matti Koskinen |
Subject | Re: [Csnd] what's wrong with looping? |
On May 23, 2011, at 5:30 PM, Victor Lazzarini wrote: this part went to infinte loop, tried timout ..reinit ..rireturn, but that didn't work as well. Idea was to wait for a defined time, is there any suspend, sleep or wait opcode?
this was wrong as well. I thought of it being wrong and tried without it, but as the the waiting part didn't work, it was left as it was.
-matti |
Date | 2011-05-23 16:20 |
From | Victor Lazzarini |
Subject | Re: [Csnd] what's wrong with looping? |
which bins return negative frequency? On 23 May 2011, at 16:15, Matti Koskinen wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-05-23 16:44 |
From | Matti Koskinen |
Subject | Re: [Csnd] what's wrong with looping? |
On May 23, 2011, at 6:20 PM, Victor Lazzarini wrote: > which bins return negative frequency? > seems to be 1,2,3,4 -matti 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" |
Date | 2011-05-23 16:55 |
From | Victor Lazzarini |
Subject | Re: [Csnd] what's wrong with looping? |
yes, I guess that can happen. I would expect the amplitude values to be quite low. If significant signals are picked up by the lower bins, pvsanal should produce positive frequency outputs for those bins. Victor On 23 May 2011, at 16:44, Matti Koskinen wrote: > > On May 23, 2011, at 6:20 PM, Victor Lazzarini wrote: > >> which bins return negative frequency? >> > seems to be 1,2,3,4 > > -matti > > > > > 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" > 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" |
Date | 2011-05-23 17:57 |
From | joachim heintz |
Subject | Re: [Csnd] what's wrong with looping? |
Am 23.05.2011 17:15, schrieb Matti Koskinen: > Idea was to wait for a defined time, is there any suspend, sleep or > wait opcode? not an opcode like this, as far as i know, but several ways to do this, for instance: - metro - delayk - timeinsts/timeinstk - simply counting k-cycles see, for instance, http://www.csounds.com/udo/displayOpcode.php?opcode_id=130 joachim 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" |
Date | 2011-05-24 16:42 |
From | Richard Dobson |
Subject | Re: [Csnd] what's wrong with looping? |
Negative frequencies appear very routinely in the lowest bins. The bandwidth even of the lowest bin is symmetrical, like a quasi-bandpass filter - so in the first bin it is +- DC. And of course bins "bunch" together. If you "rectify" the frequencies, you are imposing a phase shift which may or may not matter, YMMV etc. But there is nothing "wrong" with them as such, it is a natural consequence of the pvoc conversion. Richard Dobson On 23/05/2011 16:55, Victor Lazzarini wrote: > yes, I guess that can happen. I would expect the amplitude values to be > quite low. If significant signals are picked up by the lower bins, > pvsanal should produce positive frequency outputs for those bins. > > Victor > > On 23 May 2011, at 16:44, Matti Koskinen wrote: > >> >> On May 23, 2011, at 6:20 PM, Victor Lazzarini wrote: >> >>> which bins return negative frequency? >>> >> seems to be 1,2,3,4 >> >> -matti >> 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" |