electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
Simple DIY dsPIC Project
Post new topic   Reply to topic Moderators: DrJustice
Page 6 of 6 [147 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3, 4, 5, 6
Author Message
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Wed Aug 21, 2013 4:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok... one more... better EQ I think.... anyway, it's the same content, just with some bass boost and treble boost.


10230818_both_4.mp3
 Description:
Ninja Harp and Jovian Floot

Download
 Filename:  10230818_both_4.mp3
 Filesize:  2.03 MB
 Downloaded:  116 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
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Thu Sep 05, 2013 4:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Sun Sep 15, 2013 4:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Sep 20, 2013 1:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Thu Nov 21, 2013 6:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've been busy. I have a dsPIC33F design that is a 4 voice MIDI Karplus-Strong synth with pitch bend.

Here is a sample of it. Pitch bend is programmed for +/- 2 semitones in the sample. I play some 5th stuff with pitch wheel motion, then move up an octave and do it again. Each set of notes uses 3 of the 4 voices available.


fractional_resampled_KS_demo_001.mp3
 Description:
Karplus-Strong with pitch bend demo

Download
 Filename:  fractional_resampled_KS_demo_001.mp3
 Filesize:  654.37 KB
 Downloaded:  101 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
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Nov 22, 2013 9:16 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Nov 22, 2013 3:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

The conversion to 6 voices was successful. The following sample demonstrates polyphony as well as the pitch wheel. This piece is done on one instrument which is built around a single dsPIC IC. No effects were used to process the audio.


fractional_resampled_KS_demo_002.mp3
 Description:
6 Voice Single dsPIC MIDI Karplus-Strong Synth Demo (with pitch wheel)

Download
 Filename:  fractional_resampled_KS_demo_002.mp3
 Filesize:  1.54 MB
 Downloaded:  97 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
Back to top
View user's profile Send private message Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 1516
Location: Chicago
Audio files: 14

PostPosted: Fri Nov 22, 2013 5:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

That sounds awesome Scott Smile
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20678
Location: The Netherlands, Enschede
Audio files: 156
G2 patch files: 318

PostPosted: Fri Nov 22, 2013 7:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

It does!
_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Nov 22, 2013 7:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Another version of the same tune. This time, I added a little bit of reverb and I was twiddling the KS timbre knobs. I also changed the pitch bend table so that above mid point, it moves pitch up by 3 semitones, but below midpoint, it moves pitch down by 2 semitones. I find this more useful than up 2 and down 2. Anyway, have a listen.


fractional_resampled_KS_demo_003.mp3
 Description:
Fractional Resampled KS Demo with timbre knob twiddling and new pitch wheel table.

Download
 Filename:  fractional_resampled_KS_demo_003.mp3
 Filesize:  1.7 MB
 Downloaded:  107 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
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Thu Nov 28, 2013 10:04 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Sep 19, 2014 11:13 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Sep 19, 2014 6:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a sample of my 12 voice Karplus-Strong synth


12_voice_dsPIC_KS_synth.mp3
 Description:
Demo of my 12 voice Karplus-Strong MIDI Synth running on one dsPIC33F

Download
 Filename:  12_voice_dsPIC_KS_synth.mp3
 Filesize:  3.77 MB
 Downloaded:  47 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
Back to top
View user's profile Send private message Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 1516
Location: Chicago
Audio files: 14

PostPosted: Fri Sep 19, 2014 7:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sounds great, Scott!
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Wed Oct 01, 2014 2:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here's another piece done on the 12 voice Karplus-Strong MIDI Synth (single dsPIC).

Processed with Audacity's Gverb.


Resonant_Nebula_gverb.mp3
 Description:
Resonant Nebula

Download
 Filename:  Resonant_Nebula_gverb.mp3
 Filesize:  3.26 MB
 Downloaded:  43 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
Back to top
View user's profile Send private message Visit poster's website
brock



Joined: May 26, 2011
Posts: 96
Location: Canada

PostPosted: Wed Oct 01, 2014 9:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Thu Oct 02, 2014 8:00 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Fri Oct 03, 2014 3:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've managed to add support for pitch wheel (polyphonically). The MIDI controller process still gets 5.625 MIPS of horsepower too. Changing the pitch wheel range requires a different table of values. Currently it supports 3 semitones up and 2 semitones down with no effect when centered.

EDIT ADD: I've added an attachment of a little demo using the pitch wheel. It's just some notes with me playing the pitch wheel badly.


pitch_bend_demo.mp3
 Description:
A Pitch Bend Demo

Download
 Filename:  pitch_bend_demo.mp3
 Filesize:  978.84 KB
 Downloaded:  30 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
Back to top
View user's profile Send private message Visit poster's website
brock



Joined: May 26, 2011
Posts: 96
Location: Canada

PostPosted: Fri Oct 10, 2014 8:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Sat Oct 11, 2014 5:29 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1249
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Sun Oct 12, 2014 5:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

A bit more progress with my 12 Voice Karplus-Strong Single dsPIC Synthesizer board - I've changed the voice theft algorithm to steal the voice with the least amplitude.

Here is a test track I call "Stolen Voices". It's a sequenced track with the note events and pitch wheel events sequenced. However, I "played" mod wheel, CC16, CC17 and CC18 from an Oxygen 8 keyboard while the sequence progressed to demonstrate different timbres and live timbre changes along with pitch bending. The sustain pedal is held down throughout to induce voice theft for testing.

The recording was processed with Audacity's Gverb.


Stolen_Voices.mp3
 Description:
Stolen Voices

Download
 Filename:  Stolen_Voices.mp3
 Filesize:  7.78 MB
 Downloaded:  174 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
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20678
Location: The Netherlands, Enschede
Audio files: 156
G2 patch files: 318

PostPosted: Mon Oct 13, 2014 5:02 am    Post subject: Reply with quote  Mark this post and the followings unread

Sounds good!
_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 6 of 6 [147 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3, 4, 5, 6
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use