Skip to content

drums done - #3

Merged
JasonCaoGit merged 1 commit into
mainfrom
feature/vapi
Sep 13, 2025
Merged

JasonCaoGit merged 1 commit into
mainfrom
feature/vapi

Conversation

@JasonCaoGit

@JasonCaoGit JasonCaoGit commented Sep 13, 2025 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Record short claps and automatically generate a drum groove MIDI.
    • Instrument-aware routing: drums create drum grooves; melodic inputs generate pitched MIDI.
    • End-to-end async pipeline that continues from voice interaction to MIDI creation and DAW handoff.
  • Refactor

    • Timestamped WAV/MIDI outputs to prevent filename conflicts.
    • More robust flow with clearer status and success/failure messaging.
    • Instrument selection read from a config file with sensible fallback.
  • Chores

    • Updated Python runtime version requirement.

@JasonCaoGit
JasonCaoGit merged commit d083e25 into main Sep 13, 2025
1 of 3 checks passed
@coderabbitai

coderabbitai Bot commented Sep 13, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a drum-MIDI generator from clap recordings, routes hum processing by instrument, refactors MIDI export to timestamped files with temp dirs, updates the listen pipeline into an async orchestrator, changes instrument default to drums, and pins Python from 3.13.7 to 3.11.7.

Changes

Cohort / File(s) Summary
Config & Environment
.\tool-versions, instrument.txt
Downgraded Python to 3.11.7. Updated instrument setting text from Piano to Drums.
Audio/MIDI Processing
drum_midi.py, midi.py, hum.py
New clap-to-drum MIDI module with recording and groove generation. MIDI conversion now uses timestamped temp dirs and outputs conflict-free files with better logging and cleanup. Hum recording now accepts instrument, routes to drum or melodic generators, and returns the MIDI path.
Orchestration / Flow
listen.py
Added full_pipeline() to await the WS loop, then read instrument, record hum to timestamped WAV, generate instrument-specific MIDI, and invoke run_cua. Replaced prior inline post-WS flow.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant Listener as listen.py
  participant WS as main() WebSocket
  participant Hum as hum.record_hum()
  participant DrumGen as drum_midi.clap_to_drum_groove()
  participant MelGen as midi.convert_to_midi()
  participant CUA as run_cua()

  User->>Listener: asyncio.run(full_pipeline())
  activate Listener
  Listener->>WS: await main()
  WS-->>Listener: Completed
  Listener->>Listener: Read instrument.txt (fallback "piano")
  Listener->>Hum: record_hum(hum_{{ts}}.wav, instrument)
  alt instrument in {drum, drums, percussion}
    Hum->>DrumGen: clap_to_drum_groove(wav, out_midi)
    DrumGen-->>Hum: midi_file
  else melodic
    Hum->>MelGen: convert_to_midi(wav)
    MelGen-->>Hum: midi_file
  end
  Hum-->>Listener: midi_file or None
  alt midi_file produced
    Listener->>CUA: run_cua(midi_file, instrument)
    CUA-->>Listener: done
  else failure
    Listener-->>User: MIDI creation failed
  end
  deactivate Listener
Loading
sequenceDiagram
  autonumber
  participant Hum as hum.record_hum()
  participant DrumGen as drum_midi.clap_to_drum_groove()
  participant MelGen as midi.convert_to_midi()

  note over Hum: Route by instrument
  alt Drum/Percussion
    Hum->>DrumGen: Generate 4/4 groove from claps
    DrumGen-->>Hum: drum_groove.mid
  else Melodic
    Hum->>MelGen: BasicPitch conversion with timestamped temp dir
    MelGen-->>Hum: *_basic_pitch.mid
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I tapped my paw—clap, clap—what cheer!
A groove hopped out, so crisp to hear. 🥁
The hum took flight to midnight skies,
With timestamped stars in MIDI guise. ✨
Now pipelines waltz in async light—
A rabbit codes, then drums all night! 🐇🎶

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/vapi

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 202d715 and a78ade7.

⛔ Files ignored due to path filters (6)
  • clap.wav is excluded by !**/*.wav
  • hum.wav is excluded by !**/*.wav
  • hum_1757800363_basic_pitch.csv is excluded by !**/*.csv
  • hum_1757801953.wav is excluded by !**/*.wav
  • hum_1757801953_1757801960_basic_pitch.csv is excluded by !**/*.csv
  • hum_1757801981.wav is excluded by !**/*.wav
📒 Files selected for processing (6)
  • .tool-versions (1 hunks)
  • drum_midi.py (1 hunks)
  • hum.py (2 hunks)
  • instrument.txt (1 hunks)
  • listen.py (1 hunks)
  • midi.py (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant