Class: Fet::Generator::Listening
- Inherits:
-
Object
- Object
- Fet::Generator::Listening
- Defined in:
- lib/fet/generator/listening.rb
Overview
Class that generates MIDI files for the listening exercises
Class Method Summary collapse
-
.directory_prefix ⇒ Object
NOTE: this is explicitly changed in tests, so no need to check for coverage :nocov:.
Instance Method Summary collapse
-
#generate ⇒ Object
:nocov:.
-
#initialize(exercises:, tempo:, degrees:, all_single_degree:) ⇒ Listening
constructor
The reason number of exercises is required is because the actual number generated is quite large For three degrees, it’s something like 88C3, but a bit smaller because one you choose 1, you actually exclude some of the 88 other than just itself (i.e. if you chose the b2 degree, you exclude the rest of the b2 degrees too) 2 degrees => 21592 (left it for a while and it seemed to stop at this value) - comparable to 64C2 * 12 = 24192 3 degrees => 252398 (before I stopped it, there was more being generated).
Constructor Details
#initialize(exercises:, tempo:, degrees:, all_single_degree:) ⇒ Listening
The reason number of exercises is required is because the actual number generated is quite large For three degrees, it’s something like 88C3, but a bit smaller because one you choose 1, you actually exclude some of the 88 other than just itself (i.e. if you chose the b2 degree, you exclude the rest of the b2 degrees too) 2 degrees => 21592 (left it for a while and it seemed to stop at this value) - comparable to 64C2 * 12 = 24192 3 degrees => 252398 (before I stopped it, there was more being generated)
12 13 14 15 16 17 18 |
# File 'lib/fet/generator/listening.rb', line 12 def initialize(exercises:, tempo:, degrees:, all_single_degree:) self.number_of_exercises = exercises self.all_single_degree = all_single_degree self.tempo = tempo self.number_of_degrees = degrees self.note_range = Fet::REDUCED_BY_OCTAVE_PIANO_RANGE end |
Class Method Details
.directory_prefix ⇒ Object
NOTE: this is explicitly changed in tests, so no need to check for coverage :nocov:
22 23 24 |
# File 'lib/fet/generator/listening.rb', line 22 def self.directory_prefix return "" end |
Instance Method Details
#generate ⇒ Object
:nocov:
27 28 29 |
# File 'lib/fet/generator/listening.rb', line 27 def generate all_single_degree ? generate_all_single_degree_exercises : generate_number_of_exercises end |