NAME
MIDI::RtController::Filter::Gene - Gene's RtController filters
VERSION
version 0.0101
SYNOPSIS
use
MIDI::RtController ();
use
MIDI::RtController::Filter::Gene ();
my
$rtc
= MIDI::RtController->new;
# * input/output required
my
$rtf
= MIDI::RtController::Filter::Gene->new(
rtc
=>
$rtc
);
$rtc
->add_filter(
'foo'
,
note_on
=>
$rtf
->can(
'foo'
));
$rtc
->run;
DESCRIPTION
MIDI::RtController::Filter::Gene
is the collection of Gene's MIDI::RtController filters.
ATTRIBUTES
rtc
$rtc
=
$rtf
->rtc;
The required MIDI::RtController instance provided in the constructor.
pedal
$pedal
=
$rtf
->pedal;
$rtf
->pedal(
$note
);
The note used by the pedal-tone filter.
Default: 55
Which is the MIDI-number for G below middle-C.
channel
$channel
=
$rtf
->channel;
$rtf
->channel(
$number
);
The current MIDI channel (0-15, drums=9).
Default: 0
delay
$delay
=
$rtf
->delay;
$rtf
->delay(
$number
);
The current delay time.
Default: 0.1
seconds
velocity
$velocity
=
$rtf
->velocity;
$rtf
->velocity(
$number
);
The velocity (or volume) change increment (0-127).
Default: 10
feedback
$feedback
=
$rtf
->feedback;
$rtf
->feedback(
$number
);
The feedback (0-127).
Default: 1
offset
$offset
=
$rtf
->offset;
$rtf
->offset(
$number
);
The note offset number.
Default: -12
key
$key
=
$rtf
->key;
$rtf
->key(
$number
);
The MIDI number of the musical key.
scale
$scale
=
$rtf
->scale;
$rtf
->scale(
$name
);
The name of the musical scale.
intervals
$intervals
=
$rtf
->intervals;
$rtf
->intervals(\
@intervals
);
The voice intervals used by Music::VoiceGen and the chord_tone
filter.
arp
$arp
=
$rtf
->arp;
$rtf
->arp(\
@notes
);
The list of MIDI numbered pitches used by the arp_tone
filter.
arp_types
$arp_types
=
$rtf
->arp_types;
$rtf
->arp_types(\
@strings
);
A list of known arpeggiation types.
Default: [up, down, random]
arp_type
$arp_type
=
$rtf
->arp_type;
$rtf
->arp_type(
$string
);
The current arpeggiation type.
Default: up
METHODS
All filter methods must accept the object, a delta-time, and a MIDI event ARRAY reference, like:
sub
pedal_tone (
$self
,
$dt
,
$event
) {
my
(
$event_type
,
$chan
,
$note
,
$value
) =
$event
->@*;
...
return
$boolean
;
}
A filter also must return a boolean value. This tells MIDI::RtController to continue processing other known filters or not.
pedal_tone
pedal,
$note
,
$note
+ 7
Where the pedal is the object attribute.
chord_tone
Play a diatonic chord based on the given event note, key and scale attributes.
delay_tone
Play a delayed note, or series of notes, based on the given event note and delay attribute.
offset_tone
Play a note and an offset note given the offset value.
walk_tone
Play a chaotically walking, quasi-melody starting with the event note. The number of notes in the "melody" is the feedback setting.
arp_tone
Play a series of subsequently pressed notes based on the feedback setting.
SEE ALSO
AUTHOR
Gene Boggs <gene.boggs@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2025 by Gene Boggs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.