implemented aligned notes

This commit is contained in:
2024-06-21 17:26:50 +02:00
parent f08f30b9e2
commit 0cff9d6799
5 changed files with 94 additions and 12 deletions

View File

@ -58,6 +58,7 @@
// List participants
let linked = ()
let last-seq = none
let last-note = none
for (i, elmt) in elmts.enumerate() {
if elmt.type == "par" {
participants.push(elmt)
@ -107,12 +108,21 @@
seq.insert("linked-note", elmt)
elmts.at(last-seq.i) = seq
}
if elmt.aligned {
let n = last-note.elmt
n.aligned-with = elmt
elmts.at(last-note.i) = n
}
elmts.at(i) = elmt
if elmt.side == "left" {
linked.push("[")
} else if elmt.side == "right" {
linked.push("]")
}
last-note = (
elmt: elmt,
i: i
)
}
}
linked = linked.dedup()