MIDI questions

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Contact:

MIDI questions

Post 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

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Contact:

Re: MIDI questions

Post by Enamul »

Hi,
Here is the programming strategy pdf for you..it has solution of your most of the questions..
Attachments
MIDI Programming Strategy.pdf
(46.88 KiB) Downloaded 223 times
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: MIDI questions

Post 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?

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Contact:

Re: MIDI questions

Post 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.

Post Reply