Thursday, February 28, 2013

Juno6pm Input Board: The Software

While looking for examples of bit banging serial, I came across this AVR library called AVR lib. It is a great library for lazy people like myself, not only for serial bit banging, but for anything else you might want to do with the AVR peripherals: ADC, UART, I2C, timers... should be able to finish the code quickly with this cool library.

Wednesday, February 27, 2013

Juno6pm Input Board: The hardware

The Juno6pm input board is the board that will handle MIDI input (to solve the CPU hogging issue caused by Raspberry Pi USB MIDI), the knobs and the switches. It will be connected to the Raspberry Pi through serial. The board I am planning on using is the AVR synth that I bought a while ago from elby-designs:

Since this whole project is a virtual analog synth, I decided that I will not be using my AVR Synth anymore and I better give it a better use (also I have little time do design a new board, build the pcb, solder components, etcetera).
The idea is to keep the 8 potentiometers, replace the 16 switches with momentary pushbuttons and remove the dac completely.
As for the software that will run in the AVR, it will receive MIDI from standard 5 Pin MIDI connector using the hardware UART and send it to the Raspberry Pi, toghether with potentiomer and switches values, by bit banging serial.
Once I am done with the whole project I might think of making a new board just for this project, but till then this will be my juno6pm input board.

Tuesday, February 26, 2013

AVR programming: Open Source saves the day

It was a long time since I last program an AVR micro and last time I did it I was using this programmer:
That I got from microcontroller shop.

So I installed AVR studio 6.0 in my Windows PC (which took ages, BTW), wrote a blinking LED program, set up the programmer and to my surprise flashing the ATMEGA failed. Seems like AVR Studio does not support this particular flavour of programmer. So I went back to AVR Studio 4.XX (don't remember the XX, but the latest AVR studio 4 available in Atmel's website) with same results. After searching for alternatives, I found WinAVR, which I managed to get to work fairly easily (with the help of ladyada's avrdude tutorial). Since it was using AVRDUDE for flashing and that is available for Linux also (and the nice atmel IDE was not good for me anymore), I decided to forget about Windows completely and develop for AVR in Linux. Found this explanation on how to use codeblocks for AVR programming, which is great, cause all the project (the VA synth and the Monome stuff) I did using codeblocks already, so that means I have the whole thing using a single development environment.
So, big thanks to everyone who anonymously helped me get this to work and in general to the open source comunity.

Monday, February 25, 2013

Next Steps

Here is a list of what I will be working on next:
  1. Implement my MIDI to serial conversion: I will be doing a MIDI to 38400kbps serial conversion using an AVR micro. The reasons for doing this are:
    • USB MIDI is a CPU hog in the Raspberry Pi
    • I am still not sure if the raspberry Pi supports MIDI baud rates or not.
    • I want to add some controls to the Pi that will use the same micro and will be sent to the Pi through the same serial
  2. Add the control of the knobs and switches (get the knobs and switches status and send it to the Pi).
  3. Put everything into a nice case.
  4. Add missing functionality to the VA synth (as explained here).
  5. Add missing functionality to  the Monome application.

I am hoping to finish 1 and 2 within the next 2 weeks. We will see...

Friday, February 22, 2013

VA synth

Where am I and what is the plan regarding the VA synth?
As mentioned, my plan is to do a Juno106 workalike (a workalike, not a clone). In that respect, I have the following blocks developed and working:
LFO: I have extended it to support square and sawtooth and I am missing the delay.
DCO: pretty much working as in the Juno, with the addition of triangular wave. I am planning on adding wave table DCO also.
HPF: this is currently missing in my design, but will add it soon.
LPF: I have the 24db/Oct resonant filter. I am not very impressed with its sound, so I might try other filters. I am missing the LFO control of the filter also and the keyboard tracking. I am using "Moog VCF variation 2" from here.
ADSR: done and working.
DCA: done and working.
CHORUS: done and working, but I want to make it a stereo chorus (currently both speakers get the same signal).

Other than that, I am sampling at 88200Hz and still need to add a low pass filter before downsampling to remove possible aliasing. Hopefully the 2 missing filters, HPF and anti aliasing filter, will not take much CPU.
I also want to add an arpeggiator and a step sequencer going to DCO, LPF, DCA to add some "weirdness".

Thursday, February 21, 2013

Monome + Raspberry Pi


Basic monome functionality for now...

Video Description:


Video Showing an Arduinome (arduino based monome) connected to a Raspberrry Pi which is running a sample playback software synth with Linn Drum samples.
There is no pd or Max running on the Pi, not even monomeserial or serialosc, it is just a C program that processes the raw serial stuff coming from the Monome and converts that into calls to the synth.

Wednesday, February 20, 2013

Tuesday, February 19, 2013

USB Audio on Raspberry Pi

One thing that I forgot to mention in my diagram in previous post was that I was planning on using USB audio as a way to get the sound out of the Pi, as the on board analog audio is pretty bad. I might modify the diagram...

In order to set the USB audio device to be the default audio device I did as suggested here: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=20866 and modified the following line in /etc/modprobe.d/alsa-base.conf

#options snd-usb-audio index=-2
options snd_bcm2835=-2

After changing that and rebooting if you do "cat /proc/asound/modules" you get 
0 snd_usb_audio
1 snd_bcm2835

showing that the USB audio sound card is indeed the default. That was all I needed to get the USB audio sound card to work correctly.

Monday, February 18, 2013

Juno.6pm Diagram



Here is the schematic diagram of how the JUNO.6PM will be. The MIDI connection I am still not sure if it will be USB MIDI or I will need to route it also through my AVR board handling knobs and buttons, as it seems that USB MIDI screws up raspi's performance (as discovered here: http://raspberrypisynthesizer.blogspot.com/2012/10/the-problem-with-usb-midi.html )

Sunday, February 17, 2013

The Concept

So, where does the name JUNO.6PM come from and what is it exactly its going to do? I guess you are wondering.
JUNO.6PM is a midi + monome controlled virtual analog synth + sample playback drum machine. The virtual analog synth is a juno 106 workalike, with 6 voices, 1 dco, 1 lfo, resonant 24db/Oct lpf, chorus effect... I do not pretend to do a juno clone, as I have never played one, but I did use its audio flow as a reference for my design, mostly because of its simplicity. As for the sample playback drum machine, I have tested with Linn drum samples, but there is no reason it could use other ones.
I am doing the development in a linux machine and every now and then porting to raspberry pi, the expected final platform.
So, going back to the name, the JUNO comes from the virtual analog synth it tries to work like, the 6 comes from the 6 voices polyphony of the VA, the P(i) is the platform and the M comes from the Monome working as the machine drum controller.
At some point I am panning on adding also a 3.5" TV, 8 knobs and 16 switches for configuration. Meanwhile everything will be midi controlled.
Since an image is worth more than a 1000 words, I will make a diagram soon showing the expected setup.

Wednesday, February 13, 2013

JUNO.6PM is born

What: JUNO.6PM is my implementation of a software synthesizer + drum machine.
When: development started a few months ago and now it is taking shape into something usable.
Where: in my livingroom.
How: using a Raspberry Pi, a midi keyboard and a monome controller.
Why: because this guy: http://raspberrypisynthesizer.blogspot.com inspired me (and because he is not planning on making his work open source).
Who: just me, myself and I.