Sonic-pi scripting #2676
Replies: 3 comments 6 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.
-
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