Csound Csound-dev Csound-tekno Search About

[Csnd] f-tables: applying something like pdhalf/pdhalfy in realtime

Date2025-10-21 22:19
From"Jeanette C."
Subject[Csnd] f-tables: applying something like pdhalf/pdhalfy in realtime
Hey hey,
I have used pdhalf/pdhalfy to read through f-tables to good effect. However, I 
have one or two applications in mind, where I would like to use something like 
a global pdhalf/pdhalfy to "shape" an f-table and then use several table 
reading opcodes at different speeds to play back the shaped waveforms.

Has anyone done something like that before or can you think of a Csound6 
compatible way to achieve something like that?

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

Date2025-10-31 16:09
FromSteven Yi
SubjectRe: [Csnd] f-tables: applying something like pdhalf/pdhalfy in realtime
Hi Jeanette,

My first thought was using a table for the pdhalf/pdhalfy-like shape
that gets used with an oscili and the audio output of that used as
index to tablei. Could then control the rate of the oscili to deal
with speed of playback; otherwise could write a custom UDO to
transform the source table using a loop, and read through the "phase"
table with tablei, to then read through the source wave with tablei.
pseudo code:

opcode gen_pd_table, i,i
  isource_tab xin
  ilen = ftlen(isourceTab)
  indx init 0
  inew_tab = ftgen(0, 0, ilen, 10, 0)
  while (indx < ilen) do
    iphs = indx / ilen
    ipd_phs = tablei(iphs, gi_phase_table)
    inew_val = tablei(ipd_phs, isource_tab)
    tablew(inew_val, iphs, inew_tab)
    indx += 1
  od

  xout inew_tab
endop

(Haven't tested above, but my thought on the general idea)

Cheers!
Steven

On Tue, Oct 21, 2025 at 5:29 PM Jeanette C.  wrote:
>
> Hey hey,
> I have used pdhalf/pdhalfy to read through f-tables to good effect. However, I
> have one or two applications in mind, where I would like to use something like
> a global pdhalf/pdhalfy to "shape" an f-table and then use several table
> reading opcodes at different speeds to play back the shaped waveforms.
>
> Has anyone done something like that before or can you think of a Csound6
> compatible way to achieve something like that?
>
> 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

Date2025-10-31 17:42
From"Jeanette C."
SubjectRe: [Csnd] f-tables: applying something like pdhalf/pdhalfy in realtime
Hi Steven,
many thanks for your reply and the thoughts. I came to something similar, 
though i wonder now, if it that would reduce CPU usage. Perhaps worth a try 
while monitoring the CPU.

Best wishes,

Jeanette

Oct 31 2025, Steven Yi has written:

> Hi Jeanette,
>
> My first thought was using a table for the pdhalf/pdhalfy-like shape
> that gets used with an oscili and the audio output of that used as
> index to tablei. Could then control the rate of the oscili to deal
> with speed of playback; otherwise could write a custom UDO to
> transform the source table using a loop, and read through the "phase"
> table with tablei, to then read through the source wave with tablei.
> pseudo code:
>
> opcode gen_pd_table, i,i
>  isource_tab xin
>  ilen = ftlen(isourceTab)
>  indx init 0
>  inew_tab = ftgen(0, 0, ilen, 10, 0)
>  while (indx < ilen) do
>    iphs = indx / ilen
>    ipd_phs = tablei(iphs, gi_phase_table)
>    inew_val = tablei(ipd_phs, isource_tab)
>    tablew(inew_val, iphs, inew_tab)
>    indx += 1
>  od
>
>  xout inew_tab
> endop
>
> (Haven't tested above, but my thought on the general idea)
>
> Cheers!
> Steven
>
> On Tue, Oct 21, 2025 at 5:29 PM Jeanette C.  wrote:
>>
>> Hey hey,
>> I have used pdhalf/pdhalfy to read through f-tables to good effect. However, I
>> have one or two applications in mind, where I would like to use something like
>> a global pdhalf/pdhalfy to "shape" an f-table and then use several table
>> reading opcodes at different speeds to play back the shaped waveforms.
>>
>> Has anyone done something like that before or can you think of a Csound6
>> compatible way to achieve something like that?
>>
>> 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
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Don't worry, you're gonna be alright,
But Cinderella's got to go <3
(Britney Spears)

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