Skip to content

v0.17.0

Choose a tag to compare

@eigensoundlab eigensoundlab released this 06 Nov 15:47
· 44 commits to main since this release

Kurator 0.17.0 – Rows for long sounds, Playhead across the library

Highlights

Rows and height for long sounds

Until now a sound was always one waveform stretched over the width of the screen, with only the
wheel zoom for detail. Now its height is yours to choose.

  • Rows ▾ next to the style menu sets a row height:
    • in the viewer: One row, or rows of 320, 240, 160, 120 or 80 px;
    • in the side panel: One row, or rows of 140, 96 or 64 px.
  • A long sound wraps onto as many rows as fit, like lines of text:
    • every row covers the same time, starting at round times (5 s, 10 s, 15 s, 30 s, 1 min, 5 min…,
      up to an hour), so rows can be compared at a glance;
    • in the viewer every row has its own time ruler; the menu's tooltip says how many rows there are
      and how long each is (e.g. "4 rows of 3 min");
    • every row holds at least 5 seconds, so short effects stay on one row;
    • One row is the full-height view of earlier versions. The panel and the viewer remember their
      own choice.
  • Everything works on every row: click to play from there, drag to select (also across rows),
    Shift+click to extend, hover times, the playback cursor and the wheel zoom (the time under the
    pointer stays in place). All styles wrap, including the spectrogram and Playhead analysis.
  • Side panel: drag the bottom edge of the sound preview to make it taller or shorter (90 px up to
    80 % of the window). Double-click the edge to go back to 300 px. Remembered.
  • Shift+wheel (or a sideways swipe on a touchpad) moves along a zoomed sound; the wheel still
    zooms. Zoom now goes down to about 20 ms of a long sound (before: 0.2 % of its length, which is
    7 s of an hour).

Detail where it's needed

  • Waveform: when rows or zoom need more columns than the whole-sound overview has (4,000 in the
    viewer), Kurator reads the part on screen again at the resolution the rows need, with some room
    either side for panning. GET /api/audio/{id}/wave?bins=&start=&end=: up to 16,000 columns, and
    never more than there are samples, so a close zoom shows single samples.
  • Spectrogram: the same for the spectrogram,
    GET /api/audio/{id}/spectrogram?w=&h=&start=&end=&ref=. The response says which part it covers
    (X-Start, X-End) and the level it drew brightest (X-Ref); passing that back as ref gives
    the finer picture the same colours as the overview.
  • Spectrograms of long sounds cover the whole sound. Before, a sound longer than 10 minutes got
    a spectrogram of its first 10 minutes, stretched over the full length. Now a long part is read one
    window per column, so an hour costs about as much as a minute (a 15-minute WAV: 0.5 s; FLAC:
    1.1 s). Windows are centred on their column, the same whether read at once or one by one (a
    test compares the two). Formats only ffmpeg reads (M4A, AAC, WMA) still get 10 minutes per
    picture; past that the view says zoom in to see the spectrogram here.
  • Lighter playback: the waveform, spectrogram or Playhead strip and the rulers are drawn once
    into a cached layer. During playback the 60 frames a second only redraw the cursor, the selection
    and the hover line. Measured on a 12-minute sound on 4 rows: 90 frames in 1.5 s, none slower than
    8 ms.

Playhead across the library

