Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ledger Line Logic #569

Merged
merged 3 commits into from
Jul 30, 2017
Merged

Ledger Line Logic #569

merged 3 commits into from
Jul 30, 2017

Conversation

gristow
Copy link
Collaborator

@gristow gristow commented Jul 29, 2017

Fixes #566, fixes ledger line formatting issues remaining in #557.

Changes:

  • Ledger line drawing is now handled entirely by StaveNote
  • All ledger line logic is removed from NoteHead
  • Ledger lines are now drawn with the same style of the staff they're related to
  • If both displaced and non-displaced notes are present above or below the staff, ledger lines are drawn for both positions until no longer needed in either position.
  • Stave.setStyle() is now available to match the api's of other Elements.
  • StaveNote.setLedgerLineStyle() uses Stave.getStyle() as its default style, merging onto it any changes.

This results in two obvious visual changes throughout with ledger lines:

  • Ledger lines are now thinner than before (1px, matching Vex.Flow.STAVE_LINE_THICKNESS)
  • Ledger lines are now colored as #999999 by default (matching Stave.options.fill_style's default).

Before:
annotation bottom_annotations_with_beams_blessed
After:
annotation bottom_annotations_with_beams_current

To my eyes, I really appreciate the consistency of style between the ledger lines and the staves. However: I find myself wondering if #999999 is too light of a default now that the ledger lines are the same color and thinner. Thoughts?

Finally, the NoteHead Bounding Boxes test loses a ledger line because this logic is moved into StaveNote. This isn't a grave concern to me -- I think it's pretty unlikely anyone is using VexFlow in a way that they're relying on NoteHead to draw a ledger line. (And, anyway, it would only ever draw the final ledger line before a note -- not all of the ones between the note and the staff.)

Before:
notehead bounding_boxes_blessed

After:
notehead bounding_boxes_current

That said: if anyone sees an issue with consolidating ledger lines in StaveNote please let me know. I'll hold off on merging this for a few days.

Thanks!

Moves all ledger line drawing to StaveNote, which now respects the
stave line style settings of its Stave object by default. (Ledger line
style can also be set via staveNote.setLedgerLineStyle().)
@0xfe
Copy link
Owner

0xfe commented Jul 29, 2017

Thanks for the change. What do the visual regression diffs look like? (particularly the rests)

Re: #999999, I'm open to darkening it.

@gristow
Copy link
Collaborator Author

gristow commented Jul 29, 2017

Rests are unchanged -- except for where the notes have ledger lines:

rests auto_align_rests___multi_voice_blessed
rests auto_align_rests___multi_voice_current
rests auto_align_rests___multi_voice

Biggest changes are where the corrected ledger line algorithm for displaced notes made a difference:
stavenote displacements_blessed
stavenote displacements_current
stavenote displacements

Because so many of the tests have a ledger line, there are 285 diffs as a result of this PR. (I've looked over them all... but would love more eyes on them. I'll paste in a new comment... my apologies in advance for the length of that comment!)

@gristow
Copy link
Collaborator Author

gristow commented Jul 29, 2017

