Skip to content

Feature Request: Implement Song data structure and SysEx parsing #2

@kmorrill

Description

@kmorrill

Summary

SongQuery exists and can query song data from the device, but there's no Song data structure to parse the response. This prevents programmatic creation and modification of song mode sequences.

Current State

What exists:

  • SongQuery - Can query song slots 0-15 and work buffer
  • SysEx query/response infrastructure works

What's missing:

  • Song struct to represent song data
  • SysEx parsing for song responses
  • Song serialization/deserialization
  • Song mutation methods

Use Case

Users want to programmatically:

  • Create song mode sequences (chains of patterns with repeats/mutes)
  • Export/import songs for version control
  • Generate songs algorithmically
  • Build CLI tools that manipulate entire song structures

Technical Details

Based on the Analog Rytm MKII manual:

  • 16 songs per project
  • Songs consist of rows containing chains or patterns
  • Each row can have repeats and per-track mutes
  • Up to 256 pattern entries across 64 chains

Estimated structure:

pub struct Song {
    rows: Vec<SongRow>,
    scratch_pad: SongRow,
    // ... other fields
}

pub struct SongRow {
    chain_or_pattern: ChainOrPattern,
    repeats: u8,
    track_mutes: [bool; 12],
    // ... other fields
}

pub enum ChainOrPattern {
    Pattern(usize),  // Pattern index 0-127
    Chain(Vec<usize>),  // Chain of pattern indices
}

Implementation Tasks

  • Reverse engineer Song SysEx format
  • Implement Song and SongRow data structures
  • Add Song parsing in update_from_sysex_response()
  • Add Song serialization for sending to device
  • Update RytmProject to include songs (currently marked TODO)
  • Add tests for song query/modify operations
  • Document song mode functionality

References

  • Device manual section "12. CHAINS AND SONGS" (page 53)
  • Current TODO comments in src/lib.rs: // TODO: Songs (16) and // TODO: Work buffer song
  • Related: SongQuery implementation in src/query/song.rs

Priority

Medium - Songs are important for complete device control, but patterns can be chained manually on the device as a workaround.


Filed from an active vibe-coding session where we wanted to programmatically chain patterns together. Happy to help test once implemented!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions