J2B Synthesizer [140182]

This is a port of the Soulsby Atmegatron 8-bit monophonic synthesizer to the Elektor J2B LPC1343 ARM Cortex-M3 board. The Atmegatron is quite a nice design with everything you need fitting in 32KB of flash memory.
This is a port of the Soulsby Atmegatron 8-bit monophonic synthesizer to the Elektor J2B LPC1343 ARM Cortex-M3 board. The Atmegatron is quite a nice design with everything you need fitting in 32KB of flash memory.
New firmwares Atmegadrum, Atcyclotron & Delayertron (see below)!
The original Atmegatron is based on an 8-bit, 32 KB flash memory ATmega328 and the firmware is available as an open source Arduino sketch. The J2B board has a 32-bit LPC1343 ARM Cortex-M3 processor with 32 KB flash memory.
The Atmegatron has two rotary encoders, eight potentiometers and a pushbutton. Two potentiometers are for volume and bass boost, the others control the synthesizer itself. The J2B board can have up to nine rotary encoders, or eight plus a pushbutton.
The Atmegatron uses a bunch of bi-color LEDs to interface with the user. The J2B can have an LCD.
The Atmegatron uses PWM to produce its sound, the J2B has excellent PWM capabilities.
Based on the previous observations, porting the Atmegatron to the J2B should not be a huge task, which is why I started doing it. The most daunting task was to replace the analog potentiometers by rotary encoders while keeping the same feel. Two rotary encoders replicate the Atmegatron encoders, six others simulate the potentiometers. The bi-color LEDs are replaced by a 2x16 LCD, but I added two bi-color LEDs to indicate the red/green modes of the synthesizer.
The port of the firmware is almost completed. The synth engine works fine, but I still have to add EEPROM interfacing and I want to improve the way the values of the six "potentiometers" are displayed.
The photo below shows my prototype with the MIDI input sticking out from under the LCD. The prototyping PCB has a basic anti-aliasing filter that drives a small loudspeaker.
I designed a PCB that plugs onto the back of the J2B. The main reason for this is that the encoders on the J2B are too close together for a comfy control surface. On this mother PCB I have also placed a fifth-order Chebychev filter, an amplifier with volume control (I ditched the bass boost), a MIDI interface (in/out) and an EEPROM because the LPC1343 does not have one. It is needed to store patches. The sandwich is supposed to fit in a cheap plastic enclosure (but I will get a hard time drilling it properly).
A cool thing of the J2B is its built-in USB capabilities making it possible to update the firmware from any Windows PC simply by copying a file to the board which is seen as an external drive. No programmer needed at all.
PWM capabilities of the LPC1343 are a bit better than those of the ATmega328, which allowed me to increase the sample frequency and gain a bit, making it a 9-bit synthesizer. So, in theory, the sound quality of the J2B synth should be a little better than the Atmegatron.
I have not yet tried to implement USB serial port or MIDI functions, but I might do that later to simplify patch storage on a computer. Now it uses MIDI sysex for that.
Since I started porting the Atmegatron, Soulsby released new firmware for a drum machine on the same platform. I guess I will have to port that too (even though I don't like the way it sounds too much).
The PCB has been ordered.
Of course, once finished, the J2B Synthesizer will be open source too.
Update 23/7/2014
The PCB has arrived and I have started assembling it. Being a cheapskate I made an effort of designing a single-sided PCB, which is great. Except for one thing: single-sided PCBs don't have solder pads on two sides, which is very inconvenient when you have to solder many pin headers on the solder side...
I must be honest, the mechanical situation is horrible. First of all, I didn't take into account the height of the MIDI connectors and now they interfere with your fingers when you manipulate two encoders. 3D modelling could have avoided this.
Secondly, there are so much connections between the encoder board and the J2B board that it makes assembly almost impossible. I sort of expected this, but not that it would be that bad.
A third problem is the limited height of the encoders compared to the height of the LCD, making it pretty hard to find a good enclosure where the encoders stick out enough for fitting a knob and where the LCD is flush. Finding compatible encoders with longer shafts or shaft extenders is very hard.
Because of this mechanical disaster I have decided to start from scratch. Instead of trying to use the J2B board at all cost I will do a new design that integrates everything on one PCB. Well, not everything, I will do a small second PCB for the MIDI connectors so that it can be mounted lower.
The new design will be SMD instead of through-hole and I will probably move to an LPC1347FBD48 because it has twice the flash memory and 4KB of EEPROM. It features the same USB thumb drive method for firmware programming as the LPC1343 on the J2B board.
For the LCD I have found a thinner (and cheaper and slightly smaller) solution in the shape of an I2C LCD (Farnell 2063208) that is only 6.3 mm thick.
I have attached the Eagle files and LPCXpresso project of my first attempt. This should work on a J2B board. If you don't care about the tight spacing of the encoders I suggest you mount them on the J2B board.
On to version 2...
Update 21/8/2014
Back from holidays, I have redrawn the PCB and ordered it at Eurocircuits. Actually there are two PCBs now, one small PCB with the MIDI interface on it and a bigger PCB with the rest of the circuit.
The MCU is now an LPC1347 and I added an audio channel hoping that the MCU can cope with it. This would make the synthesizer in a 2-channel PWM audio platform. The single channel LM386 output amplifier has been replaced by a two-channel TDA1308.
Feature creep made me change the way I connected the rotary encoders. They have now RC glitch filters (from the datasheet) that should allow me to simplify and speed up the keyboard scanning algorithm. But, more important, on six of them there are now jumper resistors so that the encoders may be replaced by potentiometers connected to the MCU's AD inputs 0, 1, 3, 5, 6, 7.
The new design files are attached below.
Update 1/9/2014
PCB V2 has arrived, see photographs below. At a first glance there do not seem to be many obvious mistakes.
BTW, I renamed the synth to J:B (instead of J2B) where the two dots of the colon (':') represent the 2. But what the heck does J2B stand for??? Ideas, anyone?
Update 2/9/2014
Completed the assembly of the PCB V2, see photographs below. I found a few small footprint errors and the silk screen needs some rework to improve its clarity.
Now I need to find some screws to fix the assembly in the enclosure and drill the top cover. That's a tough one for me as I am not a very precise mechanic.
First connection to the PC is promising. The LEDs came on together with the backlight of the LCD and the PC started installing the driver for the MCU. It was slow, but after a disconnect-reconnect a new thumbdrive became visible. This means that I now can start working on the firmware.
ToDo: I²C LCD driver, EEPROM storage of parameters, second audio channel (will it be possible?), etc.
Update 3/9/2014
Validated the mechanical side of the project (see photos below). I am more than pleasantly surprised by the result of my drilling. If I can pull this off, anyone can.
The pushbutton turned out to be the most difficult as it is a bit higher than the rotary encoders. With the cap it is even higher. The cap has to go under the cover otherwise it will fall off (it has a special rim for that). Luckily the enclosure is 2.5 mm thick there which leaves enough room to drill the hole larger on the inside than on the outside allowing a perfect fit.
I used 3x25 mm screws from Castorama (Diall single thread woodscrew yellow passivated steel, round head, pozidrive, ref 50.34.20) to fix the PCB in the enclosure. As standoffs I cut four nylon screw plugs to 17mm and two to 15mm.
Update 11/9/2014
- implement EEPROM patch storage
- create clever LCD characters to clearly show which control does what
Update 12/9/2014: video!
- Tempo (60-255 bpm)
- Pitch (0-255), pressing it will get you 119, which corresponds to a sample rate of 8 kHz.
- Pitch LFO level (0-255), setting this value too high together with the pitch will crash the synthesizer because there is not yet a pitch limiter.
- Pitch LFO speed (0-15)
- Instrument delay (0-7), this is a per instrument value. It adds an echo to the instument, quite a nice effect
- Insturment volume (0-7), this is a per instrument value and allows you to mix your drum kit.
- line 1: instrument name, volume and delay
- line 2: hits for the selected instrument
Discussion (9 comments)
ElektorLabs 6 years ago
Julius Caesar 8 years ago
old-maker 9 years ago
Hi Clemens, as I wrote in another post, I tried to assemble a guide for J²B Synthesizer, using your articles, part of the Atmegatron manual and some drawings I did.
It's only a draft; the pages extracted from Atmegatron manual need to be adjusted (Atmegatron name replacement and corrections concerning some specific differences between the two synthesizers).
The draft is in the attachment; feel free to correct, add, cut or trash all :-)
If you consider inappropriate the inclusion of Atmegatron manual pages, we can keep safe pages 1-7 and 20 and add a reference to original Atmegatron manual; otherwise, I can rewrite those pages ... with lots of patience and time :-)
Regards,
Pasquale
ClemensValens 9 years ago
old-maker 9 years ago
Hello Clemens, some time ago my nephew, aspiring musician, asked me: 'Uncle, why dont't you make a Moog for me ?'.
Embarrassing ... a synthesizer is a quite difficult target for me :-(
But I found on E-labs your project, so I bought the assembled board and maybe I can save my reputation :-) :-)
The J2B synthesizer is finished and functioning, but I have two questions.
The original Atmegatron is equipped with an audio output, that allows to connect it to an amplifier; on J2B synthesizer there is only a headphones out, so I think I must add an impedance adapter. Why did you remove the audio output ?
On J2B synthesizer there is also a MIDI out; I am not an expert and I believed the only useful output for a synthesizer was an audio out. The MIDI out on J2B synthesizer is currently usable ?
ClemensValens 9 years ago
old-maker 9 years ago
ClemensValens 9 years ago
ClemensValens 9 years ago
It seems that many people missed the excellent firmware update feature of the LPC1347 microcontroller that is at the heart of the J2B Synthesizer. Besides a PC running Windows, nothing else is needed. No special hardware, no programmers, no drivers. Actually, this feature is one of the main reasons why I chose this MCU. Here is how to do it:
That's all there is to it. The display should now greet you with the message “J2B Synthesizer” in a large font. When it goes away the synthesizer is ready to be used. Connect a MIDI keyboard and headphones and start playing.
Use this technique to try the new firmwares, you have now 4 instead of just 1 synthesizer at your disposal.
Have fun,
Clemens
Precomiled executables ony (91kb)
ClemensValens 9 years ago
Over the past evenings I have ported Atmegadrum (see also main post), Atcyclotron and Delayertron to the J2B Synthesizer. Watch the tutorial videos here to see what you can do with them. The precompiled binaries are attached to this post. The source code is there too.
The UI for the Atmegatron firmware was changed a bit after my experiments with the drum computer. The live controls are no longer displayed six at a time, but only the one you touch with its value and now in human readable text. I think this will improve its ergonomics.
Have fun!
Clemens
J2B Synthesizer v3.0 Source code (407kb)
goodoldel34 10 years ago
ClemensValens 10 years ago
PaulDeadman 10 years ago
Hi. I am working on a project which has the same LCD module. My processor cannot communicate with the LCD module (other I2C slaves on the bus work). On contacting MIDAS they stated that it required 10K pull ups on the bus due to 'ITO layer resistance' (I have used 4K7). I havent yet had a chance to test this. But my question is: I assume your project works (the schematic shows 4K7) did you notice anything special required to communicate with the LCD module in the addressing of the device (as my code does not receive the ACK). I am using a initial byte of 0x7C (which is 0111 1100, address 0111 110 + R/W bit).
Cheers
Paul
ClemensValens 10 years ago
Antonios Chorevas 10 years ago
I watched the video, and I noticed that the operation of the rotary encoder is not perfect when changing the filter numbers from 1 to 2 (arount time position 3:07)
This is a problem that I experience sometimes with the rotary encoder in the d-FORMANT project. (Allthough it occures only when I rotate the encoder really fast). The fact is that you use R-C to debounce, while I use a Finite State Machine.
Do you beleive that the problem in your design can be solved using different values for the R-C network, can it be solved with a 'better' rotary encoder, or is it a problem inherent to the rotary encoders?
Do you know if this problem exists at 'comercial' products?
Your thoughts and knowledge will be valuable to my project too (I have tried rotary encoders from two manufacturers: they have similar responce, but both of them are rather cheap solutions, so ....)
ClemensValens 10 years ago
eminence2001 10 years ago
ClemensValens 10 years ago