Jump to content

Component: USB MIDI (Comms: USB): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(12 intermediate revisions by 2 users not shown)
Line 16: Line 16:


==Component Source Code==
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_USBMIDI.fcfx FC_Comp_Source_USBMIDI.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_USBMIDI.fcfx FC_Comp_Source_USBMIDI.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_USBMIDI.fcfx FC_Comp_Source_USBMIDI.fcfx]


==Detailed description==
==Detailed description==




Line 42: Line 50:


==Examples==
==Examples==




Line 65: Line 79:




==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendMIDI'''
|-
| colspan="2" | Sends a MIDI packet consisting of up to three bytes of information, 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Status
|-
| colspan="2" | MIDI Status Byte - Used for commands such as NoteOn, NoteOff etc. 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data1
|-
| colspan="2" | MIDI Data Byte - Used as a parameter specific to the specified command 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data2
|-
| colspan="2" | MIDI Data Byte - Used as a parameter specific to the specified command 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPitchChange'''
|-
| colspan="2" | Sends out a pitch change command on the specified channel. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel to send the pitch change to 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Pitch_Change
|-
| colspan="2" | New pitch value to use, Default 0x2000 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendNoteOff'''
|-
| colspan="2" | Sends a note off command using the channel, note and velocity specified. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Note
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Velocity
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
 
==Macro reference==
 
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendControl'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Sends a control command using the channel, controller and value specified. 
| colspan="2" | Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Controller
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadData===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendNoteOn'''
| width="90%" class="mtx-class-macrohead" | '''ReadData'''
|-
|-
| colspan="2" | Sends a note on command using the channel, note and velocity specified. 
| colspan="2" | Reads a byte from the last received MIDI message 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
| width="90%" | Idx
|-
|-
| colspan="2" |  
| colspan="2" | Byte to read 0-3 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Note
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Velocity
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReceiveMIDI===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveMIDI'''
| width="90%" class="mtx-class-macrohead" | '''ReceiveMIDI'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 220: Line 143:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendChannelPressure===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPolyPressure'''
| width="90%" class="mtx-class-macrohead" | '''SendChannelPressure'''
|-
|-
| colspan="2" | Sends a note press with an associated polyphonic pressure value. 
| colspan="2" |  
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
| width="90%" | Channel
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Note
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 248: Line 167:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendControl===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadData'''
| width="90%" class="mtx-class-macrohead" | '''SendControl'''
|-
|-
| colspan="2" | Reads a byte from the last received MIDI message 
| colspan="2" | Sends a control command using the channel, controller and value specified. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Idx
|-
| colspan="2" | Byte to read 0-3 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPatch'''
|-
| colspan="2" |  
|-
|-
|-
|-
Line 280: Line 182:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Instrument
| width="90%" | Controller
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendChannelPressure'''
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pressure
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 312: Line 196:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendMIDI===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | USB Properties
|-
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Vendor ID
|-
|-
| colspan="2" | USB VID 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
|-
| width="90%" class="mtx-class-macrohead" | '''SendMIDI'''
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Product ID
|-
| colspan="2" | USB PID 
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Device Name
|-
| colspan="2" | USB Device Name 
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Manufacturer
|-
| colspan="2" | USB Manufacturer 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Major Version
|-
| colspan="2" | USB Major Version Number 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Minor Version
|-
| colspan="2" | USB Minor Version Number 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Enumeration Timeout
|-
| colspan="2" | Specifies if the enumeration (Initialise function) can timeout if taking too long. 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Label
|-
| colspan="2" | Text displayed on the I/O flasher comms component. 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Source
|-
| colspan="2" | Simulation data source used to allow the component to connect to specific MIDI hardware or the the data injector components. 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | MIDI Port
|-
| colspan="2" |  
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendMIDI'''
|-
|-
| colspan="2" | Sends a MIDI packet consisting of up to three bytes of information, 
| colspan="2" | Sends a MIDI packet consisting of up to three bytes of information, 
Line 422: Line 225:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendNoteOff===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPitchChange'''
|-
| colspan="2" | Sends out a pitch change command on the specified channel. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel to send the pitch change to 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Pitch_Change
|-
| colspan="2" | New pitch value to use, Default 0x2000 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendNoteOff'''
| width="90%" class="mtx-class-macrohead" | '''SendNoteOff'''
|-
|-
| colspan="2" | Sends a note off command using the channel, note and velocity specified. 
| colspan="2" | Sends a note off command using the channel, note and velocity specified. 
Line 473: Line 254:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendNoteOn===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendControl'''
| width="90%" class="mtx-class-macrohead" | '''SendNoteOn'''
|-
|-
| colspan="2" | Sends a control command using the channel, controller and value specified. 
| colspan="2" | Sends a note on command using the channel, note and velocity specified. 
|-
|-
|-
|-
Line 487: Line 269:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Controller
| width="90%" | Note
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
| width="90%" | Velocity
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 501: Line 283:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendPatch===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendNoteOn'''
| width="90%" class="mtx-class-macrohead" | '''SendPatch'''
|-
|-
| colspan="2" | Sends a note on command using the channel, note and velocity specified. 
| colspan="2" |  
|-
|-
|-
|-
Line 515: Line 298:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Note
| width="90%" | Instrument
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Velocity
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 529: Line 307:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendPitchChange===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveMIDI'''
| width="90%" class="mtx-class-macrohead" | '''SendPitchChange'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | Sends out a pitch change command on the specified channel. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Timeout
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPolyPressure'''
|-
| colspan="2" | Sends a note press with an associated polyphonic pressure value. 
|-
|-
|-
|-
Line 558: Line 319:
| width="90%" | Channel
| width="90%" | Channel
|-
|-
| colspan="2" |  
| colspan="2" | Channel to send the pitch change to 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Note
| width="90%" | Pitch_Change
|-
|-
| colspan="2" |  
| colspan="2" | New pitch value to use, Default 0x2000 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pressure
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 575: Line 331:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendPolyPressure===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadData'''
| width="90%" class="mtx-class-macrohead" | '''SendPolyPressure'''
|-
|-
| colspan="2" | Reads a byte from the last received MIDI message 
| colspan="2" | Sends a note press with an associated polyphonic pressure value. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Idx
|-
| colspan="2" | Byte to read 0-3 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendPatch'''
|-
| colspan="2" |  
|-
|-
|-
|-
Line 607: Line 346:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Instrument
| width="90%" | Note
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendChannelPressure'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 637: Line 358:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | USB Properties
| width="90%" class="mtx-class-propfolder" | USB Properties
|-
|-
|-
|-
Line 701: Line 407:
| colspan="2" | Specifies if the enumeration (Initialise function) can timeout if taking too long. 
| colspan="2" | Specifies if the enumeration (Initialise function) can timeout if taking too long. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix Ltd.
Version 1.3
Category Comms: USB


USB MIDI component

Component to create and communicate using a standard MIDI connection. Compatible with simulation and USB enabled microcontroller devices. Currently only compatible with the 16-bit PIC range of devices.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_USBMIDI.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_USBMIDI.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

Initialise

Initialise
Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. 
- BYTE Return


ReadData

ReadData
Reads a byte from the last received MIDI message 
- BYTE Idx
Byte to read 0-3 
- BYTE Return


ReceiveMIDI

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. 
- BYTE Timeout
 
- BYTE Return


SendChannelPressure

SendChannelPressure
 
- BYTE Channel
 
- BYTE Pressure
 
- VOID Return


SendControl

SendControl
Sends a control command using the channel, controller and value specified. 
- BYTE Channel
 
- BYTE Controller
 
- BYTE Value
 
- VOID Return


SendMIDI

SendMIDI
Sends a MIDI packet consisting of up to three bytes of information, 
- 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 
- VOID Return


SendNoteOff

SendNoteOff
Sends a note off command using the channel, note and velocity specified. 
- BYTE Channel
 
- BYTE Note
 
- BYTE Velocity
 
- VOID Return


SendNoteOn

SendNoteOn
Sends a note on command using the channel, note and velocity specified. 
- BYTE Channel
 
- BYTE Note
 
- BYTE Velocity
 
- VOID Return


SendPatch

SendPatch
 
- BYTE Channel
 
- BYTE Instrument
 
- VOID Return


SendPitchChange

SendPitchChange
Sends out a pitch change command on the specified channel. 
- BYTE Channel
Channel to send the pitch change to 
- UINT Pitch_Change
New pitch value to use, Default 0x2000 
- VOID Return


SendPolyPressure

SendPolyPressure
Sends a note press with an associated polyphonic pressure value. 
- BYTE Channel
 
- BYTE Note
 
- BYTE Pressure
 
- VOID Return


Property reference

Properties
USB Properties
Vendor ID
USB VID 
Product ID
USB PID 
Device Name
USB Device Name 
Manufacturer
USB Manufacturer 
Major Version
USB Major Version Number 
Minor Version
USB Minor Version Number 
Enumeration Timeout
Specifies if the enumeration (Initialise function) can timeout if taking too long. 
Simulation
Label
Text displayed on the I/O flasher comms component. 
Data Source
Simulation data source used to allow the component to connect to specific MIDI hardware or the the data injector components. 
MIDI Port