Page 1 of 1

Triangle wave from sin LFO

Posted: Fri Apr 05, 2019 4:07 am
by DrAlx
Here's something I came up with which might be useful if the ramp LFOs are being used for something else.
You can get a good approximation to a triangle wave using this formula

( 1 - abs(sin(t)) ) ^ 0.564476

The power is chosen to give best linearity based on the value at the halfway point.
Due to the limited floating point ranges on the FV-1, I had to slightly tweak the numbers.
Here's the code

Code: Select all

CHO RDAL,SIN0		; Read sin0 LFO value (-1 to +1)
ABSA			; Take absolute value
SOF -0.999,0.999	; ACC = 0.999( 1 - abs(sin(t)) )
LOG 0.564831,0
EXP 1,0			; ACC contains triangle wave (0 to 1)

Re: Triangle wave from sin LFO

Posted: Sun Apr 07, 2019 4:04 am
by igorp
Nice snippet thank you!

Re: Triangle wave from sin LFO

Posted: Sun Apr 07, 2019 9:41 am
by igorp
and this is my typical triangle LFO snippet. 6 lines, but you can use them as much LFOs as you need and use sine LFO for tail smearing
and tempo may be from 1/32Hz to 16kHz

Code: Select all

	ldax rate		; 0x100, for example
	rdax	RRR3 , 1	; drrr3+ rrr3 - counter
	and 	0x3fFFff	; 0 .. 0.5
	wrax RRR3 , 1	; Sawtooth 0..0.5

	sof 	1 , -0.25	; sawtooth -0.25..0.25
	absa			; triangle LFO, double speed 0 .. 0.25

Re: Triangle wave from sin LFO

Posted: Mon Apr 08, 2019 1:17 am
by DrAlx
Thanks for the code snippet.

Re: Triangle wave from sin LFO

Posted: Sat Nov 30, 2019 7:39 am
by gkaiomenos
Hello

Is it possible to incorporate any of these snippets in a simple chorus algorithm like the one below from SpinCAD Designer which has sine LFO??

SKP RUN ,1
WLDS 0,50,64
RDAX POT1,0.0068613000
WRAX SIN0_RANGE,0.0000000000
RDAX POT0,0.1379256360
WRAX SIN0_RATE,0.0000000000
LDAX ADCL
WRA 0,0.0
CHO RDA,0,REG | COMPC,257
CHO RDA,0,0,258
WRAX REG0,0.0000000000
;------ Output
RDAX REG0,1.0000000000
WRAX DACL,0.0000000000

Re: Triangle wave from sin LFO

Posted: Sat Dec 21, 2019 8:31 am
by Digital Larry
To use arbitrary waveforms in pursuit of "chorusey" type things in SpinCAD Designer, use the "Servo Flanger" block. The Chorus blocks use the chorus specific instructions (can't remember them any more... CHO RDA or something) which are hardwired to use one of the SIN/COS LFOs.

Re: Triangle wave from sin LFO

Posted: Fri Dec 27, 2019 11:34 am
by gkaiomenos
Digital Larry wrote: Sat Dec 21, 2019 8:31 am To use arbitrary waveforms in pursuit of "chorusey" type things in SpinCAD Designer, use the "Servo Flanger" block. The Chorus blocks use the chorus specific instructions (can't remember them any more... CHO RDA or something) which are hardwired to use one of the SIN/COS LFOs.
Thank you Larry!

I'm not quite sure how to use the servo flanger block to produce these tones. I tried to connect the Ramp LFO's block triangle output to the delay time control port of the servo flanger block

Is this the correct way to do this?

Re: Triangle wave from sin LFO

Posted: Sun Jan 05, 2020 9:28 pm
by Digital Larry
You'll need to mix the servo delay output with the dry signal to get flanging. You might want to try a phase inversion also.

If you're having trouble hearing anything, turn everything up - delay time, servo gain, LFO width and frequency. You should now be on a merry go round ride from heck. Now turn things down until they sound better.

Re: Triangle wave from sin LFO

Posted: Fri Jan 10, 2020 2:39 am
by gkaiomenos
Thanks again for your help Larry!

Cheers
Digital Larry wrote: Sun Jan 05, 2020 9:28 pm You'll need to mix the servo delay output with the dry signal to get flanging. You might want to try a phase inversion also.

If you're having trouble hearing anything, turn everything up - delay time, servo gain, LFO width and frequency. You should now be on a merry go round ride from heck. Now turn things down until they sound better.