Kara-Moon Forum
April 19, 2024, 04:37:15 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: MMA as a filter  (Read 5684 times)
sciurius
Sr. Member
****
Posts: 443



« on: August 18, 2013, 08:22:37 PM »

From the docs, section 2.3:

Quote
MMA is designed to read and write files; it is not a filter.

Writing MIDI data to standard output is not practical, but it would be nice if MMA could read its input from standard input. I have some tools that generate MMA input data and it would be handy to pass the data directly to MMA instead of having to write temporary files.

Suggestion: If no input file is present, read standard input. -f option is required in this case.
Alternative: Allow standard input represented by a lone dash. -f option is required in this case.

Priority: Low.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #1 on: August 19, 2013, 12:28:41 AM »

I have added this to the TODO list.

It's not quite as simple as one might think .... or perhaps it is. A matter of bypassing a number sanity tests and, probably, adding new ones. I had a quick look and it's probably not to big a deal. I'll have look when I have a bit more time.

Seriously, it is a good suggestion.
Logged

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


WWW
« Reply #2 on: August 25, 2013, 12:04:08 AM »

Took a few hours to do this. Seems to work fine.

 - can a few you test the newest developer version an verify

 - if you have some cool scripts which create a mma input on-the-fly and send it to mma via a pipe, could you post them here for others to marvel at

Best to all.
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #3 on: August 26, 2013, 08:53:17 AM »

As far as I can see the standard input functionality works fine. Good job!

A minor point for improvement is the error message:

Code:
mma - < q.mma
ERROR:     No filename given, assuming STDIN. Use -f to set an output filename.

Since you need to explicitly specify STDIN using the single dash, I'd suggest "ERROR: Input from STDIN specified. Use -f to set an output filename.".

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


WWW
« Reply #4 on: August 26, 2013, 04:47:24 PM »


Code:
mma - < q.mma
ERROR:     No filename given, assuming STDIN. Use -f to set an output filename.

Since you need to explicitly specify STDIN using the single dash, I'd suggest "ERROR: Input from STDIN specified. Use -f to set an output filename.".



Ahh, yes ... done. I'd written this on my first coding pass to use "no filename == stdin" but I didn't like it. Too easy for a user to forget the filename and get an "unusual" error message. And since the majority of users will never use this option, the explicit "-" seems to make more sense.

Thanks.
Logged

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


WWW
« Reply #5 on: September 01, 2013, 03:41:52 PM »

I've found a minor bug in the latest caused by stdin code. It shows up with the library update options. I have it fixed at my end and will put up a new version (devl) in a few days.
Logged

My online life: http://www.mellowood.ca
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.