Hello everyone,
I wrote a small and simple 3-voice synthesizer engine in Algebraic Assembly using CCS4.2.
I have attached a CCS4 project. The code is commented.
Currently, it gets note values from notes.inc, converts from ascii to a proper interval using interval.inc, looks up pitch to the corresponding note in pitch.inc, and pulls waveform values from sine.inc.
Timers 0,1, and 2 control the frequency of the wave playback, and DMA 0,1, and 2 are used to move the wave values into memory.
There is a single main routine, driven by the interrupt rate of I2S0 (corresponding to the AIC sample rate, which is 48khz) which sums up the 3 voices, applies a crude linear envelope generator to each voice, and then feeds the results to the AIC.
Is there a way to also apply a variable low-pass filter (12db/octave and frequency range of about 40-5000 hz) to the resultant waveforms?
I have never seen code for a variable LPF before. It is always fixed LPF. The only idea i can think of is to use lookup tables with coefficients generated from 40 - 5000 hz stepped at some reasonable rate to balance resolution with the overall table size.
Does anyone have any thoughts or ideas on a simpler way to implement a variable LPF?
Thanks!!
Chris
2318.SynthPlay.zip
Hi,
This sounds more looking for an algorithm or ideas on variable LPF. I wish some one post something useful here.
Regards,
Hyun
---------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.
Check out these great resources
http://processors.wiki.ti.com/index.php/Category:C5000---------------------------------------------------------------------------------------------------------
In my opinion, window method is good option to implement variable filter. If you need to use IIR filter, LUT might be a good option. But, if FIR filter is enough for you, use window method. It will allow you to tune filter for ANY frequency. Use formulas for different types of filters (LP,HP,BP,BR) and write function which will take certain frequency and filter type as input, and will generate filter coefficients.Using fixed kernel length is handy, but if your filtering code is flexible enough, you can also use coefficients amount as input parameter.
regards
MS
Yes, I think FIR with window will work fine. I only need a LowPass Filter. It looks like I will be generating a table of coefficients from 40 thru 6000 hz (I was hoping to avoid this, since it will sound grainy when I step thru the tables using an EG).
Here is a more recent version of my code, which adds some more nice features and better commenting.
Thanks to all!!
6562.C5515 synth.zip
If you want to avoid using predefined coefficients table, then don't use it. I've pointed very easy way to generate coefficients in the fly.
Here is the same code, adjusted to work on the C5535 eZdsp usb stick. Had to change to i2s2 from i2s0, and use dma1 instead of dma0.
4034.workspace_091811.zip
Here is the same code, adjusted to work on the C5535 eZdsp usb stick, and an added MIDI interface, so that the synth engine can be controlled by an external keyboard. Bring your own MIDI interface to the UART. I just used a standard 6N137 circuit, and tapped right into the eZdsp's card edge connector (i know, living dangerously...hehehe).8816.midisynth.zip
I don't see any source code-- can you post that as well?
Since this code was written in algebraic assembly language, the main source code is contained within vectors.asm, and all of the include files in the INC directory.
I can't continue working with this code, because to this day I still have not come up with a workable solution for a variable filter. I only see that in floating-point DSPs, and they are all out of my price range.