[Csnd] Is it possible to have audio-rate loops ?
| Date | 2019-09-12 16:12 |
| From | Bernard Geyer |
| Subject | [Csnd] Is it possible to have audio-rate loops ? |
I have many lines like this in my code:
abp[0] reson aSig, givocFreqs[0], kBandWidth, 1
abp[1] reson aSig, givocFreqs[1], kBandWidth, 1
abp[2] reson aSig, givocFreqs[2], kBandWidth, 1
abp[3] reson aSig, givocFreqs[3], kBandWidth, 1
abp[4] reson aSig, givocFreqs[4], kBandWidth, 1
abp[5] reson aSig, givocFreqs[5], kBandWidth, 1
abp[6] reson aSig, givocFreqs[6], kBandWidth, 1
abp[7] reson aSig, givocFreqs[7], kBandWidth, 1
abp[8] reson aSig, givocFreqs[8], kBandWidth, 1
abp[9] reson aSig, givocFreqs[9], kBandWidth, 1
abp[10] reson aSig, givocFreqs[10], kBandWidth, 1
abp[11] reson aSig, givocFreqs[11], kBandWidth, 1
abp[12] reson aSig, givocFreqs[12], kBandWidth, 1
abp[13] reson aSig, givocFreqs[13], kBandWidth, 1
abp[14] reson aSig, givocFreqs[14], kBandWidth, 1
abp[15] reson aSig, givocFreqs[15], kBandWidth, 1
I would like to do something like that, but of course, it does not work with
arate variables:
aInd = 0
abpLoop:
abp[aInd] reson aSig, givocFreqs[aInd], kBandWidth, 1
loop_lt aInd, 1, giMaxBuses, abpLoop
Does some solutions exist for this kind of stuff, maybe with an UDO ?
Best,
Bernard
--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-09-12 16:12 |
| From | john |
| Subject | Re: [Csnd] Is it possible to have audio-rate loops ? |
1: you do not need anaudio variable as an aray index but a kvar
2: The look has only one reson with internal state while our written
out code has 16 rson filters.
The usual advice is a recursive UDO
On Thu, 12 Sep 2019, Bernard Geyer
wrote:
> I have many lines like this in my code:
> abp[0] reson aSig, givocFreqs[0], kBandWidth, 1
> abp[1] reson aSig, givocFreqs[1], kBandWidth, 1
> abp[2] reson aSig, givocFreqs[2], kBandWidth, 1
> abp[3] reson aSig, givocFreqs[3], kBandWidth, 1
>
> abp[4] reson aSig, givocFreqs[4], kBandWidth, 1
> abp[5] reson aSig, givocFreqs[5], kBandWidth, 1
> abp[6] reson aSig, givocFreqs[6], kBandWidth, 1
> abp[7] reson aSig, givocFreqs[7], kBandWidth, 1
>
> abp[8] reson aSig, givocFreqs[8], kBandWidth, 1
> abp[9] reson aSig, givocFreqs[9], kBandWidth, 1
> abp[10] reson aSig, givocFreqs[10], kBandWidth, 1
> abp[11] reson aSig, givocFreqs[11], kBandWidth, 1
>
> abp[12] reson aSig, givocFreqs[12], kBandWidth, 1
> abp[13] reson aSig, givocFreqs[13], kBandWidth, 1
> abp[14] reson aSig, givocFreqs[14], kBandWidth, 1
> abp[15] reson aSig, givocFreqs[15], kBandWidth, 1
>
> I would like to do something like that, but of course, it does not work with
> arate variables:
> aInd = 0
> abpLoop:
> abp[aInd] reson aSig, givocFreqs[aInd], kBandWidth, 1
> loop_lt aInd, 1, giMaxBuses, abpLoop
>
> Does some solutions exist for this kind of stuff, maybe with an UDO ?
>
> Best,
> Bernard
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-09-12 16:41 |
| From | Bernard Geyer |
| Subject | Re: [Csnd] Is it possible to have audio-rate loops ? |
I tried first using kInd instead of aInd, but i got distortions.
--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-09-12 17:02 |
| From | john |
| Subject | Re: [Csnd] Is it possible to have audio-rate loops ? |
The distortions probably came from using the single filter 16 times
rather thar 16 different filters.
Use a recursive UDO and a kvar
On Thu, 12 Sep 2019, Bernard Geyer wrote:
> I tried first using kInd instead of aInd, but i got distortions.
>
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-09-12 17:52 |
| From | Eduardo Moguillansky |
| Subject | Re: [Csnd] Is it possible to have audio-rate loops ? |
You have an array of frequencies givocFreqs and need a bandpass filter
for each frequency, storing all these bands in an audio array, right?.
The "poly" opcode is exactly for this.
https://csound-plugins.github.io/csound-plugins/opcodes/poly.html
inum lenarray givocFreqs
abp[] poly inum, "reson", givocFreqs, kBandWidth, 1
; now you can do anything you want with abp
asum sumarray abp
asum *= 0.1
outs asum, asum
eduardo
On 12.09.19 17:12, Bernard Geyer wrote:
> I have many lines like this in my code:
> abp[0] reson aSig, givocFreqs[0], kBandWidth, 1
> abp[1] reson aSig, givocFreqs[1], kBandWidth, 1
> abp[2] reson aSig, givocFreqs[2], kBandWidth, 1
> abp[3] reson aSig, givocFreqs[3], kBandWidth, 1
>
> abp[4] reson aSig, givocFreqs[4], kBandWidth, 1
> abp[5] reson aSig, givocFreqs[5], kBandWidth, 1
> abp[6] reson aSig, givocFreqs[6], kBandWidth, 1
> abp[7] reson aSig, givocFreqs[7], kBandWidth, 1
>
> abp[8] reson aSig, givocFreqs[8], kBandWidth, 1
> abp[9] reson aSig, givocFreqs[9], kBandWidth, 1
> abp[10] reson aSig, givocFreqs[10], kBandWidth, 1
> abp[11] reson aSig, givocFreqs[11], kBandWidth, 1
>
> abp[12] reson aSig, givocFreqs[12], kBandWidth, 1
> abp[13] reson aSig, givocFreqs[13], kBandWidth, 1
> abp[14] reson aSig, givocFreqs[14], kBandWidth, 1
> abp[15] reson aSig, givocFreqs[15], kBandWidth, 1
>
> I would like to do something like that, but of course, it does not work with
> arate variables:
> aInd = 0
> abpLoop:
> abp[aInd] reson aSig, givocFreqs[aInd], kBandWidth, 1
> loop_lt aInd, 1, giMaxBuses, abpLoop
>
> Does some solutions exist for this kind of stuff, maybe with an UDO ?
>
> Best,
> Bernard
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-09-12 20:18 |
| From | joachim heintz |
| Subject | Re: [Csnd] Is it possible to have audio-rate loops ? |
yes this is the nicest way to do the job. without the poly plugin, you can use a recursive udo: |