NAME

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

VERSION

version 0.0500

SYNOPSIS

use Music::ScaleNote;
use Music::Note;

my $msn = Music::ScaleNote->new(
  scale_note => 'C',
  scale_name => 'pminor',
  verbose    => 1,
);

my $note = $msn->get_offset( note_name => 'C4' );

print $note->format('ISO'), "\n"; # D#4

DESCRIPTION

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

Given a scale_name, a scale_note, a starting note_name, the note_format, and a scale position offset, this module computes the new note.

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

For offset -1, A#3 is returned.

The note_format determines how the note_name is given, and the default is ISO.

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.

Default: ISO

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.

Default: 1

verbose

Show the progress of the get_offset method.

Default: 0

METHODS

new()

$msn = Music::ScaleNote->new(
  scale_note  => $scale_start_note,
  scale_name  => $scale_name,
  verbose     => $boolean,
  note_format => $format,
  offset      => $integer,
);

Create a new Music::ScaleNote object.

get_offset()

$note = $msn->get_offset(
  note_name   => $formatted_note_name,
  note_format => $format,
  offset      => $integer,
);

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.