Author |
Message |
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: Thu Sep 05, 2013 4:48 pm Post subject:
|
 |
|
I've written a 4 string Karplus-Strong bass synth that will run on the same board as the Floot synth (floot is an additive flute synth).
So far, the project compiles and seems to fit into the chip.
I used the Ninja Harp (Harpie) synth code as a basis for the code for this synth.
To get the octave down I needed, I simply replaced the 4x oversampling code with 2x oversampling.
That freed up clocks needed to run the MIDI controller and voice assigner.
This synth will run at approximately 56 kHz DAC sample rate (112 kHz internal sample rate) _________________ 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: Sun Sep 15, 2013 4:33 pm Post subject:
|
 |
|
The Jovian Floot now has 2 pots connected to it. There are also significant firmware improvements.
One pot controls "air". Air is also controlled by velocity. The other pot controls portamento time. If the portament time is turned to maximum speed, portament is essentially "off".
Here is a demo duet of the new Floot. It was done using the instrument overdubbed onto itself and then reverb was added.
Floot Duet #001
Quote: | This started out as a test of my single dsPIC MIDI synthesizer board.
The instrument used is called Floot, or a Floot.
It is a bastardized additive synthesizer in that there are three sound sources, a high quality sine wave, a distorted sinewave and a high quality sine wave an octave above the other. It might be disqualified as an additive synth except that the distorted sine wavetable is still composed of a sum of other sinewaves. There is no filter in the audio path in this synthesizer.
It uses pretty much all of the dsPIC except for a small amount (about 1 MIP) for the MIDI controller.
The three sound sources are mixed according to performance directives given through velocity and mod wheel. The synth also has controls for portamento and "air".
There is some pitch bending in the piece, this was done via pitchwheel, the synth has a plus or minus one semitone pitchwheel range. The synth is also capable of portamento.
As I played around with the instrument, I decided to record it. Then I laid down another track using the same instrument. Afterward I added the gverb reverb effect. Here is what came out. Sorry - yes, it is essentially mono.
|
Among other things, the Floot mono synth contains:
High Resolution Portamento filter
3 NCO with wavetable outputs
High Quality Noise Source
3 single pole lowpass filters
3 ADSRs
3 NCAs
3 interpolators _________________ 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: Fri Sep 20, 2013 1:16 pm Post subject:
|
 |
|
I've just today finished most of the development of another synthesizer that runs on the same board as the Floot (which uses a single dsPIC for both MIDI controller and voice engine). It is a Karplus-Strong bass synth. 4 strings are implemented.
The voice engine is a modified version of the voice engine code in the Ninja Harp (aka Harpie) which is 8 voices and uses 3 dsPICs. The bass synth operates at one octave below the Ninja Harp.
This demonstrates the power of the dsPIC (at least for my coding) to be capable of about 4 "voices". I use "voices" in quotes because it can mean either 4 polyphonic (but rather simple) voices or 4 "oscillators", "sound generators" or whatever you like to call them. Much depends on the complexity of modulation and other factors, but it seems that a single dsPIC is a viable candidate for a decent sounding small architecture synthesizer. Both the Floot and the Bass utilize most of the dsPIC for voicing and a fraction (something around 1 MIPS) for the MIDI controller. _________________ 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 22, 2013 9:16 am Post subject:
|
 |
|
After counting clock cycles, it appears that there is enough CPU left for an additional 2 strings for a total of 6 strings (in one dsPIC). 6 strings would leave about 10% (4 MIPS of 40) of the CPU for the MIDI controller and voice assigner. This is more than enough processing power. The DAC sample rate is 48.x kHz. _________________ 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
|
|
 |
elmegil

Joined: Mar 20, 2012 Posts: 2179 Location: Chicago
Audio files: 16
|
Posted: Fri Nov 22, 2013 5:26 pm Post subject:
|
 |
