Skip to content

fix: convert named Strudel notes when freezing to MIDI #1812

Description

@beejsbj

Description

Freezing a Strudel melody written with note names creates no MIDI track. Numeric note values work, but normal values such as "d4" are coerced through Number(...) and become NaN before MIDI conversion.

Tested commit: 2bebdd2cbaaef1092a06ff613c7868c9f3bd4b6c.

Steps to Reproduce

  1. Create a Strudel track in the web app.
  2. Set its code to:
note("d4 f4 a4").s("triangle")
  1. Choose Freeze to MIDI for one bar.
  2. Repeat with note("62 65 69").s("triangle") as a control.

Expected Behavior

Both forms create a piano-roll track containing the corresponding MIDI notes (d4 = 62, f4 = 65, a4 = 69).

Actual Behavior

The named-note form returns no MIDI track because every note is discarded as NaN; the numeric control creates MIDI notes.

Environment

  • Browser: Google Chrome 147.0.7727.101 (headless Playwright)
  • OS: Ubuntu 24.04.3 LTS
  • Node version: 24.13.0
  • Audio path: web / Tone.js

Screenshots / Logs

queryPatternEvents applies Number(noteVal), and strudelEventsToMidiNotes filters NaN. The freeze action then returns null for an empty note list (source).

Acceptance Criteria

  • note("d4 f4 a4") freezes to a piano-roll track with pitches 62, 65, and 69.
  • Numeric-note conversion continues to work.
  • Invalid note values fail predictably without emitting NaN MIDI pitches.
  • Regression tests cover both named and numeric Strudel note values.
  • Fix passes all quality gates.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions