• Stars
    star
    200
  • Rank 188,468 (Top 4 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎻 Controlling Sonic Pi from the command line

Build Status

Sonic Pi Tool

sonic-pi-tool is a handy command line utility for playing with the Sonic Pi server. It can be used instead of the Sonic Pi GUI for all your music making needs :)

It's ideal for use with sonicpi.vim.

Installation

From source

If you have the Rust programming language installed sonic-pi-tool can be installed like so:

cargo install --git https://github.com/lpil/sonic-pi-tool/ --force

Note that while Rust needs to be installed to compile sonic-pi-tool, it is not needed to run it. You may uninstall Rust or copy the sonic-pi-tool binary from ~/.cargo/bin to another computer with the same processor architecture and operating system if you wish.

sonic-pi-tool may not build on older versions of Rust. Please see the CI configuration for which versions are explicitly supported.

Homebrew

Sonic Pi Tool can be installed like so using the Homebrew package manager for OSX:

$ brew tap Cj-bc/sonic-pi-tool
$ brew install sonic-pi-tool
# or
$ brew install Cj-bc/sonic-pi-tool/sonic-pi-tool --HEAD

Homebrew formula is here: Cj-bc/homebrew-sonic-pi-tool

Usage

check

sonic-pi-tool check
# => Sonic Pi server listening on port 4557

Used to check if the Sonic Pi server is running. If the server isn't running many of the tool's commands (such as eval) will not work.

This command returns a non-zero exit code if the server is not running.

eval

sonic-pi-tool eval "play :C4"
# *ding*

Take a string Sonic Pi code and send it to the Sonic Pi server to be played.

eval-file

sonic-pi-tool eval-file path/to/code.rb
# *music*

Read Sonic Pi code from a file and send it to the Sonic Pi server to be played.

eval-stdin

echo "play :C4" | sonic-pi-tool eval-stdin
# *ding*

Read Sonic Pi code from standard in and send it to the Sonic Pi server to be played.

stop

Stop all jobs running on the Sonic Pi server, stopping the music.

sonic-pi-tool stop
# *silence*

logs

Prints out log messages emitted by the Sonic Pi server.

This command won't succeed if the Sonic Pi GUI is running as it will be consuming the logs already.

sonic-pi-tool logs
#
# [Run 2, Time 32.7]
#  └ synth :beep, {note: 65.0, release: 0.1, amp: 0.9741}
#
# [Run 2, Time 32.8]
#  └ synth :beep, {note: 39.0, release: 0.1, amp: 0.9727}

start-server

Attempts start the Sonic Pi server, if the executable can be found.

Not supported on Windows.

sonic-pi-tool start-server
# Sonic Pi server booting...
# Using protocol: udp
# Detecting port numbers...
# ...

record

Record the audio output of a Sonic Pi session to a local file. Stop and save the recording when the Enter key is pressed.

sonic-pi-tool record /tmp/output.wav
# Recording started, saving to /tmp/output.wav.
# Press Enter to stop the recording...

Other tools

In addition to sonic-pi-tool this project contains sonic-pi-pipe and sonic-pi-logs. These two programs came first and are written in Go rather than Rust.

Everything they can do can be done with the newer sonic-pi-tool, and as a result they are no longer actively maintained. :)

Read more about these tools here.

MPL 2.0 Licence

More Repositories

1

mix-test.watch

🎠 Because TDD is awesome
Elixir
867
star
2

dogma

🔐 A code style linter for Elixir
Elixir
472
star
3

exfmt

🌸 An opinionated Elixir source code formatter
Elixir
439
star
4

thoas

A blazing fast JSON parser and generator in pure Erlang.
Erlang
130
star
5

rustexp

A Rust regular expression editor and tester that runs entirely within the browser!
Rust
109
star
6

elixre

🦑 An Elixir regular expression editor & tester, with Elm
Elm
101
star
7

icalendar

🗓️ A small library for reading and writing ICalendar files.
Elixir
94
star
8

yesql

An Elixir library for using SQL.
Elixir
76
star
9

purescript-aws-lambda-express

PureScript
22
star
10

wisp

Gleam
20
star
11

sqlight

💡 Use SQLite from Gleam!
Gleam
19
star
12

clint

🏚️ Nothing to see here.
Elixir
19
star
13

learning

Elixir
16
star
14

total

Basic exhaustiveness checking of unions in Elixir
Elixir
15
star
15

puter

Setting up a computer is annoying so let's automate it.
Ruby
14
star
16

soup

A simple interpreted language written in Elixir
Elixir
14
star
17

plug-redirect

A plug builder for redirecting requests.
Elixir
13
star
18

temporary-env

A tool for managing application environment state within tests.
Elixir
11
star
19

gleeunit

Gleam bindings for the Erlang EUnit test framework
Erlang
11
star
20

gleam-cloudflare-worker

