diff --git a/README.md b/README.md index 193a049..c56622d 100644 --- a/README.md +++ b/README.md @@ -108,14 +108,44 @@ The reverse plugin normalizes subscripts (strips them) before pitch lookup. The plugin architecture supports migration from Unicode text to custom calligraphy symbols: -1. **Prepare calligraphy images**: Create SVG or PNG files (ro.svg, tsu.svg, chu_ro.svg, etc.) -2. **Install as Sibelius symbols**: Edit > Symbols > New Symbol, name with prefix `kinko_ro`, `kinko_tsu`, etc. -3. **Modify forward plugin** (line ~145): Replace `bar.AddText()` with `bar.AddSymbol()` -4. **Modify reverse plugin**: Iterate SymbolItem objects instead of Text objects +### Migration Steps -See [README_Shakuhachi.txt](README_Shakuhachi.txt) for detailed migration steps. +1. **Prepare calligraphy images**: Create SVG or PNG files for each symbol: + - `ro.svg`, `tsu.svg`, `re.svg`, `chi.svg`, `ri.svg`, `u.svg` + - `chu_ro.svg`, `dai_ro.svg`, `u_san.svg`, etc. + - Ensure consistent size and baseline alignment -Reference implementation: [shakuhachi-ro](https://github.com/chrisrauh/shakuhachi-ro) +2. **Install as Sibelius symbols**: + - Edit > Symbols > New Symbol + - Import each image + - Name with prefix: `kinko_ro`, `kinko_tsu`, `kinko_chu_ro`, `kinko_u_san`, etc. + +3. **Modify forward plugin** (line 145): + - Replace: `text = bar.AddText(position, kinkoChar, "Technique");` + - With: `text = bar.AddSymbol(position, GetSymbolName(kinkoChar));` + - Add symbol name mapping function: + ```manuscript + GetSymbolName "(kinkoChar) { + if (kinkoChar = "ロ") { return "kinko_ro"; } + if (kinkoChar = "中ロ") { return "kinko_chu_ro"; } + if (kinkoChar = "大ロ") { return "kinko_dai_ro"; } + if (kinkoChar = "ツ") { return "kinko_tsu"; } + // ... etc for all characters + }" + ``` + +4. **Modify reverse plugin**: + - Change iteration from Text objects to SymbolItem objects + - Reverse lookup: symbol name → Kinko character → pitch + - Add fallback: check `Sibelius.SymbolExists(symbolName)` before AddSymbol + +5. **Fallback handling**: + - If symbol not installed, fall back to Unicode text with user warning + - Allows incremental adoption without breaking existing functionality + +### Reference Implementation + +[shakuhachi-ro](https://github.com/chrisrauh/shakuhachi-ro) - SVG-based rendering with similar modifier/note separation architecture ## Requirements