FpgaSynth
From Theover
An Fpga is a Field Programmable Gate Array chip which can be programmed with all kinds of digital (like computer) designs, and audio synthesis is, well, like those machines with all the knobs to make sounds and music with.
There is another Fpgasynth site ([1]), with a mailing list, of which I´ve used the most prominent Open Source design from Scott Gravenhorst ([2]) myself, and have made small improvements and an sound editor for:
See http://www.theover.org/Fpgasynth.
Since the fpgasynth wiki is not a real wiki which can be added to and edited by interested peers, this place wants to offer that possibility about the subject, and a few more subjects. So feel free to add a page or comments about subjects you feel are related.
--WikiSysop 00:19, 6 April 2009 (CEST)
A piece of the waveforms of the mopho_basses.mp3 (see [3]).
My own DSP based analog emulation synth (see [4]) waveforms from one channel a little piece from a demo I made years ago (see []). This IIRC was an analog recording from the outputs of the DSP board 24 bit DA converter to a PC.
A sample from sawstring5 from subzynaddfx (a Linux synthesizer program),this is the audio file [5].
I'm going to make a bit of a software simulation for digital signal processing algorithms, aimed at C and Linux with Jack and Alsa-midi, because I happen to have a program laying around for the purpose of mathematical formula rendering, which also connects with such and running jack as root makes it fairly well behaved so that sine waves in 32 bit floating point sound excellent on the 24 bit Lexicon DA converter I use and my big audio system.
I've used this source from the internet [6] which I adapted for the mathematical waves program. There is an external definition of the main audio function in a fortran function, but now I use a similar C function which computes the wave value for a certain time x in seconds:
/* A simple routine for making samples from a x time value
* the result between -1 and 1 is in r, v is the velocity
* of the key between 0 and 1. Computations are done in doubles.
*/
#include <math.h>
void sayhello_(x,r,v)
double *x,*r,*v;
{
*r = *v * sin(*x*2*3.1415926535*440);
}
In this case a sine function of 440 herz at central A. The x variable gets scaled by the main program. To compile:
gcc -O3 -o simple synth.c simple.c -lasound -ljack
Make sure you have jack-dev and alsa-dev packages installed (I work on Fedora 8/64 or 9/64(dual core) or 9(32, dual core) which all work fine). The resulting program ./simple can be run with these parameters (the second is polyphony)
./simple 0 16 1.0 0.00 0.3 0.1 0.4 0.6 .2 0.3 0.3 0.4 0.5 0.2 0.1 &
and then the Jack audio connection and the Alsa midi connection can be found in the QJackctl program, if you use that, and a program like vkeybd or of course a midi connection can be used to play the sound.
I want to start by adapting sayhello_ to do simulation waves.
As a start here are the | bwise commands
newproc {} osc1 freq o 40 {} {} 100 100
newproc {} osc2 freq o 40 {} {} 100 200
newproc {} osc3 freq o 40 {} {} 100 300
newproc {} osc4 freq o 40 {} {} 100 400
newproc {} mix {i1 i2 i3 i4} o 40 {} {} 200 100
newproc {} vcf {i freq} o 40 {} {} 300 100
newproc {} vca {i cv} o 40 {} {} 400 100
newproc {} vol i o 40 {} {} 500 100
connect wire0 osc1 o mix i1
connect wire1 osc2 o mix i2
connect wire2 osc3 o mix i3
connect wire3 osc4 o mix i4
connect wire4 mix o vcf i
connect wire5 vcf o vca i
connect wire6 vca o vol i
to create the following schematic sound signal flow with real time (non-static) control inputs:
From the hdl code from Scott, these figures (please edit):
freq accuracy ? bits phase accumulation (in osc*) 33 bits osc* output 18 bits vcf input 12 bits vcf output 18 bits vca signal path 18 bits volume out 12 bits as presented to the 12 bit DAC
- (SRG) There are several subversions of the GateManPoly synth, most of those differences are due to the different DACs that have been used. Specifically, the S-3Esk (Spartan-3E Starter Kit) has an on-board 12 bit DAC capable of 1.0 MHz sample rate. Other subversions have used a Cirrus CS4344 DAC which is 24 bit (delta-sigma) with a maximum sample rate of 200 KHz. The designs for the Cirrus DAC expand the final signal output to an effective 18 bits.
- (SRG) not certain what is needed for "freq accuracy", the phase accumulator register is unsigned 33 bits. The phase accumulator is expected to simply wrap on overflow. I would view the "accuracy" to be 33 bits, but this doesn't account for the smallest possible actual phase increment value that the synth will use with the lowest possible pitch.
- (SRG) Also, I believe that the oscillator output is 18 bits, not 14 bits since all of the waveform outputs are 18 bit. The 4 NCOs are summed into a 21 bit register. Truncation to 12 bits is done just before sending the output to the DAC. This allows intermediate arithmetic operations to be carried out without losing precision until necessary (for the DAC). Such truncation is not performed when using the Cirrus DAC.
Next: filter and env generators, frequency table (in same accuracy, or first mathematical to start with), and C code blocks.





