MIDI::Realtime and sblive with linux

[email protected] (zentara) Mon, 31 Mar 2003 17:57:01 -0500
Newsgroups perl.midi
Message-ID <[email protected]>
Hi,
I'm using linux 2.4.20, perl5.8, with alsa, and a sblive soundcard.

My midi plays fine.
I can play a midi with "pmidi -p65:0 somefile.mid"

I can also use timidity by itself or as a server to
play midi files.

But I can't get Realtime::MIDI to play, and was wondering
if anyone knows where I should look.

The script below gives me a warning:
"Operator or semicolon missing before &__foo_bar___ at (eval 471) line1.
Ambiguous use of & resolved as operator & at (eval 471) line 1."

But I don't think that is the cause .

The sample script (acts like it's running, but no sound):
#####################################################
#!/usr/bin/perl
use warnings;
use MIDI::Realtime;

my $midi = MIDI::Realtime->new(dev => '/dev/sequencer',
                       midi_device => 0,
                                   );

# Play note 47 with maximum velocity on channel 1
$midi->note(47, 127, 1);

# Now have some fun with randomness
my @notes      = (37 .. 50);
# use all the channels (with extra drums)
my @channels   = (1 .. 16, 10, 10, 10);
my @velocities = (70 .. 100);

for (0 .. 127) {
$midi->note($notes[rand(@notes)],
$channels[rand(@channels)],
$velocities[rand(@velocities)]
);

# Wait for a tenth of a second
select(undef,undef,undef, 0.10);
}
####################################################



"What comes out your mouth is more important than what goes in"
 -- russian vodka drinker