Skip to content

Conversation

didier-brown
Copy link

I've modified quickstarts/Get_started_LyriaRealTime.py to replace command-line input with an OSC (Open Sound Control) server for controlling Lyria music generation.

Key changes:

  • I integrated the python-osc library to create an OSC server.
  • The OSC server runs in a separate thread and communicates with the main asyncio loop via an asyncio.Queue.
  • I implemented handlers for the following OSC messages:
    • /lyria/setPrompts (string "Prompt1:Weight1,..."): Sets weighted musical prompts.
    • /lyria/play: Starts/resumes playback.
    • /lyria/pause: Pauses playback.
    • /lyria/stop: Stops generation and exits.
    • /lyria/bpm (int/float or "AUTO"): Sets BPM.
    • /lyria/scale (string or "AUTO"): Sets musical scale.
  • Original audio output via PyAudio is maintained.
  • I added quickstarts/osc_test_client.py for testing OSC functionality.
  • I updated dependencies to include python-osc.

This modification allows for external control of the Lyria script, enabling integration with applications like TouchDesigner as outlined in the project plan.

I've modified `quickstarts/Get_started_LyriaRealTime.py` to replace command-line input with an OSC (Open Sound Control) server for controlling Lyria music generation.

Key changes:
- I integrated the `python-osc` library to create an OSC server.
- The OSC server runs in a separate thread and communicates with the main asyncio loop via an `asyncio.Queue`.
- I implemented handlers for the following OSC messages:
    - `/lyria/setPrompts` (string "Prompt1:Weight1,..."): Sets weighted musical prompts.
    - `/lyria/play`: Starts/resumes playback.
    - `/lyria/pause`: Pauses playback.
    - `/lyria/stop`: Stops generation and exits.
    - `/lyria/bpm` (int/float or "AUTO"): Sets BPM.
    - `/lyria/scale` (string or "AUTO"): Sets musical scale.
- Original audio output via PyAudio is maintained.
- I added `quickstarts/osc_test_client.py` for testing OSC functionality.
- I updated dependencies to include `python-osc`.

This modification allows for external control of the Lyria script, enabling integration with applications like TouchDesigner as outlined in the project plan.
Copy link

google-cla bot commented May 29, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:quickstarts Issues/PR referencing quickstarts folder labels May 29, 2025
@Giom-V Giom-V self-assigned this Jun 2, 2025
@Giom-V
Copy link
Collaborator

Giom-V commented Jun 2, 2025

Hello @didier-brown and thanks a lot for the submission.

While as an individual I greatly appreciate your submission since it opens a lot of home automation possibilities, as the cookbook gatekeeper I don't think we should update the code sample. The reason for that is because this code sample needs to be as simple as possible so that anybody can understand it and use it for their own use-cases, the same way you just did. Honestly, I already think I over-complexified it...

Maybe we should make it an example instead? What about we move that into a folder under examples/ along with a README that explains how it works?

@Giom-V Giom-V added status:awaiting response Awaiting a response from the author and removed status:awaiting review PR awaiting review from a maintainer labels Jun 2, 2025
Copy link

Marking this pull request as stale since it has been open for 14 days with no activity. This PR will be closed if no further activity occurs.

@github-actions github-actions bot added the status:stale Issue/PR is marked for closure due to inactivity label Jun 16, 2025
Copy link

This pull request was closed because it has been inactive for 27 days. Please open a new pull request if you need further assistance. Thanks!

@github-actions github-actions bot closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:quickstarts Issues/PR referencing quickstarts folder status:awaiting response Awaiting a response from the author status:stale Issue/PR is marked for closure due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants