Skip to main content

handle_added_tones

Function handle_added_tones 

Source
pub fn handle_added_tones(label: &str) -> String
Expand description

A label’s parentheses turned into music21’s brackets: music21’s handleAddedTones.

The lab writes the tones a chord adds in parentheses and leaves what they replace to be worked out; music21 writes both, so a V(6) becomes V[no5][add6]. A tone over a chord already seven deep replaces nothing, a + says to add without replacing, a - says to take a factor out, and ^ or v says which neighbour a step replaces. A V(64) is the cadential six-four, which music21 has a figure of its own for.

use music21_rs::romantext::tsv::handle_added_tones;

assert_eq!(handle_added_tones("V(64)"), "Cad64");
assert_eq!(handle_added_tones("i(4+2)"), "i[no3][add4][add2]");
assert_eq!(handle_added_tones("V"), "V");