mirror of
https://github.com/9x/sheetmusictrainer.git
synced 2026-11-03 22:03:54 +01:00
Phrase mode: count-in no-scoring fix, re-arm timeout for repeated notes, browser QA scripts
This commit is contained in:
@@ -137,3 +137,18 @@ export const INSTRUMENT_DEFINITIONS: Record<string, InstrumentDefinition> = {
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clef + display transpose for rendering, shared by the single-note and
|
||||
* phrase renderers (identical semantics: sounding midi + transpose = written).
|
||||
*/
|
||||
export function resolveClefTranspose(
|
||||
instrumentDef: InstrumentDefinition,
|
||||
difficulty: string,
|
||||
): { clef: ClefMode; transpose: number } {
|
||||
const rangeDef = instrumentDef.ranges.find(r => r.id === difficulty);
|
||||
return {
|
||||
clef: rangeDef?.clef ?? instrumentDef.clefMode,
|
||||
transpose: rangeDef?.transpose ?? instrumentDef.transpose,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user