NAME
Music::MelodicDevice::Ornamentation - Chromatic and diatonic melodic ornamentation
VERSION
version 0.0400
SYNOPSIS
use Music::MelodicDevice::Ornamentation;
my $md = Music::MelodicDevice::Ornamentation->new; # chromatic
$md = Music::MelodicDevice::Ornamentation->new( # diatonic
scale_note => 'C',
scale_name => 'major',
verbose => 1,
);
my $spec = $md->grace_note('qn', 'D5', -1);
$spec = $md->turn('qn', 'D5', 1);
$spec = $md->trill('qn', 'D5', 2, 1);
$spec = $md->mordent('qn', 'D5', 1);
DESCRIPTION
Music::MelodicDevice::Ornamentation
provides chromatic and diatonic musical melodic ornamentation methods.
ATTRIBUTES
scale_note
Default: C
scale_name
Default: chromatic
For the chromatic scale, enharmonic notes are listed as sharps. For a scale with flats, a diatonic scale_name must be used with a flat scale_note.
Please see "SCALES" in Music::Scales for a list of valid scale names.
verbose
Default: 0
Show the progress of the methods.
METHODS
new
$x = Music::MelodicDevice::Ornamentation->new(
scale_note => $scale_note,
scale_name => $scale_name,
verbose => $verbose,
);
Create a new Music::MelodicDevice::Ornamentation
object.
grace_note
$spec = $md->grace_note($duration, $pitch, $offset);
Default offset: 1
"Appoggiatura" means emphasis on the grace note. "Acciaccatura" means emphasis on the main note. This module doesn't accent notes. You'll have to do that bit.
turn
$spec = $md->turn($duration, $pitch, $offset);
The note Above, the Principle note (the pitch), the note Below, the Principle note again.
The default offset is 1
, but if given as -1
, the turn is "inverted" and goes: Below, Principle, Above, Principle.
trill
$spec = $md->trill($duration, $pitch, $number, $offset);
A trill is a number of pairs of notes spread over a given duration. The first of the pair being the given pitch and the second one given by the offset.
Default number: 2
Default offset: 1
mordent
$spec = $md->mordent($duration, $pitch, $offset);
"A rapid alternation between an indicated note [the pitch], the note above or below, and the indicated note again."
An offset of 1
(the default) returns an upper mordent one pitch away. An offset of -1
returns a lower mordent.
So if the pitch is D5
, a diatonic upper mordent would be D5 E5 D5
. A chromatic lower mordent would be D5 C#5 D5
.
SEE ALSO
The t/01-methods.t and eg/* programs in this distribution
https://en.wikipedia.org/wiki/Ornament_(music)
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 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.