脚本和API,用于在双音孔手风琴上找到良好的指法
项目描述
concertina-helper
concertina_helper 是一个Python脚本和API,用于在ABC记谱法中为双音孔手风琴上的旋律找到良好的指法。
命令行界面使用
pip install concertina-helper
concertina-helper --help
usage: concertina-helper [-h] [--output_format {UNICODE,ASCII,LONG,COMPACT}]
(--layout_path PATH | --layout_name {20_cg,30_jefferies_cg,30_wheatstone_cg})
[--layout_transpose SEMITONES]
[--bellows_change_cost N]
[--finger_in_same_column_cost N]
[--pull_at_start_of_measure_cost N]
[--outer_fingers_cost N] [--show_all]
input
Given a file containing ABC notation, and a concertina type, prints possible
fingerings.
positional arguments:
input Input file: Parsed either as a list of pitches, one
per line, or as ABC, if the first lines starts with
"X:".
options:
-h, --help show this help message and exit
--output_format {UNICODE,ASCII,LONG,COMPACT}
Output format. "UNICODE" uses "○" and "●" to represent
button state / "ASCII" uses "." and "@" to represent
button state / "LONG" spells out the names of pressed
buttons / "COMPACT" multiple fingerings represented in
single grid (default: LONG)
Layout options:
Supply your own layout, or use a predefined one, optionally transposed
--layout_path PATH Path of YAML file with concertina layout (default:
None)
--layout_name {20_cg,30_jefferies_cg,30_wheatstone_cg}
Name of concertina layout (default: None)
--layout_transpose SEMITONES
Semitones to transpose the layout; Negative transposes
down (default: 0)
Cost options:
Configure the relative costs of different transitions between fingerings
--bellows_change_cost N
Penalize fingerings where the bellows changes
direction between notes (default: 1)
--finger_in_same_column_cost N
Penalize fingerings where one finger changes rows
between notes (default: 1)
--pull_at_start_of_measure_cost N
Penalize fingerings where a pull begins a measure;
Hitting the downbeat with a push can be more musical.
(default: 1)
--outer_fingers_cost N
Penalize fingerings that use outer fingers of either
hand instead of inner. This is useful as a tiebreaker.
(default: 1)
--show_all Ignore cost options and just show all possible
fingerings (default: False)
有关命令行界面使用的示例,请参阅 EXAMPLES.md
。
API使用
有关API使用的详细信息,请参阅API文档。
开发
有关典型开发者设置的详细信息,请参阅demo-api.sh
。这些示例脚本也用于持续集成。
发布新版本
- 创建功能分支
- 更新
__version__
在__init__.py
- 运行
flit publish
- 创建带有更新版本的PR并进行合并
相关工具
为旋律生成指法
- Anglo Concertina Fingering Generator:网页,接受ABC记谱法,返回ABC记谱法,并使用abcjs进行渲染
- concertina-pbqp:C++; 将其建模为一个NP难题,但使用求解器库来得到近似解。
音符和和弦
- Anglo Piano:网页,包含钢琴和各种手风琴布局。显示音符和和弦的所有可能指法。
- KonzertinaNetz:德语。包含可下载的Windows
.exe
文件。