Module: Clef

Defined in:
lib/clef.rb,
lib/clef/version.rb,
lib/clef/compiler.rb,
lib/clef/ir/event.rb,
lib/clef/core/clef.rb,
lib/clef/core/note.rb,
lib/clef/core/rest.rb,
lib/clef/ir/moment.rb,
lib/clef/core/chord.rb,
lib/clef/core/pitch.rb,
lib/clef/core/score.rb,
lib/clef/core/staff.rb,
lib/clef/core/tempo.rb,
lib/clef/core/voice.rb,
lib/clef/parser/dsl.rb,
lib/clef/core/tuplet.rb,
lib/clef/ir/timeline.rb,
lib/clef/layout/item.rb,
lib/clef/layout/stem.rb,
lib/clef/core/measure.rb,
lib/clef/notation/tie.rb,
lib/clef/plugins/base.rb,
lib/clef/core/duration.rb,
lib/clef/core/metadata.rb,
lib/clef/ir/music_tree.rb,
lib/clef/midi/exporter.rb,
lib/clef/notation/beam.rb,
lib/clef/notation/slur.rb,
lib/clef/renderer/base.rb,
lib/clef/layout/spacing.rb,
lib/clef/notation/lyric.rb,
lib/clef/core/validation.rb,
lib/clef/engraving/rules.rb,
lib/clef/engraving/style.rb,
lib/clef/core/staff_group.rb,
lib/clef/midi/channel_map.rb,
lib/clef/notation/barline.rb,
lib/clef/notation/dynamic.rb,
lib/clef/plugins/registry.rb,
lib/clef/core/key_signature.rb,
lib/clef/layout/beam_layout.rb,
lib/clef/core/time_signature.rb,
lib/clef/layout/line_breaker.rb,
lib/clef/layout/page_breaker.rb,
lib/clef/layout/system_layout.rb,
lib/clef/engraving/glyph_table.rb,
lib/clef/notation/articulation.rb,
lib/clef/parser/lilypond_lexer.rb,
lib/clef/renderer/pdf_renderer.rb,
lib/clef/renderer/svg_renderer.rb,
lib/clef/engraving/font_manager.rb,
lib/clef/parser/lilypond_parser.rb,
lib/clef/renderer/drawing_context.rb,
lib/clef/renderer/notation_helpers.rb

Defined Under Namespace

Modules: Core, Engraving, Ir, Layout, Midi, Notation, Parser, Plugins, Renderer Classes: Compiler, Error

Constant Summary collapse

VERSION =
"1.0.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.last_scoreObject (readonly)

Returns the value of attribute last_score.



61
62
63
# File 'lib/clef.rb', line 61

def last_score
  @last_score
end

Class Method Details

.pluginsClef::Plugins::Registry



74
75
76
# File 'lib/clef.rb', line 74

def plugins
  @plugins ||= Clef::Plugins::Registry.new
end

.score(plugins: Clef.plugins) { ... } ⇒ Clef::Core::Score

Yields:

  • DSL block

Returns:



65
66
67
68
69
70
71
# File 'lib/clef.rb', line 65

def score(plugins: Clef.plugins, &block)
  builder = Clef::Parser::DSL::ScoreBuilder.new(plugins: plugins)
  if block
    (block.arity == 1) ? block.call(builder) : builder.instance_eval(&block)
  end
  @last_score = builder.build
end