Feat: fixes and demo

This commit is contained in:
2026-02-23 01:18:43 +01:00
parent 009d68087d
commit d9e6505e07
3 changed files with 94 additions and 42 deletions

View File

@@ -316,15 +316,25 @@ fn arp_no_arp_unchanged() {
#[test]
fn arp_mixed_cycle_and_arp() {
// CycleList sound + ArpList note → flat loop, sound cycles
let outputs = expect_outputs(r#"sine saw s c4 e4 g4 arp note ."#, 3);
// CycleList sound (2) + ArpList note (3) → 3 arp × 2 poly = 6 voices
// Each arp step plays both sine and saw simultaneously (poly stacking)
let outputs = expect_outputs(r#"sine saw s c4 e4 g4 arp note ."#, 6);
let sounds = get_sounds(&outputs);
// Sound is CycleList, cycles across the 3 arp emissions
// Arp step 0: poly 0=sine, poly 1=saw
assert_eq!(sounds[0], "sine");
assert_eq!(sounds[1], "saw");
// Arp step 1: poly 0=sine, poly 1=saw
assert_eq!(sounds[2], "sine");
assert_eq!(sounds[3], "saw");
// Arp step 2: poly 0=sine, poly 1=saw
assert_eq!(sounds[4], "sine");
assert_eq!(sounds[5], "saw");
let notes = get_notes(&outputs);
// Both poly voices in each arp step share the same note
assert!(approx_eq(notes[0], 60.0));
assert!(approx_eq(notes[1], 64.0));
assert!(approx_eq(notes[2], 67.0));
assert!(approx_eq(notes[1], 60.0));
assert!(approx_eq(notes[2], 64.0));
assert!(approx_eq(notes[3], 64.0));
assert!(approx_eq(notes[4], 67.0));
assert!(approx_eq(notes[5], 67.0));
}