Author |
Message |
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Mon Oct 22, 2012 5:50 pm Post subject:
|
|
|
Code for ADC for 2 potentiometers (or CVs) is now working. I used DMA in one-shot mode to reduce both CPU time and RAM used. Only 2 words of RAM are needed, one for each pot value. ADC is working in ALTS mode. No interrupts are required. Each ADC cycle is initiated by a single BSET instruction. Because the DMA controller has registers for 2 channels, these can be set (for two pots) and never touched again. So almost magically, all one needs to do is issue a channel-enable (one BSET) and just wait for the result. If done in a pipelined manner, there is no need to poll any "done" bit (assuming the processing time is longer than it takes the ADC to finish it's work).
I find this a very powerful feature of the dsPIC to be able to use DMA in this manner since the hardware can be doing two things at the same time - crunching the ADC and doing whatever calculations need doing. Note that DMA in a dsPIC does not cycle steal from the CPU because it uses a second port to the SRAM.
This method can be coupled to the DAC interrupt timing and reduce total interrupt push/pop and peripheral maintenance code and associated overhead. Of course, with a bit more overhead more pots could be managed this way. My current project requires only 2.
Note that reading pots is a low intensity need in my synth. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Mon Oct 29, 2012 8:36 pm Post subject:
|
|
|
I've gotten a basic one string Karplus-Strong model to work which can be controlled by 2 pots, one for linear damping and one for low-pass filter Fc. It works quite well and proves the ADC, DAC and SPI code works. This uses a dsPIC running as MIDI controller and voice assigner connected to a dsPIC which runs as a voice engine. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
Cynosure
Site Admin
Joined: Dec 11, 2010 Posts: 966 Location: Toronto, Ontario - Canada
Audio files: 82
|
Posted: Tue Oct 30, 2012 5:04 am Post subject:
|
|
|
How does it sound? got a demo?
What is the next step - fine tuning the sound or adding polyphony? _________________ JacobWatters.com |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
Back to top
|
|
|
Dan Lavin
Joined: Nov 09, 2006 Posts: 649 Location: Spring Lake, Mi, USA
Audio files: 21
|
Posted: Tue Oct 30, 2012 4:21 pm Post subject:
|
|
|
Scott, I think it's only boring if you don't hear the potential there. This is good work! I would agree on the initial pluck being a little digital/click sounding (like the whole thing isn't digital )
Looking forward to further reports! _________________ Synth DIY since 1977! |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Wed Oct 31, 2012 3:54 am Post subject:
|
|
|
Sounds like liftoff to me, great! _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Cynosure
Site Admin
Joined: Dec 11, 2010 Posts: 966 Location: Toronto, Ontario - Canada
Audio files: 82
|
Posted: Wed Oct 31, 2012 5:30 am Post subject:
|
|
|
Wow! That sounds awesome! Great work Scott _________________ JacobWatters.com |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Wed Oct 31, 2012 7:56 am Post subject:
|
|
|
I tried 2 things to eliminate the pop at the start of the sound:
1) random fill - This did nothing to decrease the pop (which I suspected, but I wanted to try it to hear if the randomness would add randomized character to the timbre). Timbre sounded good.
2) Trapezoid excitation pulse. This worked wonders. Only 4 samples from zero to full scale was enough to eliminate the perception of a pop. Because I don't clear the delay line before excitation, the timbre is sufficiently different each time a string is plucked while it is still vibrating. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Fri Nov 02, 2012 8:17 am Post subject:
|
|
|
Instead of a trapezoid pluck pulse, using a single pole lowpass IIR filter and a rectangular pluck pulse to generate the pluck, I was able to eliminate many cycles of execution time. The actual voice generation code uses 296 clocks for four voices at 2x oversample. That means 592 for 8 voices. The total clock count available is 708, so more than 100 are available each sample time for "other stuff" such as dealing with incoming SPI messages, ADC values, pluck pulse start, etc. A 12 voice synth with 2 voice engines (and one more dsPIC for MIDI controller) is looking very possible now. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
sneakthief
Joined: Jul 24, 2006 Posts: 569 Location: Berlin
|
Posted: Fri Nov 02, 2012 8:39 am Post subject:
|
|
|
Keep up the good work, Scott.
I've been following your progress since the beginning and this really shaping up into a great project.
I'm fascinated by the thought of having tiny, discrete hardware synths that I can bring with me during my live performances (weight always being a limiting factor).
FWIW, that's even more voices than my Nord Micromodular can handle when modelling something like this - nice _________________ Sneak-Thief - raw electrofunk |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Fri Nov 02, 2012 8:56 am Post subject:
|
|
|
Thanks sneakthief,
This has been quite a load of fun actually. The dsPIC is a very powerful chip. In fact, since writing my last post, I've reduced the clocks to 256 for 4 voices at 2x oversample. The DSP instructions allow quite a bit of parallelism where several different things are happening within the same clock period. Besides good, clever logic design, the two most important factors in reducing clock overhead are the DSP instructions and the addressing modes. I discovered that I had done addressing arithmetic with discrete add instructions when I could use an addressing mode that auto increments or adds two registers to get an address.
I also have plans to push some things that are being done by the voice engine into the MIDI controller which will lower the clock overhead even more.
And I'm still looking for more ways to reduce the overhead... _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
Back to top
|
|
|
sneakthief
Joined: Jul 24, 2006 Posts: 569 Location: Berlin
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Wed Nov 07, 2012 6:57 am Post subject:
|
|
|
This particular synth needs no display since there is no patch memory. All of the timbre information comes from the 2 pots.
However, if I were to use a display (perhaps in another synth), I'd consider SPI since the dsPIC I'm using has 2 SPI channels and I use only one for interprocessor communication. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Wed Nov 07, 2012 7:01 am Post subject:
|
|
|
The second voice engine dsPIC has been added and wired up. It is currently running a data reliability test with SPI. The SPI (sent from the MIDI controller in master mode) now drives 2 devices and has run for more than 24 hours with no errors. The test sends 32 bit messages, the first 16 bits is a pseudorandom word from an LFSR. The second word is the inversion of the first word. The receiver inverts one word and then compares the two. If the same, the data is considered good.
I've also recently added support for the sustain pedal to the MIDI controller.
Currently, I am working on bringing the synth up to 8 voices. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
cloudscapes
Joined: Feb 09, 2004 Posts: 100 Location: Montreal
|
Posted: Thu Nov 08, 2012 11:35 am Post subject:
|
|
|
holy cow! that last sample sounds amazing! really amazing!
DSP math is way over my head. I doubt I'd be able to produce anything as nice or complex even with a much more powerful micro. I'd brute force and botch it, inevitably.
what a great thread to follow! _________________ Sonic Crayon DIY effects lab |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Thu Nov 08, 2012 4:11 pm Post subject:
|
|
|
Thanks cloudscapes
But wait - there's more ...
I've added a second dsPIC voice engine, done a bit of troubleshooting and now I have an 8 voice DSP harp polysynth using 3 dsPICs. One is a MIDI controller and voice assigner and the other two are 4 string harp voice engines.
The sample provided is a MIDI sequence playing into the harp and I'm noodling the two knobs. The sample is completely dry.
You'll notice around 3:17 it starts to go really flat. That's a consequence of the karplus-strong model. I may throw in a display... - if I did I give it selectable tuning tables.
EDIT ADD:
Part of the technology in the MIDI controller is the re-use of a string if possible. That is, if I play a C and a G and then go back to the same C, that combination uses only two voices because the C is being "re-plucked", like a real harp. This means that for many applications, fairly complex chord rythms can happen with long sustain time with little if any discernable voice theft. This synth does do voice theft, but only as a last resort.
Description: |
|
Filesize: |
229.16 KB |
Viewed: |
392 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
Harpie Voice Engines Board |
|
Filesize: |
140.18 KB |
Viewed: |
377 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
Sorry about the clipping (small amount), the output is a bit too hot, will be addressing that soon. |
|
Download |
Filename: |
dsPIC_Harpie_8_Voice.mp3 |
Filesize: |
3.63 MB |
Downloaded: |
992 Time(s) |
_________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
Last edited by JovianPyx on Thu Nov 08, 2012 5:10 pm; edited 6 times in total |
|
Back to top
|
|
|
audiodef
Joined: Sep 05, 2011 Posts: 726 Location: LFO1
Audio files: 53
|
Posted: Thu Nov 08, 2012 4:17 pm Post subject:
|
|
|
Putting in a post to follow this thread - will listen later. _________________ There's an invisible radio gnome playing a gong from a flying teapot - don't miss out! |
|
Back to top
|
|
|
bubzy
Joined: Oct 27, 2010 Posts: 594 Location: United Kingdom
Audio files: 64
|
Posted: Fri Nov 09, 2012 6:43 am Post subject:
|
|
|
sounding good!
fell asleep a little bit there. _________________ _Richard_ |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Fri Nov 09, 2012 7:15 am Post subject:
|
|
|
That sounds AWESOME. |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Sat Nov 10, 2012 7:31 am Post subject:
|
|
|
So when's the album coming out? |
|
Back to top
|
|
|
ejr27233
Joined: Feb 08, 2010 Posts: 52 Location: UK
|
Posted: Sat Nov 10, 2012 8:12 am Post subject:
|
|
|
You have been paid the ultimate complement....My wife, listening from the next room thought it was a 'real' (ie accoustic) instrument!!
Fantastic project...please keep it up |
|
Back to top
|
|
|
JovianPyx
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Sun Nov 11, 2012 6:28 am Post subject:
|
|
|
Thank you both very much for your kind comments.
As for an album? heh, well, I am building up a collection of stuff, who knows...
And I am most certainly continuing work on this project and others like it. I'm trying to find out just how far I can push these little buggers. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
|
|