Class: Coltrane::Cli::Notes

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/notes.rb

Overview

Interfaces notes outputting functionality with the lib

Instance Method Summary collapse

Constructor Details

#initialize(notes, desc: nil) ⇒ Notes

Returns a new instance of Notes.



7
8
9
10
11
12
13
# File 'lib/cli/notes.rb', line 7

def initialize(notes, desc: nil)
  @desc   = desc || 'The notes you supplied:'
  notes   = Coltrane::NoteSet.new(notes)
  @representation = Representation.build(notes)
  render
  # notes.each {|n| ColtraneSynth::Base.play(n, 0.1) } if Cli.config.sound
end

Instance Method Details

#renderObject



15
16
17
# File 'lib/cli/notes.rb', line 15

def render
  puts "\n" + [@desc, @representation.render].join("\n" * 2)
end