NAME

MIDI::RtMidi::ScorePlayer - Play a MIDI score in real-time

VERSION

version 0.0104

SYNOPSIS

use MIDI::RtMidi::ScorePlayer ();
use MIDI::Util qw(setup_score);

my $score = setup_score();

my %common = ( score => $score, seen => {}, etc => '...', );

sub treble {
    my $treble = sub {
        ...; # Add notes or rests to the score
    };
    return $treble;
}
sub bass {
    ...; # As above
}

MIDI::RtMidi::ScorePlayer->new(
    score    => $score, # required MIDI score object
    parts    => [ \&treble, \&bass ], # required part functions
    common   => \%common, # optional arguments given to the part functions
    repeats  => 4, # number of repeated synched parts (default: 1)
    sleep    => 2, # number of seconds to sleep between loops (default: 1)
    loop     => 4, # loop limit if finite (default: 1)
    infinite => 0, # loop infinitely (default: 1)
)->play;

DESCRIPTION

MIDI::RtMidi::ScorePlayer plays a MIDI score in real-time.

METHODS

new

Instantiate a new MIDI::RtMidi::ScorePlayer object.

play

Play a given MIDI score in real-time.

SEE ALSO

The informative comments in the source of this module!

The eg/* files in this distribution.

MIDI::RtMidi::FFI::Device

MIDI::Util

Time::HiRes

AUTHOR

Gene Boggs <gene.boggs@gmail.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Gene Boggs.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)