Module: Fet

Defined in:
lib/fet.rb,
lib/fet/note.rb,
lib/fet/score.rb,
lib/fet/degree.rb,
lib/fet/ui/key.rb,
lib/fet/degrees.rb,
lib/fet/ui/game.rb,
lib/fet/version.rb,
lib/fet/ui/level.rb,
lib/fet/ui/score.rb,
lib/fet/ui/timer.rb,
lib/fet/midi_note.rb,
lib/fet/exceptions.rb,
lib/fet/ui/note_box.rb,
lib/fet/music_theory.rb,
lib/fet/score_summary.rb,
lib/fet/ui/note_boxes.rb,
lib/fet/ui/color_scheme.rb,
lib/fet/ui/custom_event.rb,
lib/fet/note_validations.rb,
lib/fet/chord_progression.rb,
lib/fet/cli/score/summary.rb,
lib/fet/generator/singing.rb,
lib/fet/instrument_ranges.rb,
lib/fet/midilib_interface.rb,
lib/fet/cli/play/listening.rb,
lib/fet/generator/listening.rb,
lib/fet/midi_file_generator.rb,
lib/fet/cli/generate/singing.rb,
lib/fet/score_summary_writer.rb,
lib/fet/ui/game_loop_handler.rb,
lib/fet/ui/game_setup_helper.rb,
lib/fet/hardcoded_midi_values.rb,
lib/fet/ui/level_loop_handler.rb,
lib/fet/cli/generate/listening.rb,
lib/fet/ui/note_box_loop_handler.rb,
lib/fet/cli/score/summary_command.rb,
lib/fet/cli/play/listening_command.rb,
lib/fet/cli/generate/singing_command.rb,
lib/fet/cli/generate/listening_command.rb,
lib/fet/generator/single_note_listening.rb,
lib/fet/cli/generate/single_note_listening.rb,
lib/fet/cli/generate/single_note_listening_command.rb

Overview

Base Gem module

Defined Under Namespace

Modules: Cli, Generator, MidiFileGenerator, MusicTheory, NoteValidations, ScoreSummaryWriter, Ui Classes: ChordProgression, Degree, Degrees, Error, ImplementationError, InvalidChordProgression, InvalidCustomEventType, InvalidDegreeName, InvalidMidiNote, InvalidModeName, InvalidNote, MidiNote, MidilibInterface, Note, Score, ScoreSummary, UnsupportedRootName

Constant Summary collapse

VERSION =
"0.3.1"
PIANO_RANGE =
(MidiNote.from_note("A", 0).midi_value..MidiNote.from_note("C", 8).midi_value).to_a.deep_freeze
REDUCED_BY_OCTAVE_PIANO_RANGE =
(MidiNote.from_note("A", 1).midi_value..MidiNote.from_note("C", 7).midi_value).to_a.deep_freeze
GUITAR_RANGE =
(MidiNote.from_note("E", 2).midi_value..MidiNote.from_note("E", 6).midi_value).to_a.deep_freeze
LOW_SINGING_OCTAVE_RANGE =

Ranges according to Wikipedia: Bass: E2 - E4 Baritone: G2 - G4 Tenor: C3 - C5 Countertenor: E3 - E5 Contralto: F3 - F5 Mezzo-soprano: A3 - A5 Soprano: C4 - C6

(MidiNote.from_note("D", 3).midi_value...MidiNote.from_note("D", 4).midi_value).to_a.deep_freeze
HIGH_SINGING_OCTAVE_RANGE =
(MidiNote.from_note("D", 4).midi_value...MidiNote.from_note("D", 5).midi_value).to_a.deep_freeze
MAJOR_ROOT_MIDI_VALUES =
{
  "C#" => MidiNote.from_note("C#", 4).midi_value,
  "F#" => MidiNote.from_note("F#", 3).midi_value,
  "B" => MidiNote.from_note("B", 3).midi_value,
  "E" => MidiNote.from_note("E", 3).midi_value,
  "A" => MidiNote.from_note("A", 3).midi_value,
  "D" => MidiNote.from_note("D", 4).midi_value,
  "G" => MidiNote.from_note("G", 3).midi_value,
  "C" => MidiNote.from_note("C", 4).midi_value,
  "F" => MidiNote.from_note("F", 3).midi_value,
  "Bb" => MidiNote.from_note("Bb", 3).midi_value,
  "Eb" => MidiNote.from_note("Eb", 4).midi_value,
  "Ab" => MidiNote.from_note("Ab", 3).midi_value,
  "Db" => MidiNote.from_note("Db", 4).midi_value,
  "Gb" => MidiNote.from_note("Gb", 3).midi_value,
  "Cb" => MidiNote.from_note("Cb", 3).midi_value,
}.deep_freeze
MINOR_ROOT_MIDI_VALUES =
MusicTheory::MINOR_KEYS.zip(MAJOR_ROOT_MIDI_VALUES.values.map { |i| i - 3 }).to_h.deep_freeze

Class Method Summary collapse

Class Method Details

.rootObject



10
11
12
# File 'lib/fet.rb', line 10

def self.root
  File.expand_path("..", __dir__)
end