Skip to content

FEAT: add ability to send pach to synth through CC messages - #3

Merged
cournape merged 4 commits into
mainfrom
feat/apply-patch
Oct 8, 2025
Merged

FEAT: add ability to send pach to synth through CC messages#3
cournape merged 4 commits into
mainfrom
feat/apply-patch

Conversation

@cournape

@cournape cournape commented Oct 8, 2025

Copy link
Copy Markdown
Owner

How to use:

python main.py send-patch test-patch.prm

@cournape
cournape requested a review from Copilot October 8, 2025 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to send synthesizer patches via MIDI Control Change (CC) messages. The feature enables users to apply a patch file (.prm) to a synthesizer by converting patch parameters to appropriate CC messages and sending them through MIDI.

  • Added a new CLI command send-patch to apply patch files to the synth through MIDI
  • Implemented CC message generation logic in the JU06AState class
  • Added parameter scaling logic to handle different value ranges between patch files and CC messages

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/text2synth/state.py Added CC message generation method and parameter scaling constants
main.py Added CLI command and MIDI output functionality for sending patches

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/text2synth/state.py Outdated
Comment thread src/text2synth/state.py Outdated
Comment thread src/text2synth/state.py

patch_attribute = data["patch_attribute"]
value = getattr(self, patch_attribute)
if patch_attribute in DOUBLE_ATTRIBUTES:

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The division by 2 for double attributes lacks explanation. Consider adding a comment explaining why these values need to be halved for CC transmission.

Suggested change
if patch_attribute in DOUBLE_ATTRIBUTES:
if patch_attribute in DOUBLE_ATTRIBUTES:
# Double attributes have a range of 0..255 at the synth level, but MIDI CC messages only support 0..127.
# Therefore, we divide by 2 to fit the value into the MIDI CC range for transmission.

Copilot uses AI. Check for mistakes.
Comment thread main.py Outdated
cournape and others added 3 commits October 8, 2025 23:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cournape
cournape merged commit be686f2 into main Oct 8, 2025
1 check passed
@cournape
cournape deleted the feat/apply-patch branch October 8, 2025 14:33
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.

2 participants