Hi @Gydhia, welcome!
“link both” could probably mean several things, but I’ll assume you mean having Sonic Pi play sounds in response to game events. A couple possibilities:
- A Python interface for Sonic Pi I have not used this and cannot vouch for the quality. You might be able to port your to Python code using this and have it all run from your game
- OSC / MIDI communication - You can have your Python program send messages to Sonic Pi via one of the communication protocols. I’d choose OSC because it is more general purpose. Then you could send OSC messages from your game, receive them in Sonic Pi, and map them to audio actions like starting a loop, playing a melody / sample, etc.
Personally, I’d probably avoid the Python interface even though I’m a longtime professional Python coder. You might run into weird bugs or edge case issues and spend all your time fighting those. But if you try it and it works I’d be glad to hear about your experience! Using OSC, you should be able to get up and running with only a few lines of code on each side.