Show a Chip node as a device with its wave and its pitch (#386)
game-maker / gate (push) Successful in 4m5s
game-maker / suite (push) Failing after 16m5s

The Chip had eleven numbers in rows and nothing that showed what they
do to a note. Its node is now a device of one size like the
Compressor's, and two screens draw the wave and the pitch from the
settings, worked right in the instrument graph.

- ChipPanel is 840x280 in the warm grey of a handheld console. A
  button per wave, the "follow note" lever and a chrome knob per
  number, grouped Oscillator, Slide, Vibrato, Arpeggio and Repeat.
- The wave screen draws two periods as loud as the Chip plays them,
  a square at its duty. toneValue and periodicSteps come out of
  chip.ts, so the screen and the worklet share one formula.
- The pitch screen draws what slide, delta slide, vibrato, arpeggio
  and repeat make of the pitch over a note. It ends where the note
  falls below "min frequency" and starts from A4 while the Chip
  follows the note.
- Idle settings are faded, wired ones greyed and locked, as the rows
  were. Every change is one undo step.
- Knobs take a bipolar range: 0 straight up, the taper bends each
  half. Slide, delta slide, duty sweep and arpeggio use it.
- The Compressor's auto-gain lever is now a Lever with a name of its
  own, which the Chip uses for "follow note".
- Presets give a Chip five columns, as a Filter has four since #385.

Found on the way:

- With the Chip this wide the Laser preset is about 3060 units. In a
  1280 px window Fit stops at the least zoom of 0.25 and cuts the
  Notes node off. The zoom limit is left as it is.

Tests:
- Unit: chip-view (9 new), knob (1 new), chip, chip-presets and
  hardware-view, 53 green
- e2e 34 on melektaus-atx: ALL PASSED, 131 checks (1 new). The
  first run was red on the check itself: a Laser's "min frequency"
  can lie above A4, and the screen then rightly says the note ends
  at once.
- Gate on melektaus-atx: CHECK EXIT 0, 285 files, 4377 tests
- Counter-check: a square drawn with its duty mirrored turns the wave
  test red

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-10 14:55:35 +02:00
1 parent c087993000
commit eb78f3cbf3
14 files changed
+1190 -26

No files matched your search

+16
View File
@@ -46,6 +46,22 @@ describe('a knob', () => {
expect(wheeledValue(0.003, -100, attack)).toBeGreaterThan(0.003);
});
it('has 0 straight up on a bipolar range, and gives the small numbers either way most of the turn (#386)', () => {
const slide = { min: -2000, max: 2000, step: 1, taper: 3, bipolar: true };
expect(knobPosition(0, slide)).toBe(0.5);
expect(knobPosition(2000, slide)).toBe(1);
expect(knobPosition(-2000, slide)).toBe(0);
// 250 st/s, an eighth of the reach, is halfway up the right half; even it would be at 0.5625.
expect(knobPosition(250, slide)).toBeCloseTo(0.75, 9);
expect(knobPosition(-250, slide)).toBeCloseTo(0.25, 9);
expect(knobValue(0.75, slide)).toBe(250);
expect(knobValue(0.5, slide)).toBe(0);
for (const value of [-1200, -7, 0, 3, 640])
expect(knobValue(knobPosition(value, slide), slide)).toBe(value);
expect(knobOrigin(slide)).toBe(0.5);
expect(draggedValue(0, -1, true, slide)).toBe(1);
});
it('fills its arc from 0 when the range has it inside, else from the low end', () => {
expect(knobOrigin(makeup)).toBeCloseTo(0.5, 9);
expect(knobOrigin(threshold)).toBe(0);