NAME

Music::ScaleNote - Manipulate the position of notes in a scale

VERSION

version 0.0302

SYNOPSIS

use Music::ScaleNote;
my $msn = Music::ScaleNote->new(
  scale_note => 'C',
  scale_name => 'pminor',
  verbose    => 1,
);
my $note = $msn->get_offset(
  note_name   => 'C4',
  note_format => 'ISO',
  offset      => 1,
);
print $note->format('ISO'), "\n"; # D#4

DESCRIPTION

A Music::ScaleNote object manipulates the position of notes in a given scale.

Given a scale, a starting note, a scale note, and a scale position offset, this module computes the new note.

So for scale C D# F G A# (C pentatonic minor), note C4, and offset 1 (move one note to the right), this module will return D#4.

For offset -1, A#3 is returned.

ATTRIBUTES

scale_note

This is the name of the note that starts the given scale.

Default: C

scale_name

This is the name of the scale to use.

Please see "SCALES" in Music::Scales for the possible names.

Default: major

note_format

The format as given by "STYLES" in Music::Note. If given in the constructor, this is used as the default in the get_offset method.

offset

The integer offset of a new scale position. If given in the constructor, this is used as the default in the get_offset method.

verbose

Show the progress of the get_offset method.

METHODS

new()

$msn = Music::ScaleNote->new(%arguments);

Create a new Music::ScaleNote object.

get_offset()

$note = $msn->get_offset(%arguments);

Return a new Music::Note object based on the given note_name, note_format and offset.

SEE ALSO

Moo

List::Util

Music::Note

Music::Scales

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 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.