Phasing saw waves

Software questions and issues with the FV-1

Moderator: frank

Post Reply
JoepOWOW
Posts: 2
Joined: Thu Sep 24, 2015 1:59 pm

Phasing saw waves

Post by JoepOWOW »

Hi everyone,
I have a beginner question concerning generation of saw waves from the FV-1 so I am sorry if this question is stupid in any way.
I am very new to DSP but I know my way around other coding languages.

First I would like to say that the FV-1 is an incredible chip, I love all the functionalities. Now, I know that using the FV-1 for waveform generation is not intended but still I would like to see whether the following is possible. ;)

Can the FV-1 generate two sawtooth waves at the same time in different phases? (Maybe sending each to a separate dac? So one sawtooth over dacl and one over dacr)

The following is a code that I found on the forum on generating a single sawtooth, it works really nicely. My understanding of the code is that it constantly updates multiple registers to +1 and -1 values to create the sawtooth wave. Am I thinking in the right direction?

Code: Select all

;sawtooth waveform generator 
;goes from 7Hz to 2KHz 
;pot0 - pitch/speed 
;pot1 - volume 
;output from left DAC 

;set up some registers 
equ wave reg0 
equ count reg1 
equ temp reg2 
equ wavetwo reg3
equ counttwo reg4

equ wavestep 16      ;number of steps for wave 
equ countstep 256      ;number of steps for pitch counter 

skp run,START      ;at startup set wave and pitch counters to -1 
clr 
sof 1,-1 
wrax wave,1 
wrax count,0 
wrax wavetwo,1

START: 

skp neg,PITCH      ;check if pitch counter is still negative     
clr         ;if it is skip to pitch counter 
sof 1,-1         ;if it's gone positive/reached zero then 
wrax count,0      ;reset it to -1

ldax wave      ;get the value of wave register    
sof 1,1/wavestep      ;add one step to it 
wrax wave,1      ;write new value back to wave register 
mulx pot1      ;multiply by pot1 
mulx pot1      ;and again, gives a log type volume taper 
wrax dacl,1      ;write volume scaled value to left DAC 


ldax wavetwo      ;get the value of wave register    
sof 1,1/wavestep      ;add one step to it 
wrax wavetwo,1      ;write new value back to wave register 
mulx pot1      ;multiply by pot2 
mulx pot1      ;and again, gives a log type volume taper 
wrax dacr,1      ;write volume scaled value to left DAC 

skp neg,PITCH      ;check if wave is still negative     
clr         ;if it is skip to the pitch counter 
sof 1,-1         ;if it's gone positive/reached zero then 
wrax wave,0      ;reset to -1
wrax wavetwo,0 

PITCH:       
ldax count      ;get value of pitch counter register 
sof 1,1/countstep      ;add one step to it 
wrax count,1      ;write new value back to pitch counter register 

          
         ;all the pot stuff below is to get an anti log type response 
ldax pot0      ;get value of pot0 
sof 1,-1         ;level shift to make it negative 
wrax temp,1      ;write to temp register, keep value in accumulator 
mulx temp      ;multiply by temp register 
wrax temp,1      ;write to temp register, keep value in accumulator 
mulx temp      ;multiply by temp again 
sof -1,0.999      ;invert and level shift to make it positive 

rdax count,1      ;add scaled pot value to pitch counter 

Can anyone tell me whether or not it is possible to basically "double" this process and create a second sawtooth wave? (They can actually also be other waves, as long as the FV-1 is outputting multiple waves at the same time.)

Again, very new to this but also very eager to learn :)
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Using the FV-1 for generating waveforms is fine just not wavetable based ones. As long as you can define an equation/algorithm for the wave form it is usually no problem.

You can do what you did in the code, output on both channels and yes it basically is a ramp generated by incrementing a register and when it hits some value then reset the register.
Frank Thomson
Experimental Noize
JoepOWOW
Posts: 2
Joined: Thu Sep 24, 2015 1:59 pm

Post by JoepOWOW »

Thank you for your response frank! :)
Great community you got here.
Post Reply