|
That sounds awesome Scott  |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24388 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Fri Nov 22, 2013 7:36 pm Post subject:
|
 |
|
It does! _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
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: Thu Nov 28, 2013 10:04 am Post subject:
|
 |
|
I've added a pitch envelope for a more natural sound. As a guitar player, I've noticed that when strings are plucked or pulled with a lot of force, the string will start resonating at a slightly higher pitch than with light force. I am assuming this is because the string is initially stretched before releasing it. _________________ 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: Fri Sep 19, 2014 11:13 am Post subject:
|
 |
|
I haven't updated this in awhile, got a bit distracted with a Zybo board. After getting totally frustrated with that, I decided to give it a rest and go back to some dsPIC stuff.
I've had a 4 voice Karplus-Strong synth for quite some time and I developed a new way to implement the algorithm that uses less RAM and is currently producing 12 voices. It runs on a board powered by a single dsPIC33F IC. The code includes both a MIDI Controller/Voice Assigner and the 12 voice engine.
I will be spending some time to make some demo music and will post when I get that finished. _________________ 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
|
|
 |
elmegil

Joined: Mar 20, 2012 Posts: 2179 Location: Chicago
Audio files: 16
|
Posted: Fri Sep 19, 2014 7:23 pm Post subject:
|
 |
|
Sounds great, Scott! |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
Back to top
|
|
 |
brock

Joined: May 26, 2011 Posts: 112 Location: Canada
|
Posted: Wed Oct 01, 2014 9:42 pm Post subject:
|
 |
|
Wow Scott, I'm impressed. These latest pieces sound great. I have to admit that I have not checked out this thread for a couple of years but just spent 30 minutes listening to a lot of it and I'm impressed. My second thought after "wow, this sounds great" was "is he still giving this away?", and I see you aren't. Good luck with commercializing it. You've done some really good work here. |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Thu Oct 02, 2014 8:00 am Post subject:
|
 |
|
Thank you elmegil and brock for your kind words.
The project has moved through various stages, this was a serious proof of concept and shows that the dsPIC33F is a very powerful microprocessor capable of complex and interesting DSP.
Yes, I do want to try a commercial venture with this and I'm not sure what form or forms it will take.
There are a few tweaks I still need to do to the code including possible pitch wheel action and some changes to how voices are assigned.
Next phase will be to design a PCB and have a few made for testing. We will definately want to offer this as a synth, either as a board or as a completed packaged synth. There will be more than one synth available. We may also want to sell the boards without the programmed dsPIC for other developers to use. The idea here is to produce a low cost board that can be used in many different projects. I am also considering releasing some of the low level code like the device initialization. Note that this would be assembly language because I read that the C compiler does not use any of the DSP instructions which are highly useful in this kind of project. If you code up a filter and compile it, the compiler will use basic instructions instead of the more efficient MAC instruction with it's 40 bit saturating accumulator and prefetch ability. _________________ 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
|
|
 |
brock

Joined: May 26, 2011 Posts: 112 Location: Canada
|
Posted: Fri Oct 10, 2014 8:58 pm Post subject:
|
 |
|
Quote: | Note that this would be assembly language because I read that the C compiler does not use any of the DSP instructions which are highly useful in this kind of project. If you code up a filter and compile it, the compiler will use basic instructions instead of the more efficient MAC instruction with it's 40 bit saturating accumulator and prefetch ability. |
Hi Scott,
Thought I should mention that although the Microchip compiler can't automatically distinguish if it should use the dsp hardware functions when you are writing generic C code, it does have some C callable dsp libraries http://www.microchip.com/SoftwareLib.aspx and you can also access the dsp specific registers/commands directly using macros. Most, if not all are pre-defined. I've been doing a lot of PIC24 work over the past 18 months and while there are a lot of reasons not to like the XC16 compiler I would say dsp support is not one of them. You might want to stay away from versions 1.20 and 1.21 if you decide to look at it. We use XC16 V1.11 and are in the process of evaluating V1.22. On the other hand, I'm mostly an assembly language programmer so I won't tell you not to do what you've been doing.
Brock |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Sat Oct 11, 2014 5:29 am Post subject:
|
 |
