Csound Csound-dev Csound-tekno Search About

[Csnd] Quasi-Square Wave via F-Table Values

Date2020-10-25 15:38
FromMark Ferguson
Subject[Csnd] Quasi-Square Wave via F-Table Values
Hi all,

I'm messing around with f-table values and various approaches to reading them.

I've got an f-table which only has values (in the range -1 to 1) written to every 10th table location (all other locations have a 0 value). I'm then reading these values with phasor and table/tablei/table3 combinations, but there is always some sort of interpolation involved: even the table opcode seems to 'connect the dots' in a quasi-linear fashion.

What I really want to do create a kind of square wave from these values, without any kind of linear or cubic interpolation: in other words, just have a straight 'jump' or switch to each new value when it happens, and then to remain there until the next one is read.

Does anyone have any suggestions about how to achieve this? I thought the max opcode would be useful for this, in trying to implement a kind of comparator circuit in code.

Maybe there's something very obvious I'm missing, and an easier approach...

Best,
Mark.

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

Date2020-10-25 18:30
Fromjoachim heintz
SubjectRe: [Csnd] Quasi-Square Wave via F-Table Values
hi mark -

i don't think that table interpolates.  can you post your code?

best -
	joachim


On 25/10/2020 16:38, Mark Ferguson wrote:
> Hi all,
> 
> I'm messing around with f-table values and various approaches to reading them.
> 
> I've got an f-table which only has values (in the range -1 to 1) written to every 10th table location (all other locations have a 0 value). I'm then reading these values with phasor and table/tablei/table3 combinations, but there is always some sort of interpolation involved: even the table opcode seems to 'connect the dots' in a quasi-linear fashion.
> 
> What I really want to do create a kind of square wave from these values, without any kind of linear or cubic interpolation: in other words, just have a straight 'jump' or switch to each new value when it happens, and then to remain there until the next one is read.
> 
> Does anyone have any suggestions about how to achieve this? I thought the max opcode would be useful for this, in trying to implement a kind of comparator circuit in code.
> 
> Maybe there's something very obvious I'm missing, and an easier approach...
> 
> Best,
> Mark.
> 
> 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

Date2020-10-25 18:30
FromRory Walsh
SubjectRe: [Csnd] Quasi-Square Wave via F-Table Values
HI Mark. Plain old oscil might help work no?
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