[Csnd] bpf with discrete steps
| Date | 2026-03-18 21:35 |
| From | "Jeanette C." <000015cdd0ffa6cd-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | [Csnd] bpf with discrete steps |
Hey hey,
to prefix: I know that bpf should theoretically do this, but I wondered if
there is an even more straightforward alternative.
I have an input signal kInput and I want to generate kOutput. It should happen
in steps:
if kInput >=0 < ix1: kOutput y1
if kInput >= iX1 < iX2: kOutput y2
...
if kInput >= iXn: kOUtput = yn
This could be done with if and elseif statements or with bpf using two points
at every iX point. Though with bpf, I think, these points should have strict
ordering. A minimal issue though.
Any other ideas? Something in the Csound universe I missed?
Best wishes,
Jeanette
--
* Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
* GitHub: https://github.com/jeanette-c
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 | 2026-03-19 22:48 |
| From | Eduardo Moguillansky |
| Subject | Re: [Csnd] bpf with discrete steps |
Notice that with bpf x points can be repeated for this exact purpose instr 1 kx linseg 1, p3, 5 ky bpf kx, 1, 10, 2, 10, 2, 20, 4, 20, 4, 40 if metro(20) == 1 then println "x: %f, y: %f", kx, ky endif endin On Wed, Mar 18, 2026 at 10:35 PM Jeanette C. <000015cdd0ffa6cd-dmarc-request@listserv.heanet.ie> wrote: Hey hey, |
| Date | 2026-03-20 00:58 |
| From | "Jeanette C." <000015cdd0ffa6cd-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | Re: [Csnd] bpf with discrete steps |
Hi Eduardo,
many thanks for your reply. This does look elegant and efficient enough. bpf
absolutely rocks! Best utility in the past few years!
Best wishes,
Jeanette
Eduardo Moguillansky, Mar 19 2026:
> Notice that with bpf x points can be repeated for this exact purpose
>
> instr 1
> kx linseg 1, p3, 5
> ky bpf kx, 1, 10, 2, 10, 2, 20, 4, 20, 4, 40
> if metro(20) == 1 then
> println "x: %f, y: %f", kx, ky
> endif
> endin
>
>
> On Wed, Mar 18, 2026 at 10:35 PM Jeanette C. <
> 000015cdd0ffa6cd-dmarc-request@listserv.heanet.ie> wrote:
>
>> Hey hey,
>> to prefix: I know that bpf should theoretically do this, but I wondered if
>> there is an even more straightforward alternative.
>>
>> I have an input signal kInput and I want to generate kOutput. It should
>> happen
>> in steps:
>> if kInput >=0 < ix1: kOutput y1
>> if kInput >= iX1 < iX2: kOutput y2
>> ...
>> if kInput >= iXn: kOUtput = yn
>>
>> This could be done with if and elseif statements or with bpf using two
>> points
>> at every iX point. Though with bpf, I think, these points should have
>> strict
>> ordering. A minimal issue though.
>>
>> Any other ideas? Something in the Csound universe I missed?
>>
>> Best wishes,
>>
>> Jeanette
>>
>> --
>> * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>> * GitHub: https://github.com/jeanette-c
>>
>> 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
>
--
* Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
* GitHub: https://github.com/jeanette-c
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 |