equivalents of aplaymidi ?

  • Follow


Hi :-)  I've got this code in my MIDI.py and MIDI.lua
which plays a score by piping the midi into "aplaymidi -"
and this works fine in linux...
Is there a corresponding command (or an OS system-call)
on other platforms like macos or ms or android etc,
which I could look for if aplaymidi isn't present ?

Peter

-- 
Peter Billam       www.pjb.com.au    www.pjb.com.au/comp/contact.html
0
Reply Peter 1/18/2011 4:25:40 AM

In article <slrnija5i3.24i.peter@box8.pjb.com.au>,
Peter Billam  <contact.html@www.pjb.com.au> wrote:
>Hi :-)  I've got this code in my MIDI.py and MIDI.lua
>which plays a score by piping the midi into "aplaymidi -"
>and this works fine in linux...
>Is there a corresponding command (or an OS system-call)
>on other platforms like macos or ms or android etc,
>which I could look for if aplaymidi isn't present ?

Do you really need aplaymidi at all, even in Linux?  I do what sounds
like similar things without ever having to go through that app.
I just use the virmidi ports.

For example, when I was playing with the "bagpipe emulator" in Ruby,
I did something like "bagpipe.rb </dev/snd/midiC2D0 >/dev/snd/midiC2D0"
to access the 'raw' ends of the virmidi port, and then to connect with
external MIDI (Client 20) I had:

  aconnect 20 24
  aconnect 24 20

and I could play my keyboard in and get events out to [sort of!] give
me a bagpipe sound in the synth.

I do the same sort of thing when I pass raw events over the net to drive
pjbsynth...  (I've never found that Csound knows anything about Sequencer
ports.  Unless you know something I don't...)

The main thing an OS would seem to need is some way of passing 'stdout'
or the equivalent into the MIDI system.  The Mac has a 'MidiPatchBay'
app (I came across it while researching a query on csounds.com --
did you ever get subscribed BTW?) which will connect MIDI apps together,
but whether it can handle stdio, I don't know.  Windows -- as usual I have
no idea.

Cheers,
	-- Pete --


-- 
============================================================================
The address in the header is a Spam Bucket -- replies will not be seen...
(If you do need to email, replace the account name with my true name.)
============================================================================
0
Reply neverland 1/18/2011 7:22:42 AM


In article <tu-dneFWI5ZfoqjQnZ2dnUVZ_qadnZ2d@lmi.net>,
I wrote:
>In article <slrnija5i3.24i.peter@box8.pjb.com.au>,
>Peter Billam  <contact.html@www.pjb.com.au> wrote:
>>Hi :-)  I've got this code in my MIDI.py and MIDI.lua
>>which plays a score by piping the midi into "aplaymidi -"
>>and this works fine in linux... [....]
>
>Do you really need aplaymidi at all, even in Linux?  I do what sounds
>like similar things without ever having to go through that app.
>I just use the virmidi ports.

Ohh -- waittaminnit... Are you piping  midi events, or a standard SMF
"file"?  If the former, I wasn't really aware that aplaymidi would do that.
If the latter, I'm even more surprised (:-)).  That's pretty cute
to be able to decode SMF in real time.  (I've always decoded the file
-- especially a multitrack one -- into memory first.)

More details, please... (:-))

	-- Pete --


-- 
============================================================================
The address in the header is a Spam Bucket -- replies will not be seen...
(If you do need to email, replace the account name with my true name.)
============================================================================
0
Reply neverland 1/18/2011 8:30:39 AM

On 2011-01-18, Pete <neverland@GOODEVEca.net> wrote:
> In article <tu-dneFWI5ZfoqjQnZ2dnUVZ_qadnZ2d@lmi.net>,
> I wrote:
>>In article <slrnija5i3.24i.peter@box8.pjb.com.au>,
>>Peter Billam  <contact.html@www.pjb.com.au> wrote:
>>>Hi :-)  I've got this code in my MIDI.py and MIDI.lua
>>>which plays a score by piping the midi into "aplaymidi -"
>>>and this works fine in linux... [....]
>>
>>Do you really need aplaymidi at all, even in Linux?  I do what sounds
>
> Ohh -- waittaminnit... Are you piping  midi events, or a standard
> SMF "file"?

Yes, it's SMF bytes that you could equally well write to f.mid
The typical aplaymidi command is    aplaymidi f.mid    but
aplaymidi -   slurps the stdin instead of reading the disc.

> That's pretty cute to be able to decode SMF in real time.

aplaymidi is actually a very thin program, it just feeds the SMF
bytes straight through to /dev/snd/seq  which does all the timing
work (AFAICS) ...

