Module: MusicUtils
- Includes:
- Scales
- Defined in:
- lib/music-utils.rb,
lib/music-utils/version.rb,
lib/music-utils/note/note.rb,
lib/music-utils/errors/error.rb,
lib/music-utils/scales/scales.rb,
lib/music-utils/errors/std_error.rb,
lib/music-utils/interval/interval.rb,
lib/music-utils/errors/note_errors.rb,
lib/music-utils/errors/interval_errors.rb
Overview
Music utils
Defined Under Namespace
Modules: Errors, Scales Classes: Interval, InvalidInterval, InvalidNote, Note, StdError
Constant Summary collapse
- VERSION =
'1.2.3'
Constants included from Scales
Scales::AUG, Scales::AUGP, Scales::CROMATIC_SCALE, Scales::DFLAT, Scales::DIATONIC_SCALE, Scales::DIATONIC_SCALE_AUX, Scales::DIM, Scales::DIMP, Scales::DO, Scales::DOF, Scales::DOFF, Scales::DOS, Scales::DOSS, Scales::DSHARP, Scales::FA, Scales::FAF, Scales::FAFF, Scales::FAS, Scales::FASS, Scales::FLAT, Scales::LA, Scales::LAF, Scales::LAFF, Scales::LAS, Scales::LASS, Scales::MAJ, Scales::MAJ_SCALE, Scales::MELODIC_MIN_SCALE, Scales::MI, Scales::MIF, Scales::MIFF, Scales::MIN, Scales::MIS, Scales::MISS, Scales::NATURAL_MIN_SCALE, Scales::PENTATONIC_MAJ, Scales::PERF, Scales::QUALITIES, Scales::RE, Scales::REF, Scales::REFF, Scales::RES, Scales::RESS, Scales::SHARP, Scales::SI, Scales::SIF, Scales::SIFF, Scales::SIS, Scales::SISS, Scales::SOL, Scales::SOLF, Scales::SOLFF, Scales::SOLS, Scales::SOLSS
Class Method Summary collapse
-
.high_note(from, short) ⇒ Object
Returns the second note of an interval calculates from its first note and number and quality in short notation.
-
.number(note1, note2, step = 0) ⇒ Object
Returns the number of the interval.
-
.quality(note1, note2, step = 0) ⇒ Object
Returns the quality of interval.
-
.scale(from, scale) ⇒ Object
Returns a scale.
-
.semitones(note1, note2, step = 0) ⇒ Object
Returns semitones of interval.
-
.short(note1, note2, step = 0) ⇒ Object
Returns short notation.
Methods included from Scales
cromatic_index, diatonic_aux_scale_from, diatonic_scale_from, scale_from
Class Method Details
.high_note(from, short) ⇒ Object
Returns the second note of an interval calculates from its first note and number and quality in short notation
31 32 33 |
# File 'lib/music-utils.rb', line 31 def MusicUtils.high_note(from, short) Interval.high_note(from, short) end |
.number(note1, note2, step = 0) ⇒ Object
Returns the number of the interval
9 10 11 |
# File 'lib/music-utils.rb', line 9 def MusicUtils.number(note1, note2, step = 0) Interval.new(note1, note2, step).number end |
.quality(note1, note2, step = 0) ⇒ Object
Returns the quality of interval
19 20 21 |
# File 'lib/music-utils.rb', line 19 def MusicUtils.quality(note1, note2, step = 0) Interval.new(note1, note2, step).quality end |
.scale(from, scale) ⇒ Object
Returns a scale
36 37 38 |
# File 'lib/music-utils.rb', line 36 def MusicUtils.scale(from, scale) Scales.scale(from, scale) end |
.semitones(note1, note2, step = 0) ⇒ Object
Returns semitones of interval
14 15 16 |
# File 'lib/music-utils.rb', line 14 def MusicUtils.semitones(note1, note2, step = 0) Interval.new(note1, note2, step).semitones end |
.short(note1, note2, step = 0) ⇒ Object
Returns short notation
24 25 26 |
# File 'lib/music-utils.rb', line 24 def MusicUtils.short(note1, note2, step = 0) Interval.new(note1, note2, step).short end |