builtin duration: fill note length from context (#37)

This commit is contained in:
Robert Bendun 2023-01-08 08:05:18 +01:00
parent fc95405a06
commit 0b14f0c563

View File

@ -928,9 +928,7 @@ static Result<Value> builtin_duration(Interpreter &interpreter, std::vector<Valu
for (auto &arg : args) {
Try(traverse(interpreter, std::move(arg), [&](Chord &c) {
for (Note &note : c.notes) {
if (note.length) {
total += *note.length;
}
total += note.length ? *note.length : interpreter.current_context->length;
}
}));
}