Executive summary: it's a standard SMF "file" ...

Regards,  Peter

-- 
Peter Billam       www.pjb.com.au    www.pjb.com.au/comp/contact.html
0
Reply Peter 1/18/2011 9:55:04 AM

On 2011-01-18, Pete <neverland@GOODEVEca.net> wrote:
> The main thing an OS would seem to need is some way of passing 'stdout'
> or the equivalent into the MIDI system.  The Mac has a 'MidiPatchBay'
> app (I came across it while researching a query on csounds.com --
> did you ever get subscribed BTW?)

Yes :-)  I'm subscribed, and have read through most of the
Journals (*) but haven't posted to a forum yet.  The traffic
is frighteningly low-volume.  My first question will be how
do I receive changes to Registered Parameters; there are:
  midichannelaftertouch midicontrolchange midinoteonoct 
  midipitchbend  midipolyaftertouch  midiprogramchange
but no midiregisteredparam :-(
and yet there must be a registeredparam mechanism in csound,
because if I send it a cc100, then a subsequent cc6 is not
seen by   midicontrolchange 6   ! so the cc100 command must
have triggered some registeredparam code somewhere...

(*) including Jim Hearon's
    http://www.csounds.com/journal/issue10/BasicAnlSynthDesigns.html
   "it is always tempting to employ Csound for the purpose of building the
    world's most versatile and expansive virtual synthesizer; but honestly,
    in my opinion, if working on the algorithmic orchestra and score level,
    it is better not to think of Csound as a tool for application building"
 which, like, er, doesn't specifically encourage stuff like pjbsynth...

Peter

-- 
Peter Billam       www.pjb.com.au    www.pjb.com.au/comp/contact.html
0
Reply Peter 1/18/2011 10:19:16 AM

the pc which have windows xp etc
use a low level device call
 the multi media driver
 winmm.dll is referneced  using the api....which is all kinda new to
me because i spent years writng my midi stuff on the atari ,  but
anyhow
then on pc use the call

midi open
midi connect
midistream out

etc
theres a whole bunch of the commands which need included
and i haven't figured them all out yet

but this should answer your question yes there is aother command which
pipes midi  out  ,,

i only have experience pc windows or atari st

charles
0
Reply CharlieC 1/18/2011 2:12:29 PM

In article <slrnijaoro.2pt.peter@box8.pjb.com.au>,
Peter Billam  <contact.html@www.pjb.com.au> wrote:
>On 2011-01-18, Pete <neverland@GOODEVEca.net> wrote:
>> In article <tu-dneFWI5ZfoqjQnZ2dnUVZ_qadnZ2d@lmi.net>,
>> I wrote:
>>>In article <slrnija5i3.24i.peter@box8.pjb.com.au>,
>>>Peter Billam  <contact.html@www.pjb.com.au> wrote:
>>>>Hi :-)  I've got this code in my MIDI.py and MIDI.lua
>>>>which plays a score by piping the midi into "aplaymidi -"
>>
>> Ohh -- waittaminnit... Are you piping  midi events, or a standard
>> SMF "file"?
>
>Yes, it's SMF bytes that you could equally well write to f.mid
>The typical aplaymidi command is    aplaymidi f.mid    but
>aplaymidi -   slurps the stdin instead of reading the disc.
>
>> That's pretty cute to be able to decode SMF in real time.
>
>aplaymidi is actually a very thin program, it just feeds the SMF
>bytes straight through to /dev/snd/seq  which does all the timing
>work (AFAICS) ...
>

You got me curious, so I did some experimenting.  It seems that
aplaymidi *is* decoding the whole file (or stream) first before
it outputs anything.  (my initial reading of your post was that
you were generating events in realtime, but I guess what you're
actually doing is "just-in-time" generation of a midifile and
playing that.)  This is roughly what I tried:

Set seqdump (client 128) running in a window, so I can see events
as they're produced.

First try "cat my.mid|aplaymidi -p 128 -"
As expected a sequence of events with appropriate timing is
generated.

Then split my.mid into a couple of chunks: my.aa and my.ab.
"cat my.aa my.ab|aplaymidi -p 128 -" does the same as the above.

*Then* do "cat my.aa - my.ab|aplaymidi -p 128 -" -- i.e put a
stdin in the middle of the cat sequence.  This time seqdump shows
the port being subscribed immediately, but nothing else happens
until I type ctrl-D to end the (empty) stdin; at that point the
whole sequence begins.

I also tried cat'ing just the first chunk, which gave me (only) a
format error from aplaymidi, so it was obviously not trying to
output any events before getting EOF.

