pic/midi programming

Mel Wilson mwilson-4YeSL8/OYKRWk0Htik3J/w at public.gmane.org
Thu Oct 29 19:13:24 UTC 2009


Dave Cramer wrote:
> Anyone do any PIC MIDI programming. I want to make an electronic bagpipe,
> questions I have are:
> 
> How to use a MIDI chip to output sound
> alternatively how to use a DAC to output more than one channel. I guess I
> could use multiple DAC's
> 
> any resources including PIC programming, would be welcome.

MIDI transport layer is UART output at 31250 baud 8 bits, no parity, 
one stop bit, buffered to drive an opto-isolator at the receiving end. 
  The messages, at the absolute bare-bones minimum are:

To turn a note On send bits:

1001cccc 0nnnnnnn 0vvvvvvv

cccc is a "channel number" decided arbitrarily between you and the 
MIDI-controlled sound generator you're dealing with.

nnnnnnn is a "note number".  Notes are numbered up and down the 
chromatic scale, with 0x4C (decimal 60) representing middle C.

vvvvvvv is a "velocity" which controls the volume of the note.  Larger 
means louder.  Zero means silence.

So to turn on middle C on a synth listening on channel 2 with 
reasonable loudness, send the 3 bytes

0x92 0x4C 0xC0


To turn a note off, do as above but with zero velocity.

0x91 0x4C 0x00


There's lots more, but just this will make things happen.

I too agree that Arduino would be a good way to get results fast 
(caveat -- check that Arduino serial ports can handle 31250 baud.) 
You can get the hardware locally if you want at Creatron, at 255 
College St. http://www.creatroninc.com .


If you lose MIDI and do the sound yourself, I'd think start with 3 
fixed-pitch square waves for the drones and a tuned wave for the 
chanter, followed by the rudiments of a low-pass filter.  It might 
fool a few people.


	Mel.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list