accidental accidental_arrangement_special_cases_blessed
accidental accidental_arrangement_special_cases_current
accidental accidental_arrangement_special_cases
accidental automatic_accidentals___c_major_scale_in_ab_blessed
accidental automatic_accidentals___c_major_scale_in_ab_current
accidental automatic_accidentals___c_major_scale_in_ab
accidental automatic_accidentals___multi_voice_inline_blessed
accidental automatic_accidentals___multi_voice_inline_current
accidental automatic_accidentals___multi_voice_inline
accidental automatic_accidentals___multi_voice_offset_blessed
accidental automatic_accidentals___multi_voice_offset_current
accidental automatic_accidentals___multi_voice_offset
accidental automatic_accidentals___no_accidentals_necsesary_blessed
accidental automatic_accidentals___no_accidentals_necsesary_current
accidental automatic_accidentals___no_accidentals_necsesary
accidental automatic_accidentals_blessed
accidental automatic_accidentals_current
accidental automatic_accidentals
accidental basic_blessed
accidental basic_current
accidental basic
accidental factory_api_blessed
accidental factory_api_current
accidental factory_api
accidental microtonal__iranian__blessed
accidental microtonal__iranian__current
accidental microtonal__iranian_
accidental microtonal_blessed
accidental microtonal_current
accidental microtonal
accidental multi_voice_blessed
accidental multi_voice_current
accidental multi_voice
accidental stem_down_blessed
accidental stem_down_current
accidental stem_down
annotation bottom_annotations_with_beams_blessed
annotation bottom_annotations_with_beams_current
annotation bottom_annotations_with_beams
annotation standard_notation_annotation_blessed
annotation standard_notation_annotation_current
annotation standard_notation_annotation
annotation test_justification_annotation_stem_down_blessed
annotation test_justification_annotation_stem_down_current
annotation test_justification_annotation_stem_down
annotation test_justification_annotation_stem_up_blessed
annotation test_justification_annotation_stem_up_current
annotation test_justification_annotation_stem_up
articulation articulation___accent_tenuto_blessed
articulation articulation___accent_tenuto_current
articulation articulation___accent_tenuto
articulation articulation___fermata_above_below_blessed
articulation articulation___fermata_above_below_current
articulation articulation___fermata_above_below
articulation articulation___inline_multiple_blessed
articulation articulation___inline_multiple_current
articulation articulation___inline_multiple
articulation articulation___marcato_l_h__pizzicato_blessed
articulation articulation___marcato_l_h__pizzicato_current
articulation articulation___marcato_l_h__pizzicato
articulation articulation___snap_pizzicato_fermata_blessed
articulation articulation___snap_pizzicato_fermata_current
articulation articulation___snap_pizzicato_fermata
articulation articulation___staccato_staccatissimo_blessed
articulation articulation___staccato_staccatissimo_current
articulation articulation___staccato_staccatissimo
articulation articulation___up_stroke_down_stroke_blessed
articulation articulation___up_stroke_down_stroke_current
articulation articulation___up_stroke_down_stroke
auto_beaming beam_across_all_rests_blessed
auto_beaming beam_across_all_rests_current
auto_beaming beam_across_all_rests_with_stemlets_blessed
auto_beaming beam_across_all_rests_with_stemlets_current
auto_beaming beam_across_all_rests_with_stemlets
auto_beaming beam_across_all_rests
auto_beaming break_beams_on_middle_rests_only_blessed
auto_beaming break_beams_on_middle_rests_only_current
auto_beaming break_beams_on_middle_rests_only
auto_beaming break_beams_on_rest_blessed
auto_beaming break_beams_on_rest_current
auto_beaming break_beams_on_rest
auto_beaming custom_beam_groups_blessed
auto_beaming custom_beam_groups_current
auto_beaming custom_beam_groups
auto_beaming duration_based_secondary_beam_breaks_2_blessed
auto_beaming duration_based_secondary_beam_breaks_2_current
auto_beaming duration_based_secondary_beam_breaks_2
auto_beaming flat_beams_down__uniform__blessed
auto_beaming flat_beams_down__uniform__current
auto_beaming flat_beams_down__uniform_
auto_beaming flat_beams_down_blessed
auto_beaming flat_beams_down_bounds_blessed
auto_beaming flat_beams_down_bounds_current
auto_beaming flat_beams_down_bounds
auto_beaming flat_beams_down_current
auto_beaming flat_beams_down
auto_beaming flat_beams_mixed_direction_blessed
auto_beaming flat_beams_mixed_direction_current
auto_beaming flat_beams_mixed_direction
auto_beaming flat_beams_up__uniform__blessed
auto_beaming flat_beams_up__uniform__current
auto_beaming flat_beams_up__uniform_
auto_beaming flat_beams_up_blessed
auto_beaming flat_beams_up_bounds_blessed
auto_beaming flat_beams_up_bounds_current
auto_beaming flat_beams_up_bounds
auto_beaming flat_beams_up_current
auto_beaming flat_beams_up
auto_beaming more_automatic_beaming_blessed
auto_beaming more_automatic_beaming_current
auto_beaming more_automatic_beaming
auto_beaming more_simple_auto_beaming_0_blessed
auto_beaming more_simple_auto_beaming_0_current
auto_beaming more_simple_auto_beaming_0
auto_beaming more_simple_auto_beaming_1_blessed
auto_beaming more_simple_auto_beaming_1_current
auto_beaming more_simple_auto_beaming_1
auto_beaming more_simple_tuplet_auto_beaming_blessed
auto_beaming more_simple_tuplet_auto_beaming_current
auto_beaming more_simple_tuplet_auto_beaming
auto_beaming odd_beam_groups_auto_beaming_blessed
auto_beaming odd_beam_groups_auto_beaming_current
auto_beaming odd_beam_groups_auto_beaming
auto_beaming odd_time___guessing_default_beam_groups_blessed
auto_beaming odd_time___guessing_default_beam_groups_current
auto_beaming odd_time___guessing_default_beam_groups
auto_beaming simple_tuplet_auto_beaming_blessed
auto_beaming simple_tuplet_auto_beaming_current
auto_beaming simple_tuplet_auto_beaming
bach_demo minuet_1_blessed
bach_demo minuet_1_current
bach_demo minuet_1
barline simple_barnotes_blessed
barline simple_barnotes_current
barline simple_barnotes
beam break_secondary_beams_blessed
beam break_secondary_beams_current
beam break_secondary_beams
beam close_trade_offs_beam_blessed
beam close_trade_offs_beam_current
beam close_trade_offs_beam
beam complex_beams_with_annotations_blessed
beam complex_beams_with_annotations_current
beam complex_beams_with_annotations
beam complex_beams_with_articulations_blessed
beam complex_beams_with_articulations_current
beam complex_beams_with_articulations
beam dotted_beam_blessed
beam dotted_beam_current
beam dotted_beam
beam insane_beam_blessed
beam insane_beam_current
beam insane_beam
beam mixed_beam_1_blessed
beam mixed_beam_1_current
beam mixed_beam_1
beam mixed_beam_2_blessed
beam mixed_beam_2_current
beam mixed_beam_2
beam multi_beam_blessed
beam multi_beam_current
beam multi_beam
beam simple_beam_blessed
beam simple_beam_current
beam simple_beam
beam sixteenth_beam_blessed
beam sixteenth_beam_current
beam sixteenth_beam
beam slopey_beam_blessed
beam slopey_beam_current
beam slopey_beam
clef clef_change_test_blessed
clef clef_change_test_current
clef clef_change_test
curve rounded_curve_blessed
curve rounded_curve_current
curve rounded_curve
curve simple_curve_blessed
curve simple_curve_current
curve simple_curve
curve thick_thin_curves_blessed
curve thick_thin_curves_current
curve thick_thin_curves
curve top_curve_blessed
curve top_curve_current
curve top_curve
dot basic_blessed
dot basic_current
dot basic
dot multi_voice_blessed
dot multi_voice_current
dot multi_voice
easyscore draw_accidentals_blessed
easyscore draw_accidentals_current
easyscore draw_accidentals
easyscore draw_basic_blessed
easyscore draw_basic_current
easyscore draw_basic
easyscore draw_beams_blessed
easyscore draw_beams_current
easyscore draw_beams
easyscore draw_tuplets_blessed
easyscore draw_tuplets_current
easyscore draw_tuplets
formatter multiple_staves___justified___6_iterations_blessed
formatter multiple_staves___justified___6_iterations_current
formatter multiple_staves___justified___6_iterations
formatter multiple_staves___justified_blessed
formatter multiple_staves___justified_current
formatter multiple_staves___justified
formatter multiple_staves___no_justification_blessed
formatter multiple_staves___no_justification_current
formatter multiple_staves___no_justification
formatter notes_with_tab_blessed
formatter notes_with_tab_current
formatter notes_with_tab
formatter stavenote_formatting_blessed
formatter stavenote_formatting_current
formatter stavenote_formatting
formatter stavenote_justification_blessed
formatter stavenote_justification_current
formatter stavenote_justification
ghostnote ghostnote_basic_blessed
ghostnote ghostnote_basic_current
ghostnote ghostnote_basic
ghostnote ghostnote_dotted_blessed
ghostnote ghostnote_dotted_current
ghostnote ghostnote_dotted
grace_notes grace_notes_multiple_voices_blessed
grace_notes grace_notes_multiple_voices_current
grace_notes grace_notes_multiple_voices
notehead bounding_boxes_blessed
notehead bounding_boxes_current
notehead bounding_boxes
notesubgroup basic___clefnote__timesignote_and_barnote_blessed
notesubgroup basic___clefnote__timesignote_and_barnote_current
notesubgroup basic___clefnote__timesignote_and_barnote
notesubgroup multi_staff_blessed
notesubgroup multi_staff_current
notesubgroup multi_staff
notesubgroup multi_voice_blessed
notesubgroup multi_voice_current
notesubgroup multi_voice
ornament ornaments_vertically_shifted_blessed
ornament ornaments_vertically_shifted_current
ornament ornaments_vertically_shifted
pedalmarking custom_text_1_blessed
pedalmarking custom_text_1_current
pedalmarking custom_text_1
pedalmarking custom_text_2_blessed
pedalmarking custom_text_2_current
pedalmarking custom_text_2
pedalmarking release_and_depress_on_same_note_1_blessed
pedalmarking release_and_depress_on_same_note_1_current
pedalmarking release_and_depress_on_same_note_1
pedalmarking release_and_depress_on_same_note_2_blessed
pedalmarking release_and_depress_on_same_note_2_current
pedalmarking release_and_depress_on_same_note_2
pedalmarking simple_pedal_1_blessed
pedalmarking simple_pedal_1_current
pedalmarking simple_pedal_1
pedalmarking simple_pedal_2_blessed
pedalmarking simple_pedal_2_current
pedalmarking simple_pedal_2
pedalmarking simple_pedal_3_blessed
pedalmarking simple_pedal_3_current
pedalmarking simple_pedal_3
percussion percussion_basic2_blessed
percussion percussion_basic2_current
percussion percussion_basic2
percussion percussion_snare1_blessed
percussion percussion_snare1_current
percussion percussion_snare1
rests auto_align_rests___beamed_notes_stems_down_blessed
rests auto_align_rests___beamed_notes_stems_down_current
rests auto_align_rests___beamed_notes_stems_down
rests auto_align_rests___beamed_notes_stems_up_blessed
rests auto_align_rests___beamed_notes_stems_up_current
rests auto_align_rests___beamed_notes_stems_up
rests auto_align_rests___multi_voice_blessed
rests auto_align_rests___multi_voice_current
rests auto_align_rests___multi_voice
rests auto_align_rests___single_voice__align_all__blessed
rests auto_align_rests___single_voice__align_all__current
rests auto_align_rests___single_voice__align_all_
rests auto_align_rests___single_voice__default__blessed
rests auto_align_rests___single_voice__default__current
rests auto_align_rests___single_voice__default_
rests auto_align_rests___tuplets_stems_down_blessed
rests auto_align_rests___tuplets_stems_down_current
rests auto_align_rests___tuplets_stems_down
rests auto_align_rests___tuplets_stems_up_blessed
rests auto_align_rests___tuplets_stems_up_current
rests auto_align_rests___tuplets_stems_up
stave multiple_stave_barline_test_blessed
stave multiple_stave_barline_test_current
stave multiple_stave_barline_test
stave multiple_stave_repeats_test_blessed
stave multiple_stave_repeats_test_current
stave multiple_stave_repeats_test
stave multiple_staves_volta_test_blessed
stave multiple_staves_volta_test_current
stave multiple_staves_volta_test
stave tempo_test_blessed
stave tempo_test_current
stave tempo_test
stavehairpin height_stavehairpin_blessed
stavehairpin height_stavehairpin_current
stavehairpin height_stavehairpin
stavehairpin horizontal_offset_stavehairpin_blessed
stavehairpin horizontal_offset_stavehairpin_current
stavehairpin horizontal_offset_stavehairpin
stavehairpin simple_stavehairpin_blessed
stavehairpin simple_stavehairpin_current
stavehairpin simple_stavehairpin
stavehairpin vertical_offset_stavehairpin_blessed
stavehairpin vertical_offset_stavehairpin_current
stavehairpin vertical_offset_stavehairpin
staveline simple_staveline_blessed
staveline simple_staveline_current
staveline simple_staveline
staveline staveline_arrow_options_blessed
staveline staveline_arrow_options_current
staveline staveline_arrow_options
stavenote center_aligned_note_with_multiple_modifiers_blessed
stavenote center_aligned_note_with_multiple_modifiers_current
stavenote center_aligned_note_with_multiple_modifiers
stavenote displacements_blessed
stavenote displacements_current
stavenote displacements
stavenote stavenote_boundingboxes___treble_blessed
stavenote stavenote_boundingboxes___treble_current
stavenote stavenote_boundingboxes___treble
stavenote stavenote_draw___alto_blessed
stavenote stavenote_draw___alto_current
stavenote stavenote_draw___alto
stavenote stavenote_draw___bass_2_blessed
stavenote stavenote_draw___bass_2_current
stavenote stavenote_draw___bass_2
stavenote stavenote_draw___bass_blessed
stavenote stavenote_draw___bass_current
stavenote stavenote_draw___bass
stavenote stavenote_draw___beam__stem___ledger_line_styles_blessed
stavenote stavenote_draw___beam__stem___ledger_line_styles_current
stavenote stavenote_draw___beam__stem___ledger_line_styles
stavenote stavenote_draw___harmonic_and_muted_blessed
stavenote stavenote_draw___harmonic_and_muted_current
stavenote stavenote_draw___harmonic_and_muted
stavenote stavenote_draw___tenor_blessed
stavenote stavenote_draw___tenor_current
stavenote stavenote_draw___tenor
stavenote stavenote_draw___treble_blessed
stavenote stavenote_draw___treble_current
stavenote stavenote_draw___treble
stavetie chord_stavetie_blessed
stavetie chord_stavetie_current
stavetie chord_stavetie
stavetie no_end_note_blessed
stavetie no_end_note_current
stavetie no_end_note
stavetie no_start_note_blessed
stavetie no_start_note_current
stavetie no_start_note
stavetie set_direction_down_blessed
stavetie set_direction_down_current
stavetie set_direction_down
stavetie set_direction_up_blessed
stavetie set_direction_up_current
stavetie set_direction_up
stavetie simple_stavetie_blessed
stavetie simple_stavetie_current
stavetie simple_stavetie
stavetie stem_up_stavetie_blessed
stavetie stem_up_stavetie_current
stavetie stem_up_stavetie
stringnumber complex_measure_with_string___finger_numbers_blessed
stringnumber complex_measure_with_string___finger_numbers_current
stringnumber complex_measure_with_string___finger_numbers
stringnumber fret_hand_finger_in_notation_blessed
stringnumber fret_hand_finger_in_notation_current
stringnumber fret_hand_finger_in_notation
stringnumber multi_voice_with_strokes__string___finger_numbers_blessed
stringnumber multi_voice_with_strokes__string___finger_numbers_current
stringnumber multi_voice_with_strokes__string___finger_numbers
stringnumber string_number_in_notation_blessed
stringnumber string_number_in_notation_current
stringnumber string_number_in_notation
strokes strokes___brush_arpeggiate_rasquedo_blessed
strokes strokes___brush_arpeggiate_rasquedo_current
strokes strokes___brush_arpeggiate_rasquedo
strokes strokes___multi_voice_blessed
strokes strokes___multi_voice_current
strokes strokes___multi_voice_notation_and_tab_blessed
strokes strokes___multi_voice_notation_and_tab_current
strokes strokes___multi_voice_notation_and_tab
strokes strokes___multi_voice
strokes strokes___notation_and_tab_blessed
strokes strokes___notation_and_tab_current
strokes strokes___notation_and_tab
textbracket simple_textbracket_blessed
textbracket simple_textbracket_current
textbracket simple_textbracket
textbracket textbracket_styles_blessed
textbracket textbracket_styles_current
textbracket textbracket_styles
textnote textnote_formatting_blessed
textnote textnote_formatting_current
textnote textnote_formatting_with_glyphs_0_blessed
textnote textnote_formatting_with_glyphs_0_current
textnote textnote_formatting_with_glyphs_0
textnote textnote_formatting_with_glyphs_1_blessed
textnote textnote_formatting_with_glyphs_1_current
textnote textnote_formatting_with_glyphs_1
textnote textnote_formatting
textnote textnote_superscript_and_subscript_blessed
textnote textnote_superscript_and_subscript_current
textnote textnote_superscript_and_subscript
three_voice_rests auto_adjust_rest_positions___three_voices__1_blessed
three_voice_rests auto_adjust_rest_positions___three_voices__1_current
three_voice_rests auto_adjust_rest_positions___three_voices__1
three_voice_rests auto_adjust_rest_positions___three_voices__2_blessed
three_voice_rests auto_adjust_rest_positions___three_voices__2_current
three_voice_rests auto_adjust_rest_positions___three_voices__2
three_voice_rests auto_adjust_rest_positions___two_voices_blessed
three_voice_rests auto_adjust_rest_positions___two_voices_current
three_voice_rests auto_adjust_rest_positions___two_voices
three_voice_rests three_voices____1_blessed
three_voice_rests three_voices____1_current
three_voice_rests three_voices____1
three_voice_rests three_voices____2_complex_blessed
three_voice_rests three_voices____2_complex_current
three_voice_rests three_voices____2_complex
three_voice_rests three_voices____3_blessed
three_voice_rests three_voices____3_current
three_voice_rests three_voices____3
timesignature time_signature_change_test_blessed
timesignature time_signature_change_test_current
timesignature time_signature_change_test
tuplet awkward_tuplet_blessed
tuplet awkward_tuplet_current
tuplet awkward_tuplet
tuplet bottom_ratioed_tuplet_blessed
tuplet bottom_ratioed_tuplet_current
tuplet bottom_ratioed_tuplet
tuplet bottom_tuplet_blessed
tuplet bottom_tuplet_current
tuplet bottom_tuplet
tuplet complex_tuplet_blessed
tuplet complex_tuplet_current
tuplet complex_tuplet
tuplet mixed_stem_direction_bottom_tuplet_blessed
tuplet mixed_stem_direction_bottom_tuplet_current
tuplet mixed_stem_direction_bottom_tuplet
tuplet mixed_stem_direction_tuplet_blessed
tuplet mixed_stem_direction_tuplet_current
tuplet mixed_stem_direction_tuplet
tuplet single_tuplets_blessed
tuplet single_tuplets_current
tuplet single_tuplets
vibratobracket harsh_vibratobracket_without_end_note_blessed
vibratobracket harsh_vibratobracket_without_end_note_current
vibratobracket harsh_vibratobracket_without_end_note
vibratobracket harsh_vibratobracket_without_start_note_blessed
vibratobracket harsh_vibratobracket_without_start_note_current
vibratobracket harsh_vibratobracket_without_start_note
vibratobracket simple_vibratobracket_blessed
vibratobracket simple_vibratobracket_current
vibratobracket simple_vibratobracket
voice full_voice_mode_test_blessed
voice full_voice_mode_test_current
voice full_voice_mode_test

@0xfe
Copy link
Owner

0xfe commented Jul 30, 2017

These look sane to me. Feel free to merge. 👍

@gristow
Copy link
Collaborator Author

gristow commented Jul 30, 2017

Great -- will do.

Also: I'm wondering if we should bump the release version sometime soon. The current version (1.2.83, Sept. 2016) doesn't reflect the new accidental types, and many of the rewritten tests from last summer. (I only noticed because to get accurate visual regressions I had to build from a clean git pull, then grunt copy:release, apply my commits, and then run npm test.)

@gristow gristow merged commit f8509a0 into 0xfe:master Jul 30, 2017
@0xfe
Copy link
Owner

0xfe commented Jul 30, 2017

Ah, yes. I'll bump it.

@mscuthbert
Copy link
Collaborator

Hi -- I think i'm late to the game, but I'm strongly against the coloring of the ledger lines the same color as the staff -- they look too easy to miss count to me. There's no notational rule i can cite -- but then of course having staves a different color as the notes is also a new thing (at least new since 1500).

@0xfe
Copy link
Owner

0xfe commented Jul 31, 2017 via email

@gristow
Copy link
Collaborator Author

gristow commented Jul 31, 2017

I tend to agree, Michael -- though having the ledger lines a different style from the stave lines feels very odd to me. In both Finale & Sibelius they are good old fashioned black (#000000), which would be my preference. For comparison:

Staves & Ledgers at #000000 (black):
screen shot 2017-07-30 at 8 46 04 pm

Staves & Ledgers at #333333:
screen shot 2017-07-30 at 8 39 15 pm

Staves & Ledgers at #666666:
screen shot 2017-07-30 at 8 44 02 pm

Staves & Ledgers at #999999 (current default):
screen shot 2017-07-30 at 8 45 08 pm

How do we feel about changing the default? Would this solve it from your perspective, @mscuthbert?

@mscuthbert
Copy link
Collaborator

mscuthbert commented Jul 31, 2017

I LOVE the gray staff lines -- I think that when @0xfe or whoever chose this as a default, it's brilliant; it makes the music stand out the way ink on really good manuscript staff paper does. Because the stafflines run the whole extent of the horizontal span, they don't need to be very prominent -- they're constantly in your field of vision. Ledger lines, however are mostly covered up so they need to be more prominent. Maybe thickness would be more important than color. Elaine Gould, Behind Bars, p. 26, says "Ledger lines are an extension of the stave. They are spaced the same width apart as the stave-lines, but they are about twice as thick." (emphasis added) Gould continues "It is important that ledger lines are visibly thicker than stave-lines so that a player reading a passage of ledger-line notes can take in the number of ledger lines at a glance." So perhaps they're fine as #999999 but just thicker?

@gristow
Copy link
Collaborator Author

gristow commented Jul 31, 2017

Here it is at #999999 but ledger lines twice as thick as stave lines -- which looks odd to me:
screen shot 2017-07-30 at 11 09 00 pm

And detail:
screen shot 2017-07-30 at 11 17 03 pm

Given that Gould's world is that of monochromatic print music, maybe darker ledger lines would basically have the same effect. (Though, of course, if someone is using VexFlow for print they might like the option to change that.)

Here's stave & ledger lines the same thickness, but ledger's drawn at #000000:
screen shot 2017-07-30 at 11 13 35 pm

Here's double thickness, ledger's drawn at #000000:
screen shot 2017-07-30 at 11 14 58 pm

Whatever we wind up with as the default, I find myself wondering about allowing users to set a default for some of these 'house style' questions. For instance, in stave.js we might catch defaults via closure, and do something like:

const style = {
  strokeStyle: `#999999`,
  lineWidth: 1
}

const ledgerLineStyle = {
  strokeStyle: `#000000`,
  lineWidth: 1
}

class Stave extends Element {
  ...
  static setDefaultStyle(newStyle) {
    Object.assign(style, newStyle);
  }

  static setDefaultLedgerLineStyle(newStyle) {
    Object.assign(ledgerLineStyle, newStyle);
  }
  ...
}

Alternately, these defaults could be in some central location and accessible as variables on Vex.Flow to be changed by a user...

@mscuthbert
Copy link
Collaborator

I think that the last looks best, but if lineWidth can take a float then 1.5 and #333333 might be the best compromise?

@gristow
Copy link
Collaborator Author

gristow commented Jul 31, 2017

A few more swatches to look at -- since floats are fine for lineWidth.

Here's stave & ledger lines at #999999 with ledger lines at 1.5x the stave line width:
screen shot 2017-07-31 at 9 28 21 am

And detail:
screen shot 2017-07-31 at 9 29 01 am

Here's stave & ledger lines at #666666 with ledger lines at 1.5x the stave line width:
screen shot 2017-07-31 at 9 31 20 am

And detail:
screen shot 2017-07-31 at 9 32 17 am

Finally, stave lines at #999999 and ledger lines at #000000 and 1.5x the stave line width:
screen shot 2017-07-31 at 9 34 09 am

And detail:
screen shot 2017-07-31 at 9 35 00 am

@mscuthbert
Copy link
Collaborator

mscuthbert commented Jul 31, 2017

The last looks best to me. Thanks for all the hard work!

I'll try to look through examples that make counting difficult (generally, telling the difference between 3, 4, and 5 ledger lines on monophonic music) and see how much thickness is necessary to make it stand out properly. But it's looking much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ledger Line Logic
3 participants