Difference between revisions of "Component: MIDI (Comms: System)"
(XML import BR) |
|||
Line 20: | Line 20: | ||
==Examples== | ==Examples== | ||
Basic example to play a series of notes getting higher in pitch and then going down in pitch. This repeats in a loop and each time the loop repeats the instrument is changed. The current note and instrument are displayed on the LCD. | Basic example to play a series of notes getting higher in pitch and then going down in pitch. This repeats in a loop and each time the loop repeats the instrument is changed. The current note and instrument are displayed on the LCD. | ||
− | |||
{{Fcfile|Midi.fcfx|MIDI Test File}} | {{Fcfile|Midi.fcfx|MIDI Test File}} | ||
− | |||
− | |||
[[File:MidiDemoRun.jpg]] | [[File:MidiDemoRun.jpg]] | ||
Line 45: | Line 42: | ||
The MIDI component during embedded operation will communicate using a UART serial channel. An EB021 MIDI E-block is available to allow standard MIDI cables to be connected up to a system. | The MIDI component during embedded operation will communicate using a UART serial channel. An EB021 MIDI E-block is available to allow standard MIDI cables to be connected up to a system. | ||
− | |||
==Downloadable macro reference== | ==Downloadable macro reference== |
Revision as of 15:46, 16 February 2017
Author | Matrix Ltd. |
Version | 1.3 (Release) |
Category | Comms: System |
Contents
MIDI component
Low level routines for controlling or interacting with a standard MIDI interface.
Examples
Basic example to play a series of notes getting higher in pitch and then going down in pitch. This repeats in a loop and each time the loop repeats the instrument is changed. The current note and instrument are displayed on the LCD.
MIDI Test File
The MIDI component during simulation has functionality to allow it to work with MIDI synthesizers installed on your PC.
To select your software or hardware synthesizer select from the property selector.
If you don't have a MIDI interface installed then IP MIDI seems to be a good option that works well.
Once installed the MIDI output should play through your computer speakers.
The console window can be used to view the MIDI data as it is sent out and received.
The MIDI component during embedded operation will communicate using a UART serial channel. An EB021 MIDI E-block is available to allow standard MIDI cables to be connected up to a system.
Downloadable macro reference
SendMIDI
Sends a MIDI packet consisting of up to three bytes of information,
Parameters
- BYTE Status
- MIDI Status Byte - Used for commands such as NoteOn, NoteOff etc.
- BYTE Data1
- MIDI Data Byte - Used as a parameter specific to the specified command
- BYTE Data2
- MIDI Data Byte - Used as a parameter specific to the specified command
Return value
- This call does not return a value
SendPitchChange
Sends out a pitch change command on the specified channel.
Parameters
- BYTE Channel
- Channel to send the pitch change to
- UINT Pitch_Change
- New pitch value to use, Default 0x2000
Return value
- This call does not return a value
SendNoteOff
Sends a note off command using the channel, note and velocity specified.
Parameters
- BYTE Channel
- BYTE Note
- BYTE Velocity
Return value
- This call does not return a value
SendControl
Sends a control command using the channel, controller and value specified.
Parameters
- BYTE Channel
- BYTE Controller
- BYTE Value
Return value
- This call does not return a value
SendNoteOn
Sends a note on command using the channel, note and velocity specified.
Parameters
- BYTE Channel
- BYTE Note
- BYTE Velocity
Return value
- This call does not return a value
ReceiveMIDI
Waits for the time specified in the timeout parameter for an incoming MIDI message.
Returns 0 to indicate a timeout, otherwise returns the first value from the MIDI message.
Parameters
- BYTE Timeout
Return value
SendPolyPressure
Sends a note press with an associated polyphonic pressure value.
Parameters
- BYTE Channel
- BYTE Note
- BYTE Pressure
Return value
- This call does not return a value
ReadData
No additional information
Parameters
- BYTE Idx
Return value
SendPatch
No additional information
Parameters
- BYTE Channel
- BYTE Instrument
Return value
- This call does not return a value
SendChannelPressure
No additional information
Parameters
- BYTE Channel
- BYTE Pressure
Return value
- This call does not return a value
Initialise
Initialises the MIDI component and sets up the UART.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Channel
This property is of type Fixed list of ints and can be referenced with the variable name CHANNEL.
No additional information
TX
This property is of type Single digital pin and can be referenced with the variable name TX.
No additional information
RX
This property is of type Single digital pin and can be referenced with the variable name RX.
No additional information
Label
This property is of type Line of text and can be referenced with the variable name label.
No additional information
Data Source
This property is of type Fixed list of ints and can be referenced with the variable name DataSource.
Simulation data source used to allow the component to connect to specific MIDI hardware or the the data injector components.
Injector
This property is of type Fixed list of ints and can be referenced with the variable name Injector.
Lists all the current injector components available on the user's panel