Module: Fet::MidiFileGenerator

Included in:
MidilibInterface
Defined in:
lib/fet/midi_file_generator.rb

Overview

Use MidilibInterface to create concrete MIDI files

Instance Method Summary collapse

Instance Method Details

#create_chord_progression_of_questionObject



14
15
16
17
18
# File 'lib/fet/midi_file_generator.rb', line 14

def create_chord_progression_of_question
  set_progression_on_track
  add_rest(1 * quarter_note_length)
  write_sequence_to_file
end

#create_full_questionObject



6
7
8
9
10
11
12
# File 'lib/fet/midi_file_generator.rb', line 6

def create_full_question
  set_progression_on_track
  add_rest(2 * quarter_note_length)
  play_notes_as_chord(notes, quarter_note_length)
  add_rest(3 * quarter_note_length)
  write_sequence_to_file
end

#create_listening_midi_fileObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fet/midi_file_generator.rb', line 26

def create_listening_midi_file
  set_progression_on_track

  add_rest(2 * quarter_note_length)
  play_notes_as_chord(notes, quarter_note_length)

  add_rest(6 * quarter_note_length)
  play_notes_sequentially(notes, quarter_note_length)

  write_sequence_to_file
end

#create_notes_onlyObject



20
21
22
23
24
# File 'lib/fet/midi_file_generator.rb', line 20

def create_notes_only
  play_notes_as_chord(notes, quarter_note_length)
  add_rest(1 * quarter_note_length)
  write_sequence_to_file
end

#create_singing_midi_file(sleep_duration) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/fet/midi_file_generator.rb', line 38

def create_singing_midi_file(sleep_duration)
  set_progression_on_track

  add_seconds_of_rest(sleep_duration)
  play_notes_sequentially(notes, quarter_note_length)
  add_rest(3 * quarter_note_length)

  write_sequence_to_file
end