Kara-Moon Forum
April 20, 2024, 08:33:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Configuring aplaymidi  (Read 8622 times)
alexis
Jr. Member
*
Posts: 62


« on: July 20, 2011, 02:24:40 PM »

Hi again,

I'm trying to get MMA play a midi file, for example to get the preview of a groove:

Code:
mma -V Waltz


But it doesn't play and I get this message :

Code:
Creating new midi file (4 bars, 0.10 min): 'MMAtmp6024.mid'
Playing MIDI 'MMAtmp6024.mid' with aplaymidi.
[b]Please specify at least one port with --port.[/b]
Play complete (0.00 min), file has been deleted.

You have to specify a port to aplaymidi.
You get the port list like this :
Code:
 aplaymidi -l

This command returns :
Code:
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
128:0    TiMidity                         TiMidity port 0
128:1    TiMidity                         TiMidity port 1
128:2    TiMidity                         TiMidity port 2
128:3    TiMidity                         TiMidity port 3

So you must tell MMA to include the port number in the command line passed to aplaymidi.

For this, I've created a mmarc file in my current dir:
Code:
SetMIDIplayer aplaymidi --port=128:0

But when trying to play a mma file, I have this message:
Code:
ERROR:<Line 1><File:mmarc>
     SetMidiPlayer: unknown option '--PORT'.

So my question is: how can I specify this timidity port without hacking MMA?

I'm using MMA stable version (1.7) with Ubuntu Natty 64 bits, and Timidity running against Pulse Audio.

Thanks!

Greeting from France,

Alexis
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #1 on: July 20, 2011, 04:34:13 PM »

Good one ... you forced me to scratch my head on this one.

Here's the problem: when you call SetMidiPlayer it presumes that xx=xx is a command pair for its command. This means that you cannot have a command like --port=something. I think I'll need to look at this and see if i can figure an alternate.

However, in the meantime, use -p.

So, you can have a line

    SetmidiPlayer aplaymidi -p20:0

and it'll work.

Suggestions on the '=' issue are welcome!

Best,
Logged

My online life: http://www.mellowood.ca
alexis
Jr. Member
*
Posts: 62


« Reply #2 on: July 20, 2011, 05:19:02 PM »

Again, thanks for your help. It works now wOO  Smiley

I could have figured out this parameter simplified syntax alone! Embarrassed

BTW, looking at MMA manual, I have a question about RC files.
I read in page 199:
Quote
\˜{}/.mmarc —this is an “invisible” file in the users home directory.

What does the "\˜{}/. " mean? Is it kind of regular expression?
For hidden file in user directory, I would simply have written:
Code:
~/.mmarc

Thanks

Alexis
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #3 on: July 20, 2011, 09:22:56 PM »

That's called a misprint Smiley

I needed the {} and \ at one point to keep latex happy. Then, later, I wrapped it in another latex function which didn't need it.

Anyway, thanks for pointing it out. Fixed in the next version.

Best,
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #4 on: August 12, 2011, 04:56:58 PM »

I've just had a look at the problem with passing args to the midi player. This is a simple fix which works:

In line 58 of player.py change:

  if '=' in l:

to

 if '=' in l and l[0].isalpha():

This limits the mma variable checks to things starting with a..z (which I can control). Things like "--port=foo" or "/windowoption=123" will now be be passed to the command, not assumed to be a mma setting.

This will be part of the next developer edition.
Logged

My online life: http://www.mellowood.ca
alexis
Jr. Member
*
Posts: 62


« Reply #5 on: August 16, 2011, 10:14:21 AM »

I've just had a look at the problem with passing args to the midi player. This is a simple fix which works:

In line 58 of player.py change:

  if '=' in l:

to

 if '=' in l and l[0].isalpha():

This limits the mma variable checks to things starting with a..z (which I can control). Things like "--port=foo" or "/windowoption=123" will now be be passed to the command, not assumed to be a mma setting.

This will be part of the next developer edition.


Thanks for this fix, Bob.

Alexis
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.053 seconds with 19 queries.