Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2026-12-04-digitakt-ii-trial-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Digitakt II: the local beta Status page shows the mock box’s build and running modules. Try starts a RAM trial and Undo restores the previous set. If USB drops during Undo, the page shows the last confirmed set and reads the active modules again on reconnect. Keep stays disabled.
17 changes: 11 additions & 6 deletions src/App.tsx

Large diffs are not rendered by default.

85 changes: 50 additions & 35 deletions src/components/ModelCyclesUnit.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState, useSyncExternalStore, type ReactNode } from 'react'
import { DeviceImage } from '../devices/DeviceImage'
import { MC_UNIT_ROUTE, RYTM_UNIT_ROUTE, deviceHref, type DeviceProfile } from '../devices/registry'
import { DT2_UNIT_ROUTE, MC_UNIT_ROUTE, RYTM_UNIT_ROUTE, deviceHref, type DeviceProfile } from '../devices/registry'
import { findUnit, type MidiAccessLike } from '../engine/elektron/os-upgrade-midi'
import { readMcLog, readMcStatus, type McLoad, type McModules } from '../engine/elektron/mc-link'
import { RYTM_PORT, readRytmLog, readRytmStatus } from '../engine/elektron/rytm-link'
Expand All @@ -12,6 +11,7 @@
import { useMobileWorkspace } from '../hooks/useMobileWorkspace'
import { Icon } from './Icon'
import { LoadChart, Meter } from './OctatrackLoad'
import { UnitStatusHero } from './UnitStatusHero'
import './octatrack-link.css'
import './octatrack-load.css'

Expand All @@ -24,13 +24,16 @@
}
/** A machine the page reads over its link: the model name its USB MIDI port carries, its reader, its route, and how
* its audio note reads. */
export type UnitKind = { port: string; route: string; read: (access: MidiAccessLike) => Promise<UnitStatus | null>; audio: string
type MidiUnitKind = { port: string; route: string; read: (access: MidiAccessLike) => Promise<UnitStatus | null>; audio: string
/** The unit's own log, shared with the member's diagnostics (octatrack-diagnostics.ts reportDeviceLog). */
log?: { machine: DiagnosticLogMachine; read: (access: MidiAccessLike, stop: () => boolean) => Promise<{ log: DeviceLog | undefined } | 'unsupported' | null> } }
export const MC_UNIT: UnitKind = { port: 'Model:Cycles', route: MC_UNIT_ROUTE, read: access => readMcStatus(access), audio: 'the six tracks’ sound takes',
type MockUnitKind = { route: string; source: 'mock' }
export type UnitKind = MidiUnitKind | MockUnitKind
export const MC_UNIT: MidiUnitKind = { port: 'Model:Cycles', route: MC_UNIT_ROUTE, read: access => readMcStatus(access), audio: 'the six tracks’ sound takes',

Check warning on line 32 in src/components/ModelCyclesUnit.tsx

View workflow job for this annotation

GitHub Actions / module-contract

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
log: { machine: 'model-cycles', read: (access, stop) => readMcLog(access, 2000, stop) } }
export const RYTM_UNIT: UnitKind = { port: RYTM_PORT, route: RYTM_UNIT_ROUTE, read: access => readRytmStatus(access), audio: 'the voices, the sample playback and the FX take',
export const RYTM_UNIT: MidiUnitKind = { port: RYTM_PORT, route: RYTM_UNIT_ROUTE, read: access => readRytmStatus(access), audio: 'the voices, the sample playback and the FX take',

Check warning on line 34 in src/components/ModelCyclesUnit.tsx

View workflow job for this annotation

GitHub Actions / module-contract

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
log: { machine: 'analog-rytm-mkii', read: (access, stop) => readRytmLog(access, 2000, stop) } }
export const DT2_UNIT: MockUnitKind = { route: DT2_UNIT_ROUTE, source: 'mock' }

Check warning on line 36 in src/components/ModelCyclesUnit.tsx

View workflow job for this annotation

GitHub Actions / module-contract

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

const INTERVAL = 2000, HISTORY = 150
const SERIES: { key: 'audio' | 'block'; title: string; className: string }[] = [{ key: 'audio', title: 'Audio', className: 'load-core1' }, { key: 'block', title: 'Busiest block', className: 'load-cpu' }]
Expand All @@ -44,7 +47,7 @@
/** Reads the unit every two seconds once MIDI is allowed: identity, live modules and load over one line each time.
* A load window that hasn't moved is a gap. shortcut: kept while this page is open, not app-wide as the Octatrack's;
* record it across pages when someone needs that. */
function useUnit(kind: UnitKind, request: (() => Promise<MidiAccessLike>) | null) {
function useUnit(kind: MidiUnitKind, request: (() => Promise<MidiAccessLike>) | null) {
const [access, setAccess] = useState<MidiAccessLike>()
const [state, setState] = useState<{ status: Status; read?: UnitStatus; points: Point[]; now: number; error?: string }>({ status: request ? 'idle' : 'unsupported', points: [], now: 0 })
useEffect(() => {
Expand Down Expand Up @@ -85,17 +88,47 @@
}

type UnitProps = { device: DeviceProfile; header?: ReactNode; request?: (() => Promise<MidiAccessLike>) | null }
type UnitConnection = { line: ReactNode; led: string; details?: ReactNode; action?: ReactNode }
/** Your Model:Cycles (mc-link.ts). */
export const ModelCyclesUnit = (props: UnitProps) => <ElektronUnit {...props} kind={MC_UNIT} />
/** Your Analog Rytm MKII (rytm-link.ts). */
export const RytmUnit = (props: UnitProps) => <ElektronUnit {...props} kind={RYTM_UNIT} />

/**
* Your unit: the Octatrack's Status (OctatrackHub.tsx, as ZoomHub.tsx has it) over a Modwerk base's link, USB MIDI SysEx:
* the base it runs, its live modules and its audio load. The Model:Cycles and the Analog Rytm MKII share it (`kind`).
* Beta only (App.tsx). `request` asks the browser for MIDI with SysEx; null where it has none.
* the base it runs, its live modules and its audio load. Beta only (App.tsx).
* The local Digitakt II preview supplies its Status view from a mock client.
*/
export function ElektronUnit({ device, header, request = browserMidi(), kind }: UnitProps & { kind: UnitKind }) {
export function ElektronUnit(props: (UnitProps & { kind: MidiUnitKind }) |
(Omit<UnitProps, 'request'> & { kind: MockUnitKind; connection: UnitConnection; children: ReactNode })) {
if ('connection' in props) return <UnitFrame device={props.device} header={props.header} route={props.kind.route} connection={props.connection}>
{props.children}
</UnitFrame>
return <MidiUnit {...props} />
}

function UnitFrame({ device, header, route, connection, children }: {
device: DeviceProfile; header?: ReactNode; route: string; connection: UnitConnection; children: ReactNode
}) {
return <div className="configuration-page octatrack-hub">
{header ?? <header className="hub-page-heading"><div><h1>Your {device.name}</h1></div></header>}
<div className="hub-split">
<UnitStatusHero device={device} line={connection.line} led={connection.led} action={connection.action}>{connection.details}</UnitStatusHero>
<nav className="hub-nav" aria-label={'Your ' + device.name}>
<div className="hub-nav-group">
<h2 className="hub-nav-label">{device.name}</h2>
<ul className="hub-nav-list">
<li><a className="hub-nav-item" href={'#' + route} aria-current="page"><Icon name="grid" size={16} /><span>Status</span></a></li>
<li><a className="hub-nav-item" href={deviceHref(device.id, 'configuration')}><Icon name="sliders" size={16} /><span>Build firmware</span></a></li>
</ul>
</div>
</nav>
<div className="hub-pane"><section className="hub-view hub-view-status" aria-label="Status">{children}</section></div>
</div>
</div>
}

function MidiUnit({ device, header, request = browserMidi(), kind }: UnitProps & { kind: MidiUnitKind }) {
const mobile = useMobileWorkspace()
const { status, read, points, now, error, connect, clear } = useUnit(kind, request)
const sharing = useSyncExternalStore(subscribeDiagnosticPreference, diagnosticPreference, diagnosticPreference).enabled, privacy = browserRequestsPrivacy()
Expand All @@ -117,28 +150,12 @@
<div className="page-heading"><div><h1>Your {device.name}</h1><p>Connecting your {device.name} needs Chrome or Edge on a computer.</p></div></div>
<a className="button button-quiet" href={deviceHref(device.id)}>Open {device.name} page <Icon name="arrow" size={15} /></a>
</div>
return <div className="configuration-page octatrack-hub">
{header ?? <header className="hub-page-heading"><div><h1>Your {device.name}</h1></div></header>}
<div className="hub-split">
<header className="hub-hero">
<DeviceImage device={device} eager />
<div><h2 className="hub-view-title">{device.name}</h2>
<p role="status"><span className={'unit-led is-' + (ready ? 'on' : status === 'connecting' ? 'load' : 'off')} aria-hidden="true" />{line}</p>
{error && <p role="alert">{error}</p>}
</div>
{status === 'idle' && <button className="button button-primary" onClick={connect}>Connect</button>}
</header>
<nav className="hub-nav" aria-label={'Your ' + device.name}>
<div className="hub-nav-group">
<h2 className="hub-nav-label">{device.name}</h2>
<ul className="hub-nav-list">
<li><a className="hub-nav-item" href={'#' + kind.route} aria-current="page"><Icon name="grid" size={16} /><span>Status</span></a></li>
<li><a className="hub-nav-item" href={deviceHref(device.id, 'configuration')}><Icon name="sliders" size={16} /><span>Build firmware</span></a></li>
</ul>
</div>
</nav>
<div className="hub-pane">
<section className="hub-view hub-view-status" aria-label="Status"><div className="hub-console">
return <UnitFrame device={device} header={header} route={kind.route} connection={{
line, led: ready ? 'on' : status === 'connecting' ? 'load' : 'off',
details: error && <p role="alert">{error}</p>,
action: status === 'idle' && <button className="button button-primary" onClick={connect}>Connect</button>,
}}>
<div className="hub-console">
<Meter area="hub-cell-cpu" title="Audio now" value={latest?.audio} note="Its share of the CPU, last half second" />
<Meter area="hub-cell-dsp1" title="Peak block now" value={latest?.block} note="The busiest audio block, last half second" />
<Meter area="hub-cell-dsp2" title="Peak since power-on" value={ready ? tenths(load?.peakPercent) : null} note={load ? count(load.windows, 'window', 'windows') + ' measured' : undefined} />
Expand All @@ -165,8 +182,6 @@
{!ready ? offCell : !modules?.modules.length ? <p className="hub-empty">{modules ? 'No modules loaded. Modules kept over USB show here until the next power cycle.' : 'This base loads no modules over USB.'}</p>
: <ul className="hub-history">{modules.modules.map(module => <li key={module.id}><span className="unit-led is-on" aria-hidden="true" /><span className="hub-history-name"><strong>{module.name || 'Unnamed module'}</strong></span><span className="hub-history-end"><small>{module.id}</small></span></li>)}</ul>}
</section>
</div></section>
</div>
</div>
</div>
</div>
</UnitFrame>
}
15 changes: 6 additions & 9 deletions src/components/OctatrackHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { BaseLayoutRequired, BaseUpdateRequired, baseOutdated, moduleSetReview,
import { baseLayout, baseVersion, type BaseLayout } from '../engine/elekloader/base-variants'
import { comesWithBase } from '../config/usb-audio'
import type { Configuration } from '../config/workspace'
import { DeviceImage } from '../devices/DeviceImage'
import { DEVICES_BY_ID } from '../devices/registry'
import { LINK_BUSY, type OctatrackLink } from '../engine/elekloader/octatrack-link'
import { useOctatrackHealth } from '../hooks/useOctatrackHealth'
Expand All @@ -18,6 +17,7 @@ import { HubSetHead, HubSetList, SetMenu, type SetAction } from './HubSets'
import { Icon, type IconName } from './Icon'
import { OctatrackBackups } from './OctatrackBackups'
import { CardSetButton } from './UnitPanel'
import { UnitStatusHero } from './UnitStatusHero'
import { OctatrackDiagnosticsSettings } from './OctatrackDiagnostics'
import { SupportActions } from './SupportActions'
import { OctatrackOverview } from './OctatrackOverview'
Expand Down Expand Up @@ -158,19 +158,16 @@ function DesktopOctatrackHub({ view, link, inventory, sets, selectedId, needs, u
return <div className="configuration-page octatrack-hub">
{header}
<div className="hub-split">
<header className="hub-hero">
<DeviceImage device={DEVICES_BY_ID.octatrack} eager />
<div><h2 className="hub-view-title">{model}</h2>
{/* While not connected, Screen gives its own detail beside the preview, so the hint stays off it. */}
<p role="status"><span className={'unit-led is-' + led} aria-hidden="true" />{line}{hint && (!screenView || connected) && <span className="hub-hint">{hint}</span>}</p>
{/* While not connected, Screen gives its own detail beside the preview, so the hint stays off it. */}
<UnitStatusHero device={DEVICES_BY_ID.octatrack} title={model} led={led}
line={<>{line}{hint && (!screenView || connected) && <span className="hub-hint">{hint}</span>}</>}
action={!screenView && action}>
{state.notice?.tone === 'error' && hint === state.notice.text && <SupportActions link={link} what="USB link" error={state.notice.text} />}
{connected && <dl className="hub-facts">
<div><dt>Base</dt><dd title={identity!.base}>{baseVersion(identity!.base) ?? <code>{identity!.base.slice(0, 8)}</code>}</dd></div>
{lastSync && <div><dt>Last sync here</dt><dd><b>{lastSync.name}</b> · <time dateTime={lastSync.at}>{when(lastSync.at)}</time></dd></div>}
</dl>}
</div>
{!screenView && action}
</header>
</UnitStatusHero>
<nav className="hub-nav" aria-label="Your Octatrack">
<select className="hub-set-picker" aria-label="Show" value={view === 'set' && selected ? 'set:' + selected.id : view} onChange={event => { const value = event.target.value; if (value.startsWith('set:')) onSelect(value.slice(4)); else window.location.hash = UNIT_VIEWS.find(item => item.view === value)!.href }}>
<optgroup label={model}>{NAV_VIEWS.map(item => <option key={item.view} value={item.view}>{item.title}</option>)}</optgroup>
Expand Down
17 changes: 17 additions & 0 deletions src/components/UnitStatusHero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ReactNode } from 'react'
import type { DeviceProfile } from '../devices/registry'
import { DeviceImage } from '../devices/DeviceImage'

export function UnitStatusHero({ device, title = device.name, led, line, action, children }: {
device: DeviceProfile; title?: string; led: string; line: ReactNode; action?: ReactNode; children?: ReactNode
}) {
return <header className="hub-hero">
<DeviceImage device={device} eager />
<div>
<h2 className="hub-view-title">{title}</h2>
<p role="status"><span className={'unit-led is-' + led} aria-hidden="true" />{line}</p>
{children}
</div>
{action}
</header>
}
Loading
Loading