|
I wrote one of my first dsPIC synths (monosynth 4 oscillator additive flute model) in C using C30. I didn't use any external libraries, but I did write functions in assembly language that used the DSP instructions.
It works, but I found a few things objectionable. I should mention that I'm a veteran C programmer and enjoy using the language. I wrote the flute model in C as a test to see how far I could push it and in hopes that the code would be more readable than assembly language.
But the C code really didn't seem to be all that "clear" in terms of human readability, I still have to sit there for a while to figure out why I did what I did due to using fixed point arithmetic (because there's no built in fixed point type).
The other thing is that function calls annoy me because of the call overhead (stack stuff, do the real work, unstack stuff). This overhead uses precious cycles in a microprocessor that is fast, but not silly-fast. A "trick" I use in assembly language is to write as much code as I can inline and without any CALL instructions and with as few BRA and GOTOs as possible. This means that most code that could be written as loops is unwrapped into repeated code segments (or macros). This is possible because the Flash in the dsPIC33FJ128 is large. The lack of branches and calls allows the code to run fast enough to provide the 12 voices I get from my current Karplus-Strong technique. It might normally be considered by some as bad coding technique, but it works and it's faster than loop coding. When you have only about 800 clocks per sample time to deal with, you get pretty miserly about using them on things like calls and returns with a lot of stacking. _________________ 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
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24388 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Mon Oct 13, 2014 5:02 am Post subject:
|
 |
|
Sounds good! _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Wed Apr 05, 2017 4:36 pm Post subject:
|
 |
|
This project is alive again. I've played with numerical experiments using a chorus effect on KS strings and I've decide to incorporate it into a KS synth based on the dsPIC33F. In order to do this, I've reduced the voice count to 10 voices. The effect should take a little more than 1 voice time. The rest of the CPU time goes to the MIDI controller to help reduce latency. When I get it working, I will post some sounds. _________________ 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
|
|
 |
jofre
Joined: Sep 03, 2018 Posts: 5 Location: Arizona, USA
|
Posted: Mon Sep 03, 2018 5:34 pm Post subject:
Where is the "DIY" ? |
 |
|
Dear Jovian,
I've found this forum while searching internet to find help on experimenting with dsPIC33 about a couple of years ago with last post from 2014 , now I see in 2017 your are back. Your sound samples are impressive and very nice to be done just with a dsPIC and few external components.
Now with all due respect , I am really disappointed that you basically has put ZERO information, not even basic information on how to accomplish this.
Please, do not misinterpret me , I am not talking about the full source code on something that you has developed and it is your sole property , but a least a few silly lines on making some stupid noise but very valuable as the first steps for any one who wants to dig deeper and continue by itself. Kind of teach the man how to fish... This is what 90% of internet postings are. I did this this way , I share (totally or partially , but not ZERO) and get your comments and opinions.
But is not this thread case at all (only little info on very complicated FPGA stuff), hence the title is completely misleading as it is just you showing off your musical compositions. There is nothing to "
DIY" on these "advertising postings".
I did several projects with dspic and I've posted 100% of the info , again, I am not asking you doing the same , as every person is free to do whatever pleased, but one more time , if you are sharing a "DIY" you should post the basic foundations , otherwise, do not post anything at all or title it kind of look what I did with a dsPIC ... can you beat me doing it better?
Thanks ... JV. |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Mon Sep 03, 2018 6:06 pm Post subject:
|
 |
|
See page 2 in this thread. The zip file is a full project file for MPLAB and includes the commented source code. It demonstrates how to get sound out of the DACs from a DSP process that computes each new sample.
Not sure what else you want. _________________ 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
|
|
 |
|