Skip to content

Allow loading samples via URL #3574

Description

@Asmatzaile

Now that Sonic Pi can play in the web (yay!🌟️) it would be super nice to be able to reference external URLs for loading custom samples. For instance, that would make any code with custom samples instantly shareable. Also, it would allow for custom samples in collaborative editing environments like Flok (although Sonic Pi is not integrated in Flok yet).

I imagine writing the following code:

sample "https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/sd/rytm-01-classic.wav"

and Sonic Pi downloading the sample and using it.

I also imagine that the url could point to a .json file specifying a list of audio file urls. That way, I wouldn't need to specify the samples one by one of a sample pack consisting of, say, 300 samples, and I could add more sounds to the pack without needing to change the Sonic Pi code.
What I imagine doing is for example

sample "https://example.com/sample-pack.json" rand_i(300)

Which would select one of the samples of my pack.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WebIssues related to the web port of Sonic Pi

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions