Making Tsugaru notation with LilyPond

I’ve been working on implementing the features needed to make LilyPond support Tsugaru shamisen notation, and I think it’s now complete enough that I can share it.

This example shows most of the output features:

Example output

Here’s what’s included:

  • Predefined tunings
    • honchoushiTuning (C F C’)
    • niagariTuning (C G C’)
    • sansagariTuning (C F B♭’)
  • Annotations
    • \hajiki left-hand pluck ハ
    • \sukui upstroke ス
    • \uchi hammer-on ウ
    • \oshi oshibachi ⅃
    • \keshi mute ケ
  • Underlines for note lengths
  • Dot rests (with underlines as appropriate)
  • Compressed spacing for 4300 phrases and similar

There are instructions and more details on the project page.

Please try it out and let me know how you get on!

3 Likes

Wow I really really love this! Can’t even imagine how hard it was to code that XDDD

Just one thing: I tried to use variables but they don’t show up in the .pdf;
is it because they are declared outside of the \score thing so the stuff I declare as the variable can’t be read as shamisen notation? (I have no clue what I’m talking about and it’s highly likely that I’m just stupid and don’t know how LilyPond works, if that’s true…nevermind anything I said XDD)

\header{
title = “Sou”
composer = “Masahiro Nitta”

parta = {dis’16 dis’ \sukui dis’8 c’
(c’) g ais c’
(c’) g ais c’
dis’16 dis’ \sukui dis’8 c’ ais4 } <-VARIABLE
}

\score {
\new TabStaff {
\set TabStaff.stringTunings = #niagariTuning <-SHAMI STUFF
\shamisenNotation
\time 2/4
when I try to declare the variable here the program gives me an error message
c8 \parta
dis8 \parta

}
}

variable is not in the shami stuff section = variable IS not shami stuff???

I’m glad you like it!

It’s nothing to do with the shamisen notation: it’s just the way that LilyPond works.

The only problem is that you’ve assigned the variable within the \header section. It needs to be at the top level, i.e. outside any {} block. If you do this instead, it will work:

\version "2.18.2"
\include "shamisen.ly"

\header {
  title = "Sou"
  composer = "Masahiro Nitta"
}

parta = {
  dis'16 dis' \sukui dis'8 c'
  (c') g ais c'
  (c') g ais c'
  dis'16 dis' \sukui dis'8 c' ais4
}

\score {
  \new TabStaff {
    \set TabStaff.stringTunings = #niagariTuning
    \shamisenNotation
    \time 2/4
    c8 \parta
    dis8 \parta
  }
}

If you’d like to see a really extensive example, I used a lot of variables in the source of Akita Ondo on shamisen.space.

1 Like

Wow!! Thank you so much! :smiley:

What does this big black dot mean and the small one next to zero, and what does Keshi mute mean?

The big black dot in the centre is a rest (¼ note by default, as with the numbers, halved in length by each underscore). The small dot works like a dotted note in Western notation: multiply duration by 1½.

Keshi means that the note is immediately muted, i.e. played staccato.

1 Like

Is anyone else getting error messages when they engrave? My log says:

warning: articulation types should be symbols instead of strings since 2.23.6. Please replace (make-articulation “hajiki” …) by (make-articulation 'hajiki …) or run convert-ly.
warning: articulation types should be symbols instead of strings since 2.23.6. Please replace (make-articulation “sukui” …) by (make-articulation 'sukui …) or run convert-ly.
warning: articulation types should be symbols instead of strings since 2.23.6. Please replace (make-articulation “uchi” …) by (make-articulation 'uchi …) or run convert-ly.
warning: articulation types should be symbols instead of strings since 2.23.6. Please replace (make-articulation “oshi” …) by (make-articulation 'oshi …) or run convert-ly.
warning: articulation types should be symbols instead of strings since 2.23.6. Please replace (make-articulation “keshi” …) by (make-articulation 'keshi …) or run convert-ly.

I thought the error was mine but the same error codes appear when I use the source file for Tsugaru Yosare Bushi from shamisen.space.

I also get the warning

warning: script-stencil property must be pair: ()

over a dozen times when the program is processing graphical objects.

Any idea how to fix this?

Lastly, can someone point me to a safe place to download the IPAexGothic font? The current links appear to be broken.

I’m on Lilypond 2.22.1, but you’re using a newer version, which is why you’re seeing those messages. Unless I’m mistaken those are only warnings, not errors. They tell me that I’ll need to make some changes to support newer versions, but I don’t think you need to worry.

I’ve tracked down the font and updated the documentation. It’s here: https://moji.or.jp/wp-content/ipafont/IPAexfont/ipaexg00401.zip

1 Like

Thank you for the font link!

I found the old binaries for LilyPond so using 2.22.1 is an option but given my lack of programming or LilyPond experience I’m going to stick with 2.24.3 for the moment. Frescobaldi still engraves the music correctly so you are right that I can ignore the sea of red highlighting in the text input window. :laughing: