8-bit waveform generator??

Algorithm development and general DSP issues

Moderator: frank

soundsubs
Posts: 24
Joined: Fri Feb 25, 2011 11:49 am

Post by soundsubs »

i think i get what youre saying: youre saying im a genius for figuring this out without a 101 type tutorial! thanks!

but seriously: if this can do sine waves and sawtooth waves digitally, i think it can do single cycle waveforms too. its just a matter of figuring it out; this is part of the reason i started this thread with "8 bit" because thats a step in the right direction, imho

correct me if im wrong. im learning as i type.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Well, you gotta be smart (and a bit crazy) to even want to deal with this stuff, and a few people have gone from 0 to full on programming in a very short time (just ask Taylor) but it is best to have a basic understanding of microcontrollers and assembly language programming to start with, 8051 or PIC series are probably the best.

Also, as I stated before, the FV-1 is not designed for wavetable synthesis. When it creates sine or triangle or sawtooth waves it is doing so typically based on an equation that was coded for the FV-1 and simply repeats forever. An arbitrary waveform may not have an equation that describes it and as such it is not really suitable for the FV-1.
Frank Thomson
Experimental Noize
Plantiforge
Posts: 2
Joined: Fri Mar 18, 2011 3:07 am

Post by Plantiforge »

Hi, I'm new there and not realy used to forums ethics,
I learned things reading this thread and I want to mirror to my reply in the "synth" topic, because "we/are/ family ! " 8) :lol: :) :o :P :roll: :wink:=>:idea:
Is that a spam ?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

It is not spam, while we want to keep threads on topic it can be good to reference a similar thread rather than copy information that already exists.
Frank Thomson
Experimental Noize
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

Here's a simple sawtooth generator, there's probably much better ways to do it, but it works Ok. If you wanted you can use the saw to generate other waveforms, rectify it to get a triangle, clip this to get a sine, compare it to something to get a square/pulse wave. Messing with the "steps" changes the maximum and minimum frequencies, it can go down to LFO speeds if you want.
On it's own it's a complete waste of the FV-1 because you can do the same thing better using a PIC, might be useful as part of a larger project though. If you mulx the waveform with audio it makes a reasonable aliaser or fake ringmod.

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 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

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

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

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
Post Reply