More robust midi implementation
Some checks failed
Deploy Website / deploy (push) Failing after 4m58s

This commit is contained in:
2026-01-31 23:58:57 +01:00
parent 15a4300db5
commit 2100b82dad
12 changed files with 393 additions and 201 deletions

View File

@@ -42,11 +42,11 @@ fn test_ccval_returns_zero_without_cc_memory() {
#[test]
fn test_ccval_reads_from_cc_memory() {
let cc_memory: CcMemory = Arc::new(Mutex::new([[0u8; 128]; 16]));
let cc_memory: CcMemory = Arc::new(Mutex::new([[[0u8; 128]; 16]; 4]));
{
let mut mem = cc_memory.lock().unwrap();
mem[0][1] = 64; // channel 1 (0-indexed), CC 1, value 64
mem[5][74] = 127; // channel 6 (0-indexed), CC 74, value 127
mem[0][0][1] = 64; // device 0, channel 1 (0-indexed), CC 1, value 64
mem[0][5][74] = 127; // device 0, channel 6 (0-indexed), CC 74, value 127
}
let f = forth();
@@ -205,25 +205,25 @@ fn test_midi_program_clamping() {
#[test]
fn test_midi_clock() {
let outputs = expect_outputs("mclock", 1);
assert_eq!(outputs[0], "/midi/clock");
assert_eq!(outputs[0], "/midi/clock/dev/0");
}
#[test]
fn test_midi_start() {
let outputs = expect_outputs("mstart", 1);
assert_eq!(outputs[0], "/midi/start");
assert_eq!(outputs[0], "/midi/start/dev/0");
}
#[test]
fn test_midi_stop() {
let outputs = expect_outputs("mstop", 1);
assert_eq!(outputs[0], "/midi/stop");
assert_eq!(outputs[0], "/midi/stop/dev/0");
}
#[test]
fn test_midi_continue() {
let outputs = expect_outputs("mcont", 1);
assert_eq!(outputs[0], "/midi/continue");
assert_eq!(outputs[0], "/midi/continue/dev/0");
}
// Test message type priority (first matching type wins)