General

Waveform formulae for signalscope

Started by dc_Sux on .

Sign in or create an account to join the conversation.

4 posts

Topic starter
This is a purely cosmetic thing, but I was hoping to program different signalscopes to display sine, sawtooth, reverse sawtooth, triangle and square waves, depending on what was selected for my oscillators/LFOs etc.

Trigonometry isn't exactly my strong point. I can get it to display a scrolling sine wave using the formula:

x=time%1
y=0.5+sin(time)*0.5
timebase=10

Anyone got any clue how I can get it to display these other waveforms?

I'd also like to be able to change the frequency depending on the individual tuning of the oscillators.

Any help on how to do this would be greatly appreciated.
Trig is a struggle point for me, but I can read code.
So I adapted some cpp code to get a triangle waveform:
asin(sin(time%1*3.14159+(time%1/10000)))/1.568
anyone have a better way to get a Tri?

dc_Sux wrote:This is a purely cosmetic thing, but I was hoping to program different signalscopes to display sine, sawtooth, reverse sawtooth, triangle and square waves, depending on what was selected for my oscillators/LFOs etc.

Trigonometry isn't exactly my strong point. I can get it to display a scrolling sine wave using the formula:

x=time%1
y=0.5+sin(time)*0.5
timebase=10

Anyone got any clue how I can get it to display these other waveforms?

I'd also like to be able to change the frequency depending on the individual tuning of the oscillators.

Any help on how to do this would be greatly appreciated.