Class: Lydown::Rendering::Silence

Inherits:
Base
  • Object
show all
Includes:
Notes
Defined in:
lib/lydown/rendering/music.rb

Constant Summary

Constants included from Notes

Notes::ADD_LINK_COMMAND, Notes::DYNAMICS, Notes::LILYPOND_EXPRESSIONS, Notes::MARKUP_ALIGNMENT, Notes::TEXTMATE_URL, Notes::TRANSPARENT_NOTE, Notes::TRANSPARENT_TIE

Constants included from Figures

Figures::ALTERATION, Figures::ALTERATION_RE, Figures::BLANK_EXTENDER, Figures::BLANK_EXTENDER_START, Figures::BLANK_EXTENDER_STOP, Figures::EXTENDERS_OFF, Figures::EXTENDERS_ON, Figures::HIDDEN_FORMAT

Instance Method Summary collapse

Methods included from Notes

#add_chord, add_duration_macro_group, #add_macro_event, #add_macro_note, #add_note, cleanup_duration_macro, #cross_bar_dot_lilypond_note, #lilypond_chord, #lilypond_note, #lilypond_phrasing, #lydown_phrasing_close, #lydown_phrasing_open, #note_event_url_link, #translate_expressions, #translate_string_expression

Methods included from Figures

#add_figures, #add_stand_alone_figures, #check_tenues, #lilypond_figures, #next_figures_event, #translate_figures

Methods inherited from Base

#find_prev_event, #initialize, #next_event, #prev_event

Constructor Details

This class inherits a constructor from Lydown::Rendering::Base

Instance Method Details

#translateObject



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/lydown/rendering/music.rb', line 230

def translate
  if @event[:multiplier]
    value = Duration.full_bar_value(@context.get_current_setting(:time))
    @context['process/duration_macro'] = nil unless @context['process/macro_group']
    if value
      @event[:rest_value] = "#{value}*#{@event[:multiplier]}"
      @event[:head] = "s#{@event[:rest_value]}"
    else
      @event[:head] = "s#{@event[:multiplier]}*#{
        @context.get_current_setting(:time)}"
    end
    # reset the last value so the next note will be rendered with its value
    @context['process/last_value'] = nil
    @context['process/duration_values'] = []
  end

  add_note(@event)
end