So I guess aplaymidi is handling a midifile much like any other
player.  For your needs, then, all an app on another OS has to be
able to do is read a midifile from standard input rather than
directly as a file.  I'd imagine any program that can be run
from the command line could do that.

Cheers,
	-- Pete --


-- 
============================================================================
The address in the header is a Spam Bucket -- replies will not be seen...
(If you do need to email, replace the account name with my true name.)
============================================================================
0
Reply neverland 1/18/2011 10:24:13 PM

In article <slrnijaq93.2tl.peter@box8.pjb.com.au>,
Peter Billam  <contact.html@www.pjb.com.au> wrote:
>On 2011-01-18, Pete <neverland@GOODEVEca.net> wrote:
>>                                           [....]   csounds.com --
>> did you ever get subscribed BTW?)
>
>Yes :-)  I'm subscribed, and have read through most of the
>Journals (*) but haven't posted to a forum yet.  The traffic
>is frighteningly low-volume.
Yes, it is (:-().  And when a query is posted in a forum, I seem
to be one of very few people who try to answer.  I suspect the
learning curve is just too steep for the majority to get interested.
And I think one does have to enjoy frustration to work with it!

>                              My first question will be how
>do I receive changes to Registered Parameters;
Good point.  I suspect there are still a few things like that
which have not been quite thought through.

>
>(*) including Jim Hearon's
>    http://www.csounds.com/journal/issue10/BasicAnlSynthDesigns.html
>   "it is always tempting to employ Csound for the purpose of building the
>    world's most versatile and expansive virtual synthesizer; but honestly,
>    in my opinion, if working on the algorithmic orchestra and score level,
>    it is better not to think of Csound as a tool for application building"
> which, like, er, doesn't specifically encourage stuff like pjbsynth...

Heck, that just one guy's opinion!  I'd say Csound is for whatever
you want it to do.  And I assume by 'algorithmic' he means that style
of music creation, which, frankly, is not of particular interest to
me.  It's probably a deficiency on my part that I've never really
had the patience to sit down and create a score with a text-editor,
or even more to write a program to generate music algorithmically.
I like to hit notes on my keyboard and hear interesting sounds come
out!  Though also I realize that a score can do things that you
can't do real-time, and someday I hope I can kick myself into
experimenting with that.

And (frankly again) I'm often underwhelmed by the podcasts posted
on the site.  Because I'm a fan of melody and rhythm [and fully
realize that this is almost certainly a learned preference!] I
don't connect with much 'experimental music'.  I know the folks
at CNMAT here at Berkeley, and I often go to their various seminars.
I usually find the hardware and software demonstrated fascinating,
but the sounds that they produce (which seem to appeal to others)
just don't register with me as "music".

And as far as synths and things go, a lot of the core Csounders
seem to have written such instruments.  Hans Mikelson, for instance,
wrote several 'organs' and things, including the predecessor to
my own "Hammond".

Cheers,
	-- Pete --


-- 
============================================================================
The address in the header is a Spam Bucket -- replies will not be seen...
(If you do need to email, replace the account name with my true name.)
============================================================================
0
Reply neverland 1/18/2011 10:53:11 PM

On 2011-01-18, CharlieC <charles.copp@sympatico.ca> wrote:
> the pc which have windows xp etc
> use a low level device call
>  the multi media driver
>  winmm.dll is referneced  using the api....which is all kinda new to
> me because i spent years writng my midi stuff on the atari ,  but
> anyhow  then on pc use the call
> midi open
> midi connect
> midistream out

Just for completeness, I should mention the Perl CPAN Win32API-MIDI 
  http://search.cpan.org/dist/Win32API-MIDI/
which includes the file MIDI.xs
  http://cpansearch.perl.org/src/HAYASHI/Win32API-MIDI-0.05/MIDI.xs
which seems to contain the necessary API calls.  I find I don't
enjoy decyphering C as much as I used to...

Peter

-- 
Peter Billam       www.pjb.com.au    www.pjb.com.au/comp/contact.html
0
Reply Peter 1/24/2011 12:08:57 AM

there is a program which may help
http://www.jabaco.org/index.php?page=webcast

apparently it can take a vb source , and be used on linux , is like a
dual java /vb self contained compilier editor

this might cut the translation time , find a good vb project

use on linux

charles
0
Reply CharlieC 1/24/2011 3:48:07 PM

 Hello! daabgaa interesting daabgaa site!

-- 

questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it


0
Reply johnf421 5/16/2011 3:09:54 PM

10 Replies
263 Views

(page loaded in 0.151 seconds)

Similiar Articles:

7/16/2012 1:53:35 PM


Reply: