Showing posts with label Synth DIY. Show all posts
Showing posts with label Synth DIY. Show all posts

Friday, 27 May 2022

DIY MIDI Keyboard

 13 note MIDI Keyboard with Octave buttons


Whilst working on the update of the next Helios Synth I've put together the code for a little MIDI controlled keyboard.  It might be useful to someone, so I've published it here.

What is it?

It's a simple 13 note MIDI-out keyboard with an up octave button and a down octave button.  An LED lights brighter the higher the chosen octave.

Is that it?

Well yes, but I'm planning on adding an arpeggiator soon.

DIY MIDI Keyboard

You'll need;


15x   Push buttons (push to make type)
15x   10k Ohm resistor
2x     220 Ohm resistor
1x     270 Ohm resistor
1x     LED
1x     Arduino Nano
1x     MIDI DIN Connector

Here's the Fritzing image;


The Code



You'll also need the 47 effects midi library installed in your Arduino library.


About The Code

MIDI:

The code is stuffed with comments, so go take a look at that, but essentially with a button press we send a midi message that looks like this;

MIDI.sendNoteOn(49, 127, 1); // "Note C sharp On"

To break that down, the 49 is the note number.  Here's a list of midi note numbers that we use;

MIDI Note numbers:
octave C C# D D# E F F# G G# A A# B         0   24  25  26  27 28 29 30 31 32 33 34 35
1 36 37 38 39 40 41 42 43 44 45 46 47
2 48 49 50 51 52 53 54 55 56 57 58 59
3 60 61 62 63 64 65 66 67 68 69 70 71
4 72 73 74 75 76 77 78 79 80 81 82 83
5 84 85 86 87 88 89 90 91 92 93 94 95

...so note number 49 is the same as a C# in the second octave.

The next number is 127, which is the velocity of the note.  127 is full loudness, so for a silent note we send a 0, (in other words: stop playing the note) like this;

MIDI.sendNoteOff(49, 0, 1); //"Note C Sharp Off"

And the last number: '1' is the MIDI channel number.  MIDI can send info on 16 different channels but we're just using channel 1.

Octave Buttons

The octave buttons count from 0 to 5, incrementing by +/- 1 with each press.  We then send this number into an array of midi note numbers. So here's the array, made up of 12 notes, over 6 octaves;

const int octaveSelected[][12] = {
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, // Oct 0
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, // Oct 1
{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59}, // Oct 2
{60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71}, // Oct 3
{72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83}, // Oct 4
{84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}, // Oct 5
{96} // Oct 6
};


So now instead of sending a MIDI note number like '49';

MIDI.sendNoteOff(49, 0, 1); //"Note C Sharp Off"

We send the array with the button count number inside it;

MIDI.sendNoteOn(octaveSelected[octButtonPushCounter][1], 127, 1); // "Note C sharp On"


Btw, the [1] is representing the second note in the array (remember: computers start counting at 0).  So if you wanted the standard 'C' note, it would be the 1st item in the array which is [0]. Or if you wanted the last note it would be [12] etc.  These numbers are hard coded to our push buttons.

We also do a similar trick with the LED brightness.  That's stored in an array;

const int octLED_Brightness[] = {0, 10, 30, 50, 120, 255};

...and those numbers control the PWM of the LED.

That's basically how the code works.  

Enjoy! (and if you add an Arpeggiator to it please let me know)



Sunday, 1 December 2019

Another Arduino Synth

Here's an unfinished synth I found in the drawer.  I promise I'll go back and finish it one day, but for now back in the drawer it goes...

Friday, 1 November 2019

DIY Volca Mixer - Updated Schematic



I've updated the Volca Mixer schematic to now have 6 inputs (making it officially twice as good as Korgs own version*).

Click for a bigger picture;



Hopefully I shall finish making the PCBs soon and see if it works.

*In my heavily biased opinion

Tuesday, 1 October 2019

Random Synths

Some random synths and things from when I first started out building them...


Thursday, 27 June 2019

02 Drum Machine Update

Here's some images of the finalized 02 drum Machines I made.  Most are now sold/given away except the blue and yellow ones.  Give me a shout if you'd like one of them.

Wednesday, 12 June 2019

02 Drum Machine Update 2 (?!)


OK, so I've had ten finished drum machine sitting in boxes for well over a year, but I've been exceptionally busy, so I've not had time to put them up for sale :-)  I will do soon I promise, plus I'll email all the people that requested one.  Here's a bit of an update of what happened between that time;


Awaiting finishing



Thursday, 15 December 2016

Older Stuff: A Handful of Different Modules





Over the last few years I’ve made quite a few different modules, some never get to leave the drawer due to space, and others get slowly changed as my needs suit.






Pictured above is a 6-into-1 mixer (for the volcas), a delay, a fuzz, and then an MFOS synth.



The delay came a Velleman kit from Conrad, which is always fun, but since then I’ve built a few others using the classic PT2399 IC.  












The six into 1 is I cobbled together from various schematics from the book ‘Handmade Electronic Music’ by Nicolas Collins.  

This book is great for just getting out and making things, with lots of simple but effective ideas that you can easily build upon. Highly recommended.