mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 04:44:33 +01:00
Parameter locks: hold a step on SEQ > STEP and turn a knob; SEQ > AUTO LIST lists and edits the locks and automation; lock edits undo. SEQ TOOLS (SEQ held on the SEQ pages): CLEAR, REVERSE, SHIFT, RANDOM, COOK, BEAT and the DRUM lane tools. REC layer (REC held): CLEAR, CLICK, COUNT-IN, CLICK LEVEL. Metronome and count-in (MENU > AUDIO), never in USB audio. MIDI CC map (5, 7, 10, 71..75, 91, 93, 94); DRUM lane levels (EDIT > LANES, LANES 2; projects FUN9). USB audio input at 44.1 or 48 kHz. Step recording at the cursor (SEQ > STEP, REC while stopped); restore the last session at power-on (MENU > SYSTEM > RESTORE LAST). Eight more ARP modes; MENU > CONTROL > SCALE LEDS; MENU > DISPLAY > SCREEN OFF. The header in three parts with a metronome; the new splash; the power-on LED sweep; DRUM grid beats on the key LEDs. Fast knob turns keep every click; KNOB ACCEL up to x8, on the FX and GLO layers too (#126). MASTER read from the pot before the audio starts, keys silent under the splash (#137). The update loader checks the whole package before erasing anything; robustness against damaged packages and stored data; sanitizer and fuzz runs in tests/run_tests.sh. Smaller icons in flash.
67 lines
2.5 KiB
Python
67 lines
2.5 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
# Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments
|
|
"""Check a recording of the USB audio input of a FELUCCA_UAC_TONE=1 build (src/usb.c): 16-bit stereo WAV,
|
|
recorded at the rate the FM-1 was set to (44.1 or 48 kHz; the triangles are made at that rate, so they
|
|
must arrive exactly). Frame n of the stream is phase ph = n % 100 of
|
|
L = q * 1000 - 25000, R = q2 * 1000 - 25000, q = ph < 50 ? ph : 100 - ph, q2 = |50 - ph|
|
|
so every frame must be the one after the frame before: a lost frame or a repeated one shows as a break.
|
|
The leading silence (the stream starting) and the end of the file are skipped.
|
|
tools/uac_tone_check.py REC.wav [more.wav ...] exit 1 if any file has a break"""
|
|
import sys
|
|
import wave
|
|
from array import array
|
|
|
|
|
|
def tri(ph):
|
|
q = ph if ph < 50 else 100 - ph
|
|
return q * 1000 - 25000, abs(50 - ph) * 1000 - 25000
|
|
|
|
|
|
TRI = [tri(p) for p in range(100)]
|
|
|
|
|
|
def check(path):
|
|
with wave.open(path, "rb") as w:
|
|
ch, width, rate, n = w.getnchannels(), w.getsampwidth(), w.getframerate(), w.getnframes()
|
|
raw = w.readframes(n)
|
|
if ch != 2 or width != 2:
|
|
print(f"{path}: {ch} ch, {8 * width} bit: need a 16-bit stereo recording")
|
|
return False
|
|
a = array("h", raw)
|
|
if sys.byteorder == "big":
|
|
a.byteswap()
|
|
fr = [(a[2 * i], a[2 * i + 1]) for i in range(len(a) // 2)]
|
|
i = 0
|
|
while i < len(fr) and fr[i] == (0, 0):
|
|
i += 1
|
|
start, breaks, first = i, [], None
|
|
ph = None
|
|
while i < len(fr):
|
|
if ph is None: # (re)sync: the phase that fits this frame and the next
|
|
cand = [p for p in range(100) if TRI[p] == fr[i] and i + 1 < len(fr) and TRI[(p + 1) % 100] == fr[i + 1]]
|
|
if not cand:
|
|
i += 1
|
|
continue
|
|
ph = cand[0]
|
|
elif TRI[ph] != fr[i]:
|
|
breaks.append(i)
|
|
if first is None:
|
|
first = i
|
|
ph = None
|
|
continue
|
|
ph = (ph + 1) % 100
|
|
i += 1
|
|
good = len(fr) - start
|
|
print(f"{path}: {rate} Hz, {len(fr)} frames ({len(fr) / rate:.1f} s), from frame {start}: "
|
|
f"{len(breaks)} break(s)" + (f", first at frame {first} ({first / rate:.3f} s)" if breaks else "")
|
|
+ (f"; {good} frames checked" if good else ""))
|
|
return not breaks and good > 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) < 2:
|
|
sys.exit(__doc__)
|
|
ok = all([check(p) for p in sys.argv[1:]])
|
|
sys.exit(0 if ok else 1)
|