JavaScript
10
star
21

nerf

Gleam bindings to gun, the Erlang HTTP/1.1, HTTP/2 and Websocket client
Gleam
9
star
22

generative-elm

Exploring Matt Pearson's "Generative Art" book, with Elm!
Elm
9
star
23

exercism

Because problems are fun.
Elixir
9
star
24

erlcaml

Erlang
8
star
25

gleam_sendgrid

A client for the SendGrid transactional email API
Gleam
8
star
26

tetromino

A little game of Tetris!
Rust
7
star
27

ecoji

Base64 is so 1999, isn't there something better?
Rust
6
star
28

linux-audio-interface-compatibility

6
star
29

elm-hearts

Inspired by the 1998 intro of the Powerpuff Girls <3
Elm
6
star
30

action

Gleam
5
star
31

lpil

Code monkey monorepo trinkets
Elixir
5
star
32

glance

Gleam
5
star
33

latex-templates

Because words are hard, and MS Word is terrible
TeX
4
star
34

elixir-aws-lambda

JavaScript
4
star
35

advent-of-code

Rust
4
star
36

dotfiles

Magic!
Shell
4
star
37

epgsql

Rust
4
star
38

htmb

Gleam
4
star
39

decksterity

A thingy for DJ me
Rust
4
star
40

gh-counts

How many Gleam projects are there?
Erlang
4
star
41

antigone

Argon2 password hashing for Gleam.
Gleam
4
star
42

cymbal

Build YAML in Gleam!
Gleam
4
star
43

purescript-format

Haskell
3
star
44

serverless-static-site

JavaScript
3
star
45

beam-lisp

Erlang
3
star
46

talk-slides

https://lpil.github.io/talk-slides/
HTML
3
star
47

osc

Because I want to learn about OSC and handling binaries in Elixir.
Elixir
3
star
48

stepper

A little JS step sequencer
JavaScript
3
star
49

formal

Gleam
3
star
50

justin

Gleam
3
star
51

exception

Gleam
2
star
52

llvm

Louis' Little Virtual Machine
Rust
2
star
53

phoenix-webpack-example

CSS
2
star
54

rust-stepper

Rust
2
star
55

kent-erlang-mooc

Erlang
2
star
56

kalimba-tabs

Elm
2
star
57

crisp

A Rusty Lisp
Rust
2
star
58

archive

Elixir
2
star
59

99-bottles-of-oop

Ruby
2
star
60

logging

Erlang
2
star
61

glue

🩹 Generate functions from your Gleam code!
Gleam
2
star
62

xcss-crystal

Abandoned, see the README
Crystal
2
star
63

zeptomail

A client for the Zeptomail transactional email API
Gleam
2
star
64

life

Conway's game of life in various languages.
Rust
2
star
65

palette

A useless library that does stuff the standard library does better.
Elixir
2
star
66

gleam-elixir-london-preview

Rust
1
star
67

waive-website

HTML
1
star
68

ka-li-da-scope

JavaScript
1
star
69

joy

Gleam
1
star
70

reddit-css

Stylesheets for various subreddits -
CSS
1
star
71

roman-numerals

Convert numbers to Roman numerals and back.
Elixir
1
star
72

gleam-test-ci-project

Erlang
1
star
73

nice-button

JavaScript
1
star
74

i3-conf

My 'puter. Tiling is fun.
Perl
1
star
75

lans-syn

Because the ANS synth is cool.
Clojure
1
star
76

natter

Elixir
1
star
77

photobank

An app for sharing photos!
Elixir
1
star
78

pushover-error-logger

An Erlang/OTP logger handler that sends error logs to Pushover
Erlang
1
star
79

elm-against-humanity

https://lpil.uk/elm-against-humanity
Elm
1
star
80

a-blog

CSS
1
star
81

learn-you-some-elixir

CSS
1
star
82

find_my_primes

Elixir
1
star
83

jot

Gleam
1
star
84

access

Clojure
1
star
85

openbox-conf

My openbox desktop config
Shell
1
star
86

my-first-code

HTML
1
star
87

purescript-datastore

PureScript
1
star
88

elixir-jot

Slightly more fun than HTML
Elixir
1
star
89

beecrypt

🐝 Buzzing Gleam bindings to the Erlang bcrypt hashing library
Gleam
1
star
90

vim2hs-flexible

Vim Script
1
star
91

prismic_ecto

An Ecto adapter for the Prismic.io CMS
Elixir
1
star
92

ex-unit-pride

Run your tests with pride.
Elixir
1
star
93

javascript-dom-parser

Gleam
1
star
94

spinner

Gleam
1
star
95

cheep

Because graphical programming is no fun.
Ruby
1
star
96

envoy

📂 A zero dependency cross platform Gleam package for reading environment variables
Gleam
1
star
97

cgi

Gleam
1
star
98

youid

Gleam
1
star