This is an experiment with online audio samples.
We are using Datasette to visualize and explore the samples that come with the Sonic-Pi project.
Note:
If you don't want to mess with Sonic-Pi, you can skip steps 1 to 3 and just use the prebuilt sqlite database included in this repo.
Install Sonic-Pi on your System.
We are utilising a little Sonic-Pi Program (written in Ruby) to list all the samples and their properties and write them to a CSV file.
- start Sonic-Pi
- load
save-samples-csv.rb
- you may need to adjust the path of the output file in line 20
- run the script
- the output file should be saved to the current folder.
Make sure you have sqlite-utils installed, then:
sqlite-utils insert sonicpi.db samples samples.csv --csv --detect-types --pk sample
This experiments uses the following datasette plugins:
- datasette-darkmode (recommended)
to show the datasette in darkmode (including the sql editor) - datasette-audio-waveform
to show the audio files in a waveform audio player
Install them using datasette install
Since the waveform audio player currently preloads all samples on a page, we limit the number of requests via the settings.
Settings are configured in
settings.json
for Datasette 0.xdatasette.yaml
for Datasette 1.x
Important Settings are:
default_page_size: 10
max_returned_rows: 12
Run the start script in this directory
./start.sh