Class: Coltrane::Cli::Notes
- Inherits:
-
Object
- Object
- Coltrane::Cli::Notes
- Defined in:
- lib/cli/notes.rb
Overview
Interfaces notes outputting functionality with the lib
Instance Method Summary collapse
-
#initialize(notes, desc: nil) ⇒ Notes
constructor
A new instance of Notes.
- #render ⇒ Object
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
#render ⇒ Object
15 16 17 |
# File 'lib/cli/notes.rb', line 15 def render puts "\n" + [@desc, @representation.render].join("\n" * 2) end |