LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-06-2014, 10:17 AM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 546

Rep: Reputation: 37
newbie: send midi signal from console


how does one send a midi 'start play' signal from a linux console? I've been searching google but can't find a command example.
I'm using fedora 20 with an Emu 2x2 midi box which shows up as /dev/midi1.
I did find this:
https://ccrma.stanford.edu/~craig/ar.../section1.html
but when I try to run the method 1 example there I get:
Quote:
./midi.sh: line 6: syntax error near unexpected token `('
./midi.sh: line 6: `int main(void) {'
I'm not clever with scripts. Thanks for any advice.
 
Old 11-06-2014, 01:14 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
it's not a shell script, it's a C program, which would need to be compiled first.

i guess it's not really what you're looking for.

do you already have other software installed to control your midi?
then chances are it can also be operated from the command line.

other than that, a quick search revealed this.

but maybe you'd like to explain the bigger picture in more detail, you might get better help.
what are you trying to achieve?
 
Old 11-06-2014, 01:29 PM   #3
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
thanks for your response. Yes I worked out that the script I mentioned above is a C program (red faced). I was able to run it though using '#gcc midi.c' but it didn't do anything. The E-mu 2x2 midi device when connected produces two new entries in /dev which are /dev/dmmidi1 and /dev/midi1 although neither worked when the fedora pc tried to talk to them with the script.
I have a fedora 20 pc connnected by usb to the E-mu 2x2 and a midi sequencer connected to the midi-out port of the E-mu 2x2. What I'm trying to do is send a 'start play' signal to the sequencer so it starts playing the song it has loaded. In fact I'm trying to send anything I can to the sequencer just to veryify a connection. There are lights on the E-mu device that are supposed to show midi activity in and out but they don't flash at all.
I want to send basic midi events to the sequencer via the E-mu box but so far no luck. I don't care about fancy midi programs and the like, I just want to start at console level with single events. Thanks for any further advice.
 
Old 11-07-2014, 01:40 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by tonj View Post
I don't care about fancy midi programs and the like, I just want to start at console level with single events.
well, maybe you could still try some multimedia distro from a usb stick and see how it works there.
or just generally have a look here:
http://linuxaudio.org/ and here:
http://wiki.linuxaudio.org/apps/cate.../distributions
 
Old 11-07-2014, 01:53 PM   #5
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
thankyou ondoho I don't see how a multimedia distro will give me the answer I'm looking for, which is at command line level. Thankyou for those links however, maybe one of them will give me a new avenue to search.
 
Old 11-07-2014, 02:07 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by tonj View Post
I don't see how a multimedia distro will give me the answer I'm looking for, which is at command line level.
i just don't think it's as simple as sending data to /dev/midi.
have to get aquainted with the subject.
might be the hardware misses a driver.
 
Old 11-07-2014, 02:15 PM   #7
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
the hardware is recognised and working fine because I can play a midi file and send it to the external sequencer using pmidi, and the E-mu is known to work with linux out-of-the-box, no driver is missing. A start-play signal is nothing more than a few bits of data sent to the midi external device. There's got to be a way to trigger this simple thing by command line.
 
Old 11-07-2014, 04:36 PM   #8
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
for anyone else struggling with this problem here is the magic command:

first establish the midi ports:
Quote:
# amidi -l
IO hw:<x,x,x> <midi device name>
in my case this was:

Quote:
# amidi -l
Dir Device Name
IO hw:1,0,0 E-MU Xmidi 2x2 MIDI 1
IO hw:1,0,1 E-MU Xmidi 2x2 MIDI 2
I had my sequencer connected to port MIDI 1 so....

Quote:
start:
amidi -p hw:1,0,0 -S 'FA'

stop
amidi -p hw:1,0,0 -S 'FC'

continue
amidi -p hw:1,0,0 -S 'FB'
thanks to this page for the midi data:
http://www.cs.cf.ac.uk/Dave/Multimedia/node158.html
 
Old 11-11-2014, 07:20 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
that's pretty cool.
thanks for sharing the solution!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What tool to use to send MIDI events? TITiAN Linux - Software 1 12-19-2009 12:32 PM
Not able to send the signal through browser pandy047 Linux - Software 1 12-15-2009 12:18 PM
Send 5VDC signal from PC darkxer0x Programming 10 10-26-2009 05:03 PM
Send BRAKE signal in Open BootPROM via CONSOLE ? czezz Solaris / OpenSolaris 1 06-11-2007 05:22 PM
how to send a signal to a thread stephenwalter Programming 2 10-17-2005 01:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration