midi keyboard

coin12

New Member
i want to convert a toy keyboard to a midi keyboard i have a 40x1 mcu
is it possible? i read many threads about that it just made me more confused

anyway .. regardless the toy keyboard if i want to send a midi data what code should i write
for example i want to output or send a C note or C# also how many octaves can i have ?

let say that i want to write a test code to output

C0 then C6 then C8 then B3 how to do this ?

what are the limitations?
am i going to have latency?

thxx
 

hippy

Ex-Staff (retired)
You need to send a MIDI Note On command when a key is pressed and a MIDI Note Off ( or MIDI Note On with velocity of zero ) when released. The command holds a key number value of 0 to 127, so you can have 128 keys, just short of 10 octaves. The MIDI Specification defines which musical note key has which key number. Plenty of information on MIDI on the internet.

Biggest limitation will be scanning the keys quickly and determining when one, and which, is pressed or released, especially if you want polyphonic sounds ( pressing a second key while holding a previous ). With only a few keys probably not a problem. Touch sensitivity adds an extra level of complexity and processing.

A 20X2 at 64MHz should be able to handle 40 keys but not proven to be the case. Unless someone has actually already done this, full limitations can only be guessed at; that's what the R&D and prototyping phases of a project discover.

Split the project into three sub-parts; generating MIDI commands, scanning the keyboard and putting them both together. Should be plain sailing.

http://www.picaxeforum.co.uk/showthread.php?p=41106
 
Top