Page 1 of 1

MIDI questions

Posted: Wed Sep 19, 2012 8:07 pm
by Dave S
Hi,

Is an 8MHz internal RC oscillator fast enough for MIDI to work? (PIC16F88)

The MIDI element reads in 3 bytes. Looking on a scope the level info I want is in a 4th byte. Is it possible to modify rhe custom code to read in a 4th byte please (C not my strong point).

Thanks,

Dave

Re: MIDI questions

Posted: Wed Sep 19, 2012 10:21 pm
by Enamul
Hi,
Here is the programming strategy pdf for you..it has solution of your most of the questions..

Re: MIDI questions

Posted: Thu Sep 20, 2012 12:08 am
by Benj
Is an 8MHz internal RC oscillator fast enough for MIDI to work? (PIC16F88)
I think you should be fine at 8MHz or 2MIPs to send and receive MIDI but it really depends on what else your program is doing.

If possible I would move the receive signal to an interrupt pin and enable a falling edge interrupt in flowcode. Inside the interrupt macro add a component macro call to receive the incoming MIDI message. This should improve your chances of catching all the incoming data. Circular buffers could be employed if needed to ensure messages coming in close together are cought and processed.

The v4 MIDI component uses an older version of the software UART code so it may need tweeking slightly to get it to receive 100% reliably. If you have any problems receiving or transmitting at the correct baud then let me know though I think there may already be a few posts about v4 and software RS232 or UART baud tweaks. You may also have to tune your RC oscillator slightly to give you a more accurate baud if you are having problems.
The MIDI element reads in 3 bytes. Looking on a scope the level info I want is in a 4th byte. Is it possible to modify rhe custom code to read in a 4th byte please (C not my strong point).
Is the 4th byte possibly a second command? I was under the impression that MIDI messages were 3 bytes in length max though it's been a while since I last played with MIDI. Would receiving two messages and processing the second fix the issue?

Re: MIDI questions

Posted: Thu Sep 20, 2012 9:59 am
by Dave S
Thanks for that guys. The output of the midi drum pad I have is 60 bits, possibly 64 if the last 4 are 1's. The pressure data appears to be around the 4th byte i.e. if you hit the pad with various intensity these bits change.
I thought that midi was 3 bytes as well but this must be compatible somehow. Due to lack of time (another "urgent" job!) I will have to rectify the audio out and feed that into an analogue input instead.
Shame really as the data is already in digital form, just not simple to get at.