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....

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 ... The external patched LFO's can be rectified and attenuated if need be.

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

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.

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 Although I might have a play with the "user interface" side of things if I get a chance!

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.

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 !!! 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 .....

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 ...

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).

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. 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.

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 ... I realize this started as a small project but it seems it has room to grow

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.

neighbor came downstairs to see if something was wrong with the washing machine

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
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)

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
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

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.

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.

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

Sure, agree there !

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

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.

That multi core "Propeller" chip from Parallex looks really cool don't it? Something like 8 32 Bit COGS all doing different things 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

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 ! You are wise in your recommendation not to do it bt maybe fun as an experiment

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

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.

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

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