PICMIX - DIY midi DJ controller

I did several projects with PICs before that’s the reason why. I chose this PIC cause this is a very allround PIC, very cost effective, lots of I/O so no need for a key matrix unless you want more buttons. An INT port, HW serial port, internal OSC and so on. I could use a PIC18 at higher speeds but I think the PIC16 is fast enough.

The interrupt on change pins that are available are used for the rotary encoders. This way they are very responsive and reliable. I tried reading them on regular pins but that gave me not wanted results. The other buttons are read in a loop, the program runs fast enough not to miss a keypress.

The cost of the PCB is not much.
-16f887 at 4 euro
-headers at 2 euro
-cables are old ones I reused
-analog multiplexers are 0.5 euro a piece, 2 are used
-inverting schmitt triggers cost 0.3 euro a piece, I used 3
-7805 and the rest of the parts set you back around 2 euro

All together you build this for less than 15 euro including a PCB.

To honest I was going to use an arduino first, just to explore the platform but I didn’t like the way it was programmed compared with the CCS compiler I’m used to. Though, I’m sure you can do it as easily on an Arduino.

Holy sh*t that’s soooooo cheap!
NICEEE!!

Well the PCB is yes. The front plate is around 80. Buttons, encoders, faders and so on did cost me around 60-80 euros I think. All together I could’ve bought a second hand VCI-100 but hey, I can buy spareparts easily and I control the firmware :slight_smile:

Still need to build a case in wood, hope to do that this week.

dude, would be so happy if you could bring us a complete building tutorial :slight_smile:

What would like to know in detail ? I would like to help.

this is the best bit/reason i reckon :slight_smile: imho the midi fighters seem a bit expensive for what they are but i bought one so i now have a controller i can completely customise the firmware on if i want - tho i’m using midimasher to do most of that now, i’ll also come up with some tweaks for the mf firmware eventually.

I think he means a how-to on the brain (i would love it too)

i think most important would be a shopping list so everybody could see what they have to pay. And maybe a list of the major steps you have to follow for those who never build a midi controller before.

when we will see a finished picture of your beatiful work?

If you would share a how-to on the pcb(build and programming) you would be the best ever!!

Ok I’ll see what I can do about that :slight_smile: If the prototype works I’ll draw some schematics. I’ll make a PCB out of it, no problem to share it.

You’re the best!

I was wondering, what do most controller send out on a button press ? Do they send an on press message and an on release message ? What do you guys prefer, play on release or press ?

most controllers will send out a note-on on press (often just 0x7f if non velocity sensitive) and a note-off (often with a velocity of 64 which i still find odd) on release, tho sometimes just another note-on with zero velocity. controllers will almost always send out cc’s for faders and encoders instead of notes tho in reality it makes no real odds whether notes or cc’s are used ofc for dj type controllers.

you definately want to send out a message when the buttons are pressed and if you don’t also send out a message on release then the buttons can’t be mapped to “hold” type controls. i.e: can only be used for triggers or toggles.

the lpd8 in PC mode is like that as it only sends out a PC message when u press a pad - tho PC messages only need 2 bytes. makes the PC mode not so useful anyway, even when they’re translated into notes or cc’s.

the shorter answer to your question is “play on press” :wink:

Thanks for your answer !! The reason I asked is cause the Numark Total Control I looked at from my friend is sending the note on on release so the track starts playing on release. You could think of releasing a record to make it play, though I don’t think it is logical for a controller.

I do send CC for a fader and pitch bend for the pitch fader. As for the buttons I now send only a note on with value 0 and 127. Example:

newd0 = input(pin_d0);
if(oldd0 != newd0)
{
if(newd0)midiout(150,40,127);
else midiout(150,40,0);
}

Still have to find a page that informs me about all the possible midi messages and their range.

odd re: the total control, even if it was sending out a noteon with zero velocity on release i’d still expect it to send out a non zero velocity noteon message on press. maybe due to some custom setup app?

this is the url i usually refer to for basic midi spec info: http://www.midi.org/techspecs/midimessages.php

your code seems sensible. no real need to send an actual noteoff message on release. internally in midimasher i just translate all noteon and noteoff messages into ‘note’ message for callbacks to attach to. only really makes any difference if you want to control an actual synth, where u need to send a noteoff message else the next noteon won’t retrigger the ADSR envelope.

any reason you’re sending on midi channel 7? each midi port can send data on each of the 16 midi channels without getting mixed up with a different controller etc. i only ever used to care about midi channels when i was chaining synths via old school din-style midi cables using the midi-thru ports.

The reason I’m sending on that particular channel is cause I didn’t have a good midi message reference, I do now with that page you gave me, thanks a lot for that.

Changing all midi messages to something that makes sense was on top of my to do list. Must be something weird then with that Numark controller :slight_smile:

Sending a note off message might only be usable for cueplay actions where you hold the button indeed. You’re right about that. I hope to finish the PCB and basic form of the code this week so I can do some testing with it.

I heard of Midimasher before a lot, what does it do exactly ?

good point :stuck_out_tongue: i only started to get back into midi stuff a few months ago. i keep having to refer back to that webpage. it’s pretty handy.

cool. pretty impressive building your own controller and coding it too :wink:

sort of like bomes meets midikatapult and automap i guess? or something like that…

i wanted an app that would connect to all my controllers (and to traktor via one massive tsi and some virtual midiports) and route data any which way i wanted. the core is C++ (bad C++, more just C really) and implements any number of virtual layers for any controller with full led recall, handles reading the data and passing it onto user defined callbacks (coded in LUA) when needed.

i was afraid of latency issues using LUA but it seems fine. hadn’t even heard of LUA until using it, but it seems ideal for what i need and embedible.

here for example is my attempt at recreating the slicer that the twitch/itch has in midimasher http://midimasher.djism.com/lua/lib/slicer.lua

quick code example, this will make a launchpad led flash to the beatphase in traktor:

capture("traktor", "heartbeat_a", ALL, 0, function(d, e, v, p)
print("beat "..v)
if v > 0 then
send("lp", "0,0", 1, lp_yellow)
else
send("lp", "0,0", 1, lp_black)
end
end)

and i have functions that build on stuff like that to create virtual faders on a launchpad or emulate a 4banks midifighter etc etc… LUA is cool in that it allows u to create functions kind of like javascript or perl that u can pass to other functions. in fact saying “function foo() end” is actually only syntactic sugar for “local foo = function() end”

Impressive what you’ve made. I always think that the best solutions come from people that build it for theirself with only the end result in mind :sunglasses:
Such projects have passion.

The mapping for Traktor is complete after I’ve cleaned up my code with the help of the page that zestoi gave me.
Now I’ve drawn the jog wheels. These will be 90mm in diameter. The base is 2 layers of MDF and a perspex top. The perspex top will make it possible to use some sort of skins between the MDF and the perspex. I hope all fits well, fingers crossed. The parts will be laser cut.

Also made an MDF case for it, glue is drying at the moment.


Another question, how can you map the cue(play?) button in Traktor so that it plays if I press it and stop if I release it ?