Skip to content

Import projects saved on Tracker CE firmware (.mtp format 6) - #28

Merged
JarlLyng merged 2 commits into
mainfrom
ce-v6-import
Nov 11, 2026
Merged

JarlLyng merged 2 commits into
mainfrom
ce-v6-import

Conversation

@JarlLyng

@JarlLyng JarlLyng commented Nov 4, 2026

Copy link
Copy Markdown
Owner

What & why

Patternaut could not import projects saved on Tracker CE firmware. Closes #25.

CE saves patterns in format 6. Each step there has two more bytes, a Volume and a Micro-move value, so MTPImporter saw an unknown file size and threw.

  • Detecting the layout: the importer tells v5 from v6 by file size, the same way it already tells track counts apart. The two layouts never share a size.
  • Where the values go:
    • Each step's Volume and Micro-move go into a free effect lane. The firmware applies them with the same values as the Volume and Micro-move effects.
    • If the step already has that effect, the effect wins on the device anyway, so the value is dropped.
    • If both lanes hold other effects, the value is dropped and counted. ProjectBundleReader then reports it as an import warning.
  • Writing back: MTPDocument.data() writes a v6 document back as v5, the only layout the exporter writes, so exported projects still load on stock firmware.

The layout comes from CE's strStep in core/source/mtSequencer.h and the sizes in core/include/patternFileValidation.h.

How to test

  • cd PatternautCore && swift test: 161 tests. The new TrackerCEImportTests builds v6 files the way CE writes them and checks:
    • the three file sizes against CE's own constants,
    • lane placement and dropped values,
    • writing back as v5,
    • a whole project import.
  • Still to do before merging: import a project saved on a Tracker running CE 1.0.0 (File > Import Tracker Project…).

Not for 1.1.0, which is in review. This goes in the next version.

Checklist

  • Builds and runs; existing tests pass (cd PatternautCore && swift test)
  • App project regenerated with xcodegen if App/project.yml or sources changed (core only, not needed)
  • No new tracking, accounts, subscriptions, or off-device data
  • Docs / CHANGELOG updated if behavior changed

🤖 Generated with Claude Code

JarlLyng and others added 2 commits November 4, 2026 23:39
Tracker CE writes patterns with two more bytes per step, a Volume and a
Micro-move value, so its files are 16432 bytes for 16 tracks instead of
12336 and the importer refused them. The layout is now told from the file
size, and each step value goes into a free effect lane, which is how the
firmware treats them. Values that find no lane are counted and reported as
an import warning. Export still writes format 5.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JarlLyng

Copy link
Copy Markdown
Owner Author

Tried on hardware on 2026-11-11: a project saved on a Tracker+ running CE 1.0.0 imports with this branch.

  • The file on the card is 16432 bytes, with version [6, 6, 6, 6] in the header.
  • The import found 1 pattern and 1 instrument, and the notes and both FX lanes are intact, including steps where both lanes are in use.
  • The Volume and Micro-move values in that pattern were entered in the FX lanes, not in CE's m | V view. Every step's dedicated bytes are FF FF (empty), so moving those values into lanes is covered by the unit tests only, not yet by a file from the device.

Found on the way, and not caused by this branch: in the sandboxed app, choosing project.mt in the import panel fails, because the sandbox grants access to that one file and not to patterns/ beside it. Choosing the project folder works. That is a separate fix.

@JarlLyng
JarlLyng marked this pull request as ready for review November 11, 2026 21:23
@JarlLyng
JarlLyng merged commit 3fbd3df into main Nov 11, 2026
2 checks passed
@JarlLyng
JarlLyng deleted the ce-v6-import branch November 11, 2026 21:23
JarlLyng added a commit that referenced this pull request Nov 11, 2026
Projects saved on Tracker CE firmware import (#28), the import panel takes
folders only (#29), and the preview moves Micro-move 100 a whole step (#30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import projects saved on Tracker CE firmware (.mtp format v6)

1 participant