Skip to content
Related Articles

Related Articles

amidi Command in Linux with Examples
  • Last Updated : 24 Jul, 2020

amidi command in Linux is used to receive and send SysEx i.e System Exclusive data from or to external MIDI devices. Other MIDI commands can also be sent using this amidi command. One thing that is important to note about this amidi command is that it only handles files that contain raw MIDI commands that too without timing information. And one more thing about this command is that it doesn’t support standard MIDI(.mid) files, but aplaymidi(1) and arecordmidi(1) do support. 

Synatx: 

amidi -[option]... [action] 

Working with amidi command 

1.Print list of options

Enter the following command to print the list of options.

amidi --help

The command will display the help section of the command which will list all the options of the command.



 

2. Print the version 

amidi --version

The command will return the version number of the amidi command.

 

3. To print all the hardware MIDI ports 

amidi --list-devices

The above command will display all the ports or devices connected to the MIDI and its related ports.
 



4. To print all RawMIDI definitions

amidi --list-rawmidis

This command will print the definition of the RawMIDI which would be having the list of card and its properties in Structural form.
 

5.   To stop receiving data when no data has been received for the specified amount of time.

timeout 5 ping google.com

This will result into a timeout of session after 5 seconds of inactivity.

6. To stop Active Sensing Bytes(FEh) when saving or printing received MIDI command.

--active-sensing , -a 

This command will stop the FEh Active Sensing Bytes every time user saves or prints the received MIDI command.

7. To send the content of specified file to the MIDI port

amidi -p hw:0 -s my_settings.syx

The above command will send the content of specified file to the MIDI port and also that file must contain raw MIDI  commands and for the standard MIDI files use aplaymidi. 

8. To send the bytes specified as hexadecimal number to the MIDI port
 

amidi -S 'F0 43 10 4C 00 00 7E 00 F7'

The above command will send the bytes specified as hexadecimal number to the MIDI port. And will send an XG Reset to the default port 

9. To set the name of the ALSA RawMIDI port to use

amidi -p hw:0 -s my_settings.syx

The above command will set the name of the ALSA RawMIDI port to use. If not specified, amidi used default port defines in the config file(default for this port 0 on card 0) and will send the MIDI commands in my_settings.syx to port hw:0

10.  To print the data received from the MIDI port as hexadecimal bytes

amidi -p virtual -d

The above command will print the data received from the MIDI port as hexadecimal bytes. This option is very useful when it comes to debugging. This command will create a virtual RawMIDI port and will print all data sent to this port.

11. To write data received from the MIDI port into the specified file

--receive=filename , -r
Example : sends a "Parameter Dump Request" to a GS device, saves the 
received parameter data to the file dump.syx, and stops after 
the device has finished sending data (when no data has been 
received for one second). 

 amidi -p hw:1,2 -S F0411042110C000000000074F7 -r dump.syx -t 1

The above command will send a “Parameter Dump Request” to a GS device, and will save the received parameter data to the file dump.syx and will also stopp after the device has finished sending data(in case no data has been received for one second).

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :