 # intervals_book by_root: true
 # intervals_book by_root: false
 chord_book best_fingering: 0, pages: 0
-# chord_fingerings_page Chords[0], 44
+# chord_fingerings_page Chords[0], 44 + 3


intervals_book = ({by_root}) ->
  if by_root
    book "Fretboard Intervals by Root.pdf", (page) ->
      finger_positions_each (fingering) ->
        page -> intervals_from_position_page fingering
  else
    book "Fretboard Intervals.pdf", (page) ->
      for _, semitones in Intervals
        page -> intervals_page semitones

chord_fingerings_page = (chord, root_note) ->
  fingerings = fingerings_for(chord, root_note)
  filename "Fingerings"
  cols = 10
  rows = 10
  grid {cols, rows, cell_width: padded_fretboard_width + 10, cell_height: padded_fretboard_height + 5}, (cell) ->
    for fingering, i in fingerings[...(cols * rows)]
      cell -> draw_fingerboard(fingering)

chord_page = (chord, options) ->

  draw_book (draw_page) ->
    draw_page()
    ctx.addPage()
  fs.writeFile BuildDirectory + filename + ".pdf", canvas.toBuffer()


#
