apply changes from commit 986545b2ec and 0b14f0c563

This commit is contained in:
Mateusz Piątkowski 2023-01-08 14:20:52 +01:00
parent c8b8adca5d
commit d85c29427d

View File

@ -1053,9 +1053,7 @@ static Result<Value> builtin_duration(Interpreter &interpreter, std::vector<Valu
for (auto &arg : args) { for (auto &arg : args) {
Try(traverse(interpreter, std::move(arg), [&](Chord &c) { Try(traverse(interpreter, std::move(arg), [&](Chord &c) {
for (Note &note : c.notes) { for (Note &note : c.notes) {
if (note.length) { total += note.length ? *note.length : interpreter.current_context->length;
total += *note.length;
}
} }
})); }));
} }
@ -1362,6 +1360,7 @@ static Result<Value> builtin_note_on(Interpreter &interpreter, std::vector<Value
note = interpreter.current_context->fill(note); note = interpreter.current_context->fill(note);
interpreter.midi_connection->send_note_on(chan.as_int(), *note.into_midi_note(), vel.as_int()); interpreter.midi_connection->send_note_on(chan.as_int(), *note.into_midi_note(), vel.as_int());
} }
return Value{};
} }
return Error { return Error {
@ -1399,6 +1398,7 @@ static Result<Value> builtin_note_off(Interpreter &interpreter, std::vector<Valu
note = interpreter.current_context->fill(note); note = interpreter.current_context->fill(note);
interpreter.midi_connection->send_note_off(chan.as_int(), *note.into_midi_note(), 127); interpreter.midi_connection->send_note_off(chan.as_int(), *note.into_midi_note(), 127);
} }
return Value{};
} }
return Error { return Error {