Sonic-pi scripting #2676
Replies: 4 comments 10 replies
-
I find https://github.com/Widdershin/sonic-pi-cli useful for sending command line stuff to a running sonic-pi. |
Beta Was this translation helpful? Give feedback.
-
I was thinking about something like this myself. I am just spit balling here, but it would be great to add a some psuedo code song testSong:
play:
# the 'play' function contains the calls to; beat, chorus, method, versus functions, in the order they should be executed
# functions that should continue running until told to stop should be called in a similar way to 'live-loop'
live-loop:
self.beat
end
self.first_verse
self.chorus
self.second_verse
self.chorus
self.third_verse
self.bridge
self.chorus
beat:
#<insert-beat-code-here>
chorus:
#<insert-chorus-code-here>
bridge:
#<insert-bridge-code-here>
first_verse:
#<insert-first-verse-code-here>
second_verse:
#<insert-second-verse-code-here>
third_verse:
#<insert-third-verse-code-here> The advantages to this, is someone can upload their code to a git repo, people can fork it and use it as the basis for their music, or could create a PR with modifications that might improve the song. It allows collaboration. Just my 2c
|
Beta Was this translation helpful? Give feedback.
-
For this to work nicely, you'd either need to have Sonic Pi running in the background or have started a background daemon process running all the Sonic Pi processes. Otherwise, you'd have to boot all these processes (taking a good few seconds) before the script could be executed. Some sort of official CLI could still be on the cards for the future, but I'm still pretty unclear what the precise usecases are. |
Beta Was this translation helpful? Give feedback.
-
Hi SteveI haven’t got this set up in a public repository at present but if you want to send me details I’ll see what I can do. Unfortunately I am preparing to downsize and move house at the end of August spending all my time preparing for this , then I have some hospital treatment to look forward to after that so have very little free time at present. Sent from my iPhoneOn 28 Jul 2024, at 19:52, Steve ***@***.***> wrote:
I wrote an update which you can install using gem install sonic-pi-cli4 Works the same as sonic-pi-cli but uses sonic_pi4 to invoke it rather than sonic_pi. it seemed complex to include it on the original so I made it separate. Usual caveat. Uses unofficial access to log files which are not guaranteed to remain in the same format. Works with all versions from 4.0 onwards so far. NB on RPi need sudo to install the gem
Are you accepting PRs for this somewhere? I've found a bug where subsequent launches of the daemon break your logic.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I havent gotten sonic-pi to compile from source yet so perhaps this is mute, but I would like to send command line arguments to sonic-pi for execution. something to the format $sonic-pi --run sample ebit_bass, "120","Cm",1, lpf: 100,amp: 5
live coding is great, but Im not sure how to implement sonic-pi in a scripting format, which is what I would be interested to do.
Beta Was this translation helpful? Give feedback.
All reactions