Playhead analysis (optional, off by default: ⚙ Settings → Sounds) was one sound at a time in 0.16.
Now a whole library can be analysed, and the results filter and sort the grid.

  • Analyse sounds… (⚙ Settings → Sounds, or in Look ▾): the sounds not analysed yet, the
    sounds in the current view, or all of them again.

    • With the Playhead command line (playhead on the PATH, or KURATOR_PLAYHEAD pointing to
      it; a .js file runs with node): in the background, a few sounds at a time; the dialog can
      be closed and opened again to see the progress.
      • Kurator decodes the samples, exactly as it does for the browser (up to 2 minutes at the
        file's own rate and up to 2 channels, longer ones at 22.05 kHz mono, the first 10 minutes),
        and pipes raw float32 into playhead analyze - --profile auto. The document must pass the
        same checks as one from the browser.
      • No new Python dependency, and Kurator itself still needs no Node.
    • Without it, in this browser: one sound after another in the same worker as the waveform
      view; keep the tab open.
    • Measured here (2 CPU cores): 11 sample sounds, from a 0.8 s thud to a 14-minute AAC file, in
      37 s with the command line; two short effects in 1.8 s in the browser.
  • Summaries in the catalog. For every stored document Kurator keeps a summary of it in a new
    table (ph_summary, catalog schema 11): time arrow, burstiness, material and whether it is
    reliable, ring time (T60), phase coherence, spectral kurtosis, how harsh it gets (90th percentile
    of the harshness curve), loudness range, tempo, sections. It is filled whether the document came
    from the browser or the command line. Documents stored by 0.16 are summarised on the first start.
    A summary counts only while the file is unchanged.

  • Look ▾ → Sound character (with Playhead on). Choices in one line are alternatives; lines
    combine. Saved views keep them.

    Choice Rule
    Hit-like / Swell-like time arrow T20 above 0.3 / below −0.3
    Bursty / Regular burstiness above 0.1 / below −0.1
    Metal-like / Glass-like / Damped Playhead's material class, where it is reliable
    Long ring / Short decay T60 ≥ 1 s / < 0.3 s, where reliable
    Tonal / Noisy phase coherence ≥ 0.5 / ≤ 0.1
    Harsh / Impulsive the top quarter of your analysed sounds (harshness / spectral kurtosis)
    Steady beat / Sections a tempo Playhead is sure of / two or more sections
    Analysed / Not analysed an analysis of the file as it is now, or none

    Harsh and impulsive are relative because there is no agreed line for them; the other rules use
    the signs and units Playhead documents. The tooltips give each rule.

  • Sort by (with Playhead on): Harshness, Impulsiveness, Ring time, Burstiness,
    Loudness range. Sounds without a value go last in both directions; ring time counts only where
    Playhead trusts its decay estimate (not on music mixes).

  • Playhead strips as grid thumbnails (⚙ Settings → Sounds → Playhead strips as thumbnails of
    analysed sounds
    , in any of Playhead's looks).

    • Drawn by Playhead.drawStrip() from a light copy of the stored document
      (GET /api/audio/{id}/playhead/thumb): curves, waveform and spectrogram thinned to at most 320
      columns (means, outer min/max, the loudest band), everything else as it is. A 2.5-minute piece
      goes from 656 KB to 109 KB.
    • Long sounds show their analysed first 10 minutes, with the rest shaded; the length label stays.
    • Sounds without an analysis keep their waveform.
  • Markers (side panel → Playhead → Markers…): sections as regions; sound events, bar lines and
    onsets as markers. Playhead.toMarkers() picks them, as playhead markers does; Kurator writes:

    • REAPER: a Region/Marker Manager CSV (#,Name,Start,End,Length,Color, times as m:ss.mmm).
      In REAPER set the ruler to Minutes:Seconds, then Region/Marker Manager → Options → Import.
    • Audacity: labels (File → Import → Labels…).
    • Tab-separated: kind, start, end, name, the columns of playhead markers.
  • The store keeps up to 2 GB of documents (before: 3,000 files), the oldest going first.

  • With Playhead off nothing changes: no requests for it, no filters or sorts; a saved view's
    Playhead filter and sort rest until it is switched on again.

Fixes

  • M4A/MP4 thumbnails: files with their index at the end (ffmpeg's default; many podcasts and
    phone recordings) couldn't be read through a pipe and had a blank thumbnail. They are now read
    from a temporary copy.
  • The viewer's time ruler showed 0.00 s at the start of long sounds; it shows 0:00.
  • The spectrogram's frequency labels assumed 22.05 kHz for 48 kHz files; they use the real rate.
  • An error of the previous sound no longer shows while the next one loads.

API

  • GET /api/audio/{id}/wave?bins=&start=&end= – a part of the sound in detail (start, end in
    seconds; up to 16,000 bins, never more than samples). The answer has start and end.
  • GET /api/audio/{id}/spectrogram?w=&h=&start=&end=&ref= – headers X-Start, X-End, X-Ref.
  • GET /api/audio/{id}/playhead/thumb – a light copy of the latest stored document; X-Duration.
  • GET /api/playhead/status – sounds, analysed, missing; the command line (path, version); the job;
    the filter choices with labels and rules.
  • GET /api/playhead/todo?scope=missing|all – [id, duration, name] for the browser.
  • POST /api/playhead/analyse {scope: "missing" | "all" | "ids", ids}, POST /api/playhead/cancel.
  • GET /api/items?ph=hit,metal&sort=harshness|impulsiveness|ring|burstiness|dynamics&phinfo=1.

Tests

  • tests/test_v17.py (13 tests):
    • a part of the waveform (bins capped at the samples; the click at 5.0 s found) and refused ranges;
    • a part of the spectrogram with the overview's level; a long part read window by window equals
      reading it at once;
    • an AAC file with its index at the end: the thumbnail decodes it, and its spectrogram covers at
      most the limit (with ffmpeg);
    • documents: checks, summaries, the thinned copy (still consistent for drawStrip), the store's
      size limit;
    • every filter, alternatives and combinations, the relative quarter, sorts with unanalysed sounds
      last, a changed file dropping out, grid stamps, the thumbnail copy, saved views;
    • summaries from a 0.16 store; the catalog migration from schema 10;
    • the command-line job with a stand-in playhead (version, samples on stdin, a failing sound, a
      second run for given ids, refusal without the app's Origin) and without one (409).
  • tools/ui_check_v17.py (browser): off means no Playhead requests; panel rows and the drag
    handle; viewer rows (same time scale, selection across rows, click on a row, playback frame
    times, zoom and Shift+wheel with the finer waveform, the spectrogram on rows, an AAC file); the
    analysis dialog with the command line; grid strips; the Look filter and sorts; markers.
  • tools/make_v17_samples.py: a 12-minute recording with knocks every 37 s and two whistles, a
    14-minute AAC tone that steps every minute, a 3-minute drone, and short effects of different
    character (glass tap, rubber thud, bursty rain, riser).
  • The full suite: 167 passed, 5 skipped (170 with the AI add-on); the v0.17 and Playhead tests also
    on Python 3.11. pip-audit: no known vulnerabilities. Not tested on Windows hardware here (the
    stand-in command line test is skipped on Windows).

Later

  • A small study, with consent, of whether the strips and the sound-character filters help
    people find sounds.
  • REAPER: curves as take envelopes; markers written next to the sound.
  • Languages: if Kurator gets translations, Playhead.localize() and the shared terms of
    sound-vocabulary.