electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
PIC-based fraktal synth
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 8 [195 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2, 3, ..., 6, 7, 8 Next
Author Message
Joel



Joined: Sep 12, 2006
Posts: 97
Location: London, UK

PostPosted: Mon Apr 07, 2008 10:21 am    Post subject: PIC-based fraktal synth Reply with quote  Mark this post and the followings unread

Hi all,

over on circuitbenders.co.uk there's an interesting thread developing about a diy synth using a 18f4620 PIC microcontroller and various algorithms that appear to use fractal maths to generate the patterns.... anyway never mind how it does it, just listen to the samples at http://etecnic.fh-pforzheim.de/~catweazle/F-Synth/ (and more via the thread) and be amazed!! Plus keep watching the thread, as development seems to be ongoing....

Joel
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Mon Apr 07, 2008 4:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Joel,

Wow, this is really an interesting thread and I like the psychotic sounds this synthesizer makes also !! The "FM Techno" tune is very cool ... I like the 18F4xxx chips. They are cheap and fairly powerful as one can tell by the samples !! I guess it would not be hard to synchronize it to some external source by patching over the parameter pots and using an external LFO (be wary of the voltages) to modulate some of sounds ... Wink The external patched LFO's can be rectified and attenuated if need be.

Thanks.
Bill
Back to top
View user's profile Send private message Send e-mail
ian-s



Joined: Apr 01, 2004
Posts: 2669
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 626

PostPosted: Mon Apr 07, 2008 5:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

I am embarrassed to say that I can't work out what is going on here. I followed the link to the explanation but it seemed to explain very little.

Is it a pseudo-random (or less than random) number generator? I can't seem to grasp what the basic idea is. scratch
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Mon Apr 07, 2008 5:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Is it a pseudo-random (or less than random) number generator? I can't seem to grasp what the basic idea is.


This is about as technical as it got but you get an idea of what some of his methods are:

Quote:
- Two fractal based "music" generators ("predictive digital music synthesizer", it's not random!)
- Step-sequencer (8 steps) with FM(frequency modulation) tone generation
- Cellular Automata (1 dimensional, see "game of life", "critterandguitari")


If you understand "C" coding, he offers the source code in one of his entries. He used the CCS "C" Compiler. This a popular, cheap, compiler that works well. Hopefully his code is well documented with comments sp you probably want to take a peek at that if your inetrested enough Wink

The Game of Life stuff is really cool and the algorithms result can be used to generate control data for a particular parameter of a sound such as FM Index or something like that.

The bottom line here is, it sound cool !!! Cool

Bill
Back to top
View user's profile Send private message Send e-mail
Joel



Joined: Sep 12, 2006
Posts: 97
Location: London, UK

PostPosted: Wed Apr 09, 2008 4:06 am    Post subject: Reply with quote  Mark this post and the followings unread

I did get hold of the code from the author and there's a bit of commenting but it didn't get me that far to be honest Embarassed Although I might have a play with the "user interface" side of things if I get a chance!

State Machine wrote:
The bottom line here is, it sound cool !!! Cool


My feelings exactly!!
Back to top
View user's profile Send private message
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Wed Apr 09, 2008 10:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Fellow Builders,

I am definitely building this as soon as the PICs arrive! I have a costume party/rave to go to in a few weeks, and needed a small, battery-powered synth to take as part of my costume ("The Oscillator," a synth-themed superhero). Should be fun.

I'll report here on my experiences with the circuit. I've also successfully built a couple of the Electric Druid PIC-based designs, and will post my boards and notes in the other thread as soon as I can put it into a form that makes sense to someone other than me.

Thanks,

Ole
Back to top
View user's profile Send private message
Joel



Joined: Sep 12, 2006
Posts: 97
Location: London, UK

PostPosted: Wed Apr 09, 2008 1:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

okvern wrote:
"The Oscillator," a synth-themed superhero


If we don't get to see some photos of this outfit, I will feel VERY let down Wink
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Wed Apr 09, 2008 4:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hello everyone!

I've developed that thing with the intention to have a versataile
simple lofi audio hardware to realize some unusual sounds.

Hardware:
- a cheap (yes, samples) 8bit microcontroller to be real lofi Smile
- 8 analog inputs / pots for parameters (CV in 0..5Volt)
- 1 analog output (Pulse with modulation) / audio out
(output is not filtered very well, add additional Filter / EQ + FX)

Software:
(sourcecode is available) http://etecnic.fh-pforzheim.de/~catweazle/F-Synth/

Documentation:
Ok, sourcecode could have more comments Embarassed
ask if questions

however it really makes crazy sounds Wink
and I'm very interested of your experiences (pics/sounds) ...

gtz
Eric

Edit:
use this schematic if you build it
http://etecnic.fh-pforzheim.de/~catweazle/F-Synth/PICsynth_V11_schematic.JPG
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Wed Apr 09, 2008 4:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome Eric,

I once tried to make some sounds on a pic 12 and was not very impressed by myself then. This is diferent, you did some cool stuff there Cool

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Wed Apr 09, 2008 5:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Hello everyone!

I've developed that thing with the intention to have a versataile
simple lofi audio hardware to realize some unusual sounds.


First, welcome to the forum !!! Very Happy Glad you posted here and secondly, I ordered 3 samples of this MCU from Microchip and will definitely put one together. It's a quick build and I really do like the concept of this synthesizer. Sometimes things like this are just plain fun ! I suppose along these same lines of fractal and randomized approaches to sound design, some "granular" synthesis techniques can be added to your device ..... Wink

Perhaps if you can, you can talk a bit about more of the technical details of your code or talk a about about the "patches" or modes you have created for this device ...

Bill
Back to top
View user's profile Send private message Send e-mail
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Wed Apr 09, 2008 5:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
I once tried to make some sounds on a pic 12 and was not very impressed by myself then.


Well Jan, I would say without hesitation, that if you had a more powerful processor than the 12x and spent more time, I am most sure yours would be cranking out the cool sounds also !! Cool Wink

Bill
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Wed Apr 09, 2008 5:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

State Machine wrote:
I am most sure yours would be cranking out the cool sounds also !! Cool Wink


My boss wanted a "more interesting" beeper ... and he got that ... but 58 ct was too expensive ... or maybe it was too interesting Laughing

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Wed Apr 09, 2008 6:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

ok, where to begin?

User interface (pots)

Potentiometers / analog inputs:
1 =select Synth (1..x) -> "DSP_xxx"
2 =speed/pitch
3..8 = DSP/Synth parameters (depending on selected synth)

Play/Stop switch
Forward/Reverse switch
LED display showing selected synth / synth parameter

Synth 1: "fraktal synth"
16bit counter, hi and lo byte is multiplied/xored ...
results in some sort of sirpinsky triangle (known in chaos theory)
(parameters are not from this earth Wink

Synth 2: "fraktal synth"
same as Synth1 but different math

Synth 3: "sequencer"
8 step stepsequencer with 2 oscillator FM synth
Paramters:
3 = select step 1..8
4 = pitch for step
5 = vol envelope
6 = pitch envelope
7 = osc A pitch
8 = osc B pitch

Synth 4: "WSG"
inspired by the MFOS WSG wired sound generator
FM and AM modulation

Code:
I've tried to greate a simple framework sort of a plugin system.
"PICsynth" is the main entry point, inits the uC and calls the application
"APP task".
The "application" manages the user inputs and calls the "DSP_Alg" functions according to a software timer (maybe this should be done with the hardware timers but I don't want to use interupts.
"api" gets the analog inputs and puts out PWM sound.
The sound is created in the "DSP_xx_Alg" function

Cellular automata (1 dimensional) code is there but not included in
the application, should be worked out more.
Taken from www.critterandguitari.com/

There is a lot of room left in the uC ...
much more synths can be added. Since the framework is there
only the "DSP_xxx" sound calculation has to be created.
Maybe some of you get interested in writing some synth-plugins.
So not much C programming knowledge is needed (only the math).

thanks Joel for mailing me and the positive feedback!
Back to top
View user's profile Send private message
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Thu Apr 10, 2008 5:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Eric, Fellow Builders,

The PICs were on my doorstep when I got home. I breadboarded the circuit, programmed it with my PICkit2, and...it works.

Eric, my hat is off to you--this is a very cool little synth. Some amazing and quite insane sounds are possible. My neighbor came downstairs to see if something was wrong with the washing machine.Smile Thanks for sharing it with the synth DIY community!

I'll have pictures and (maybe) sounds once I get it onto a board and into an enclosure--the plan is to wear it/play it on my chest.

Thanks again,

Ole
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Fri Apr 11, 2008 12:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Hi Eric, Fellow Builders,

The PICs were on my doorstep when I got home. I breadboarded the circuit, programmed it with my PICkit2, and...it works.


Cool Cool Cool I should be getting 3 chips by next week I hope !! Very Happy

Bill
Back to top
View user's profile Send private message Send e-mail
volare



Joined: Jul 31, 2006
Posts: 6
Location: Portland, OR USA

PostPosted: Fri Apr 11, 2008 1:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have 3 chips ordered from Microchip. They shipped so I'll have them by
4/14. Look like it will be a fun project, And it does sound Cool .

Dave
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Sat Apr 12, 2008 12:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow, maybe if enough "plug-ins" or "patches" are developed, the 7 segment LED display may need to be replaced with a small alpha-numeric LCD display to show patch names and other information instead of a criptic display on the LED's ... Very Happy Very Happy I realize this started as a small project but it seems it has room to grow Cool

I see that a serial pin is available on the MCU, seems a good place to hang a serial LCD of some type off this?? Not a very expensive one. Maybe 2 x 20 is all that may be needed.

Bill
Back to top
View user's profile Send private message Send e-mail
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Sat Apr 12, 2008 3:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm glad you got it working Ole.
Quote:
neighbor came downstairs to see if something was wrong with the washing machine
Very Happy

yes, that would be cool if a little "open source community" evolves,
sharing patches/plugins (or whatever we call them)

The UART (serial port Rx/Tx, also usable for MIDI Wink
and SPI-/I2C-Bus pins are free for use. Connecting
a SPI EEPROM 25LCxx or MMC/SD card if a lot memory is needed.
2 analog input ports are free for use, too. one word: audio input...

I've choosen the LED display because of easy/cheapness and it needs very little performance to interface (compared to an LCD).

allways remember:
the PIC is no PC nor DSP, all should be kept as simple as possible.

One word (or more) about the programming language choosen
Why C ? - Assembly is much more efficent.

- code is readable and can be understood a few years later
- structurized code (not "sphagetti code" with a lot of jumps and gotos)
- much more faster development (idea to algorithm)
- coding a PIC in assembly is not funny
- porting algorithms to other microcontrollers (code recycling)

if much more performance is needed better choose a faster controller
like ARM, Propeller, PIC32, DSP ... Nintendo GBA/DS, PSP, PocketPC ...

but inline assembly packed in a C function is a good idea to
gain maximum performance out of an time critical part of a
synth plugin.

in the moment the PIC is running with the internal oscillator (32MHz),
I had overclocked a PIC up to 100MHz (factor 2.5 , 40MHz is normal)
and it worked Cool
but this is not recommended because some of the internal periphericals (RAM...) cannot operate at that clock rate, missfunctions occur ...
Maximum clockrate may vary from device, temperature, shielding...
but that can be very interessting thinking of circuitbending.
Errors can be very musical Wink
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Sat Apr 12, 2008 4:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

...


PICsynth.JPG
 Description:
 Filesize:  18.6 KB
 Viewed:  53140 Time(s)

PICsynth.JPG



Last edited by catweazle on Mon Jun 23, 2008 3:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Joel



Joined: Sep 12, 2006
Posts: 97
Location: London, UK

PostPosted: Sun Apr 13, 2008 11:29 am    Post subject: Reply with quote  Mark this post and the followings unread

hi all,

I put this together this afternoon, sounds great!!

One issue: the sequencer program (#3) didn't work at all - all I got was a series of rhythmic clicks, no tones? I bought a couple of 18f4620s from ebay but the wonderful royal mail mislaid them so the guy sent me an 18f4520 and 18f4685 instead. I've tried each (recompiling the code with the appropriate header in each case, and for the 4520 removing a couple of unused variables as it said there wasn't enough ram) and get the same problem on both.

Anyone had a similar problem?

Joel
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Sun Apr 13, 2008 1:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

In the "Application.c" a 2kByte Buffer is allocated (array), this is not needed yet. You can of course delete this lines or comment them out if another PIC is used.

Code:
#define BUFFER_SIZE   2047
int8    BUFFER[BUFFER_SIZE+1];


Sequencer usage:
If you change the Step-number pot, the Step-value pot is locked.
To unlock it you have to fetch the old value with the Step-value pot.
Turn pot from left to right (or in the other direction).
If the pot-value and the stored value (old value at the selected step)
are the same the Step-value is unlocked and the Step-value-pot
changes now the selected step value.

Be sure if you use another PIC that it has a internal 8MHz oscillator.
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Sun Apr 13, 2008 2:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
allways remember:
the PIC is no PC nor DSP, all should be kept as simple as possible.


Sure, agree there ! Very Happy

Quote:
One word (or more) about the programming language choosen
Why C ? - Assembly is much more efficent.

- code is readable and can be understood a few years later
- structurized code (not "sphagetti code" with a lot of jumps and gotos)
- much more faster development (idea to algorithm)
- coding a PIC in assembly is not funny
- porting algorithms to other microcontrollers (code recycling)


I agree, well commented code is very welcome when taking a peek at code months later. I am use to PIC assembly and had written fairly large applications using just that so no problems there. I have noticed though that even when using a HLL's like "C" or Pic Basic Pro for 8 or 16 bit MCU's. there is still a fair amount of work to be done if one needs to port over to another MCU type, especially if you put lots of inline assembly to control on board peripherals like USARTS and A/D converters, etc ... The "C" code does not really remove you that far away from the hardware. I like that anyways Very Happy

I am curious why you stayed away from interrupt driven code. It make life so much easier ?? The 18Fxxx has so many hardware timers to do the task management or to set sample rates.


Quote:
if much more performance is needed better choose a faster controller
like ARM, Propeller, PIC32, DSP ... Nintendo GBA/DS, PSP, PocketPC ...



That multi core "Propeller" chip from Parallex looks really cool don't it? Something like 8 32 Bit COGS all doing different things Cool You can still squeeze more performance from what you have by using a base oscillator of 10MHz and enabling the 4x PLL in this chip. Then you can go to 10 MIPS. Another possibility are the DSPic or 24Fxxx chips that go to 40 MIPS and are 16 bit machines. The PIC32 (MIPS) and ARM are a bit overkill I think Wink

Quote:
but inline assembly packed in a C function is a good idea to
gain maximum performance out of an time critical part of a
synth plugin.


Yes, thats the best way I think also.

Quote:
in the moment the PIC is running with the internal oscillator (32MHz),
I had overclocked a PIC up to 100MHz (factor 2.5 , 40MHz is normal)
and it worked Cool
but this is not recommended because some of the internal periphericals (RAM...) cannot operate at that clock rate, missfunctions occur ...
Maximum clockrate may vary from device, temperature, shielding...
but that can be very interessting thinking of circuitbending.
Errors can be very musical Wink


Wow, never even crossed my mind to overclock PIC MCU's ........ I don't really agree with all this over clocking garbage anyways. You see so much of that in the PC industry and you get some of these tweakers thinking they know all this and that about hardware than wonder why their stuff is not working very well or is intermittent in some way ...... geez ! Rolling Eyes You are wise in your recommendation not to do it bt maybe fun as an experiment Very Happy

Bill
Back to top
View user's profile Send private message Send e-mail
Sam_Zen



Joined: Mar 08, 2008
Posts: 251
Location: NL

PostPosted: Sun Apr 13, 2008 10:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Very nice examples made with this PICsynth!

As far as fractal 2 sound is concerned (on PC that is), I've used FractMus.
It renders fractal algorithms into MIDI format. I'm not a MIDI fan, but it can be transformed into a sound file. (sorry if OT).

_________________
0.618033988
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Wed Apr 16, 2008 12:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Cool got three 18F4620 MCU's in the mail today !!! Cool

Bill
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Fri May 02, 2008 7:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Fellow Builders,

Here's my version. I had to add a filter (a state variable SEM clone, thanks to Takeda-san and MFOS), an LFO, and a tiny button keyboard. The small LM383-based amplifier and speaker will go into the mask--pictures of that coming as soon as I get it made.Smile

Thanks,

Ole


PICSynth_smaller.jpg
 Description:
 Filesize:  451.89 KB
 Viewed:  820 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

PICSynth_smaller.jpg


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 8 [195 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2, 3, ..., 6, 7, 8 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
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


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