Code Monkey home page Code Monkey logo

sonic-pi-tool's Introduction

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

sonic-pi-tool's People

Contributors

alejandrosame avatar benjmin-r avatar cj-bc avatar dependabot[bot] avatar jeckersb avatar jtpio avatar lpil avatar magicmonty avatar martindelille avatar mlupo avatar mttpgn avatar obojdi avatar thetechrobo avatar yaychris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonic-pi-tool's Issues

Compatibility with sonicpi.vim still present?

Hello!

The front page still states that sonic-pi-tool is compatible with sonicpi.vim. Unfortunately, I haven't been able to make this work, I believe because of the change from the simpler syntax of sonic-pi-pipe to now include eval for submitting code to the Sonic Pi server.

Am I missing how to make these two tools work together? In my .vimrc I have

    let g:sonicpi_command="sonic-pi-tool"

so it should be attempting to send commands to the right place.

Thanks!

Compile under Windows 10 failing

Hello,

i'm trying to compile the project on Windows but it fails. My Rust knowledge is zero so i hard can make any sense of it, except it's a Unix-Windows problem (maybe):

image

Running on latest Windows 10 x64 2004
Rust 1.145.2
Rustup 1.22.1

  • Christoph

start-server command improvements

Looking at the current implementation, it looks like the start-server command is assuming Mac OS as the host system (https://github.com/lpil/sonic-pi-tool/blob/master/src/lib.rs#L95).

Instead of having a single choice, could there be a list of different paths?
For example, I usually start the Sonic Pi server directly from the root of the git repository, by running ./app/server/bin/sonic-pi-server.rb.

By having a list of paths, the start-server command would loop through:

[
    "/Applications/Sonic Pi.app/server/bin/sonic-pi-server.rb",
    "./app/server/bin/sonic-pi-server.rb"
]

and if it finds an existing file, executes it.

Ruby error on start-server

When I run start-server on OSX (Mojave I0.14.5) receive this error uninitialized constant FFI::Platform::CPU (NameError)

Anyone seen this before?

Build failure MacOS Monterey 12.4

Hi,

The build fails on my OS. Cargo 1.56.0, rustc 1.56.1. Here are some logs:

error[E0282]: type annotations needed
   --> src/lib.rs:111:13
    |
111 |             execv(cmd, &[]).unwrap_or_else(|_| panic!("Unable to start {}", *p))
    |             ^^^^^ cannot infer type for type parameter `S` declared on the function `execv`

For more information about this error, try `rustc --explain E0282`.
error: could not compile `sonic-pi-tool` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#48265a12)`, intermediate artifacts can be found at `/var/folders/zq/nwpwzg_s2rq87xq7zggqfvhw0000gn/T/cargo-installtpNTv9`

Caused by:
  build failed

I don't really know what can be the cause of it. I think that my rustc and cargo version are pretty standard and I very rarely use these tools.

I couldn't find the Sonic Pi server executable :(

hello,
sonic-pi-tool start-server
gives me an error :
I couldn't find the Sonic Pi server executable :(

sonic-pi 3.2.2 App is in Applications folder.
I am on mac os 10.14.4

what can I do ?

thanks

Thread name not displayed in logs

Given the following code from the tutorial, the thread name should be displayed in the logs:

in_thread(name: :bass) do
  loop do
    use_synth :prophet
    play chord(:e2, :m7).choose, release: 0.6
    sleep 0.5
  end
end

in_thread(name: :drums) do
  loop do
    sample :elec_snare
    sleep 1
  end
endCopy

Unfortunately I cannot see it:

$ sonic-pi-tool logs
[Run 1, Time 19.5]
 โ”” synth :prophet, {note: 50.0, release: 0.6}

[Run 1, Time 20.0]
 โ”” sample "/Applications/Sonic Pi.app/Contents/Resources/etc/samples",
           "elec_snare.flac"

[Run 1, Time 20.0]
 โ”” synth :prophet, {note: 43.0, release: 0.6}

[Run 1, Time 20.5]
 โ”” synth :prophet, {note: 50.0, release: 0.6}
...

If I run the same code in Sonic Pi, the thread name is well displayed:

=> Starting run 0

=> Loaded sample "/Applications/Sonic Pi.app/Contents/Resources/etc/samples/elec_snare.flac"

{run: 0, time: 0.0}
 โ””โ”€ sample "/Applications/Sonic Pi.app/Contents/Resources/etc/samples",
             "elec_snare.flac"
 
{run: 0, time: 0.0, thread: :bass}
 โ””โ”€ synth :prophet, {note: 50.0, release: 0.6}
 
{run: 0, time: 0.5, thread: :bass}
 โ””โ”€ synth :prophet, {note: 40.0, release: 0.6}
 
{run: 0, time: 1.0, thread: :bass}
 โ””โ”€ synth :prophet, {note: 47.0, release: 0.6}
...

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value

Got this error when showing the logs via sonic-pi-tool logs:

[Run 7, Time 497.6501]
  โ”œ cue :drum
  โ”” sync :lead
 
 => Starting run 35
  
  => Thread :live_loop_drum exists: skipping creation
  
  => Thread :live_loop_lead exists: skipping creation
  
  => Thread :live_loop_bass exists: skipping creation
  
 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value
 : ReadError(Error { repr: Custom(Custom { kind: UnexpectedEof, error:
 StringError("failed to fill whole buffer") }) })', src/libcore/result.
 rs:868
 note: Run with `RUST_BACKTRACE=1` for a backtrace.

Just leaving it here for now, but I can try to get more details later if needed (a backtrace for example).

--save flag for exec-stdin and exec-file that record code and timestamp.

Proposal

Given a live coding performance where the user is using echo $CODE | sonic-pi-tool eval-stdin --save some/dir

at the end of the performance the given directory would contain one file for each time code was evaled, with timestamps, so the performance can be replayed.

some/dir
โ”œโ”€โ”€ sonic-pi-code-20170101170456.rb
โ”œโ”€โ”€ sonic-pi-code-20170101170503.rb
โ””โ”€โ”€ ... etc ...

This could then be used with a replay command to be implemented later.

Discussion

  • Is --save a good name?
  • Is the code in a file and timestamp in the filename enough info? Or should we save a JSON blob so that more data can be stored?

Errors on starting server, but the server still works

โฏ sonic-pi-tool start-server                                                                                              
/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/vendor/ffi-1.11.3/lib/ffi/platform.rb:61: warning: already initialized constant FFI::Platform::CPU
Sonic Pi server booting...
This is version 3.2.0 running on Ruby 2.6.4.
The time is 2020-08-10 19:31:12 +0430
Using primary protocol: udp
Detecting port numbers...
Listen port: 4557
  - OK
Scsynth port: 4556
  - OK
Scsynth send port: 4556
  - OK
OSC cues port: 4560
  - OK
Erlang port: 4561
  - OK
OSC MIDI out port: 4563
  - OK
OSC MIDI in port: 4564
  - OK
Websocket port: 4562
  - OK
Opening UDP Server to listen to GUI on port: 4557
Starting Server Runtime
Booting server...


Booting Sonic Pi
----------------

Boot - Booting on OS X
Boot - Checkout audio rates on OSX:
Boot - Unable to detect audio rates. Disabling input
Boot - Booting with no audio inputs
Boot - Starting the SuperCollider server...
Boot - /Applications/Sonic Pi.app/Contents/Resources/app/server/native/scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 0 -o 16 -U /Applications/Sonic Pi.app/Contents/Resources/app/server/native/supercollider/plugins/ -b 4096 -B 127.0.0.1
Ignoring charlock_holmes-0.7.7 because its extensions are not built. Try: gem pristine charlock_holmes --version 0.7.7
Ignoring escape_utils-1.2.1 because its extensions are not built. Try: gem pristine escape_utils --version 1.2.1
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring github-linguist-7.9.0 because its extensions are not built. Try: gem pristine github-linguist --version 7.9.0
Ignoring nokogiri-1.10.4 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.4
Ignoring rugged-1.0.1 because its extensions are not built. Try: gem pristine rugged --version 1.0.1
Started [23800] [-] /Applications/Sonic Pi.app/Contents/Resources/app/server/native/scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 0 -o 16 -U /Applications/Sonic Pi.app/Contents/Resources/app/server/native/supercollider/plugins/ -b 4096 -B 127.0.0.1 [-] /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T/sonic-pi-pids/23800
Boot - SuperCollider booted successfully.
Boot - Connecting to the SuperCollider server...
Boot - Sending /status to server: 127.0.0.1:4556
Boot - Receiving ack from scsynth
Boot - Server connection established
Studio - Initialised SuperCollider Audio Server v3.11.0
Studio - Resetting server
Studio - Studio - clearing scsynth
Studio - Studio - allocating audio bus
Studio - Studio - Create Base Synth Groups
Studio - Starting mixer
Studio - Starting scope
exec "/Applications/Sonic Pi.app/Contents/Resources/app/server/native/ruby/bin/ruby" "/Applications/Sonic Pi.app/Contents/Resources/app/server/native/erlang/erl" -noshell -pz "/Applications/Sonic Pi.app/Contents/Resources/app/server/erlang" -s pi_server start 4561 4560 4557
Ignoring charlock_holmes-0.7.7 because its extensions are not built. Try: gem pristine charlock_holmes --version 0.7.7
Ignoring escape_utils-1.2.1 because its extensions are not built. Try: gem pristine escape_utils --version 1.2.1
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring github-linguist-7.9.0 because its extensions are not built. Try: gem pristine github-linguist --version 7.9.0
Ignoring nokogiri-1.10.4 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.4
Ignoring rugged-1.0.1 because its extensions are not built. Try: gem pristine rugged --version 1.0.1
Started [23805] [-] /Applications/Sonic Pi.app/Contents/Resources/app/server/native/erlang/dist/bin/beam.smp -- -root /Applications/Sonic Pi.app/Contents/Resources/app/server/native/erlang/dist -progname erl -- -home /Users/evar -- -noshell -pz /Applications/Sonic Pi.app/Contents/Resources/app/server/erlang -s pi_server start 4561 4560 4557 -- [-] /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T/sonic-pi-pids/23805
Studio - Spawning o2m with:
    exec '/Applications/Sonic Pi.app/Contents/Resources/app/server/native/osmid/o2m' -L -b -i 4563 -O 4564 -m 6
Ignoring charlock_holmes-0.7.7 because its extensions are not built. Try: gem pristine charlock_holmes --version 0.7.7
Ignoring escape_utils-1.2.1 because its extensions are not built. Try: gem pristine escape_utils --version 1.2.1
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring github-linguist-7.9.0 because its extensions are not built. Try: gem pristine github-linguist --version 7.9.0
Ignoring nokogiri-1.10.4 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.4
Ignoring rugged-1.0.1 because its extensions are not built. Try: gem pristine rugged --version 1.0.1
Started [23808] [-] /Applications/Sonic Pi.app/Contents/Resources/app/server/native/osmid/o2m -L -b -i 4563 -O 4564 -m 6 [-] /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T/sonic-pi-pids/23808
Studio - Spawning m2o with:
    exec '/Applications/Sonic Pi.app/Contents/Resources/app/server/native/osmid/m2o' -t /midi:\$n:\$i:\$c/\$m -b -o 4564 -m 6 'Sonic Pi'
Ignoring charlock_holmes-0.7.7 because its extensions are not built. Try: gem pristine charlock_holmes --version 0.7.7
Ignoring escape_utils-1.2.1 because its extensions are not built. Try: gem pristine escape_utils --version 1.2.1
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring github-linguist-7.9.0 because its extensions are not built. Try: gem pristine github-linguist --version 7.9.0
Ignoring nokogiri-1.10.4 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.4
Ignoring rugged-1.0.1 because its extensions are not built. Try: gem pristine rugged --version 1.0.1
Started [23810] [-] /Applications/Sonic Pi.app/Contents/Resources/app/server/native/osmid/m2o -t /midi:$n:$i:$c/$m -b -o 4564 -m 6 Sonic Pi [-] /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T/sonic-pi-pids/23810
Studio - Initialised MIDI subsystems
This is Sonic Pi v3.2.2 running on osx with ruby api 2.6.0.
Sonic Pi Server successfully booted.
Exception!
Connection refused - send(2)
["/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/bin/sonic-pi-server.rb:621:in `block in <main>'"]
Exception!
Connection refused - send(2)
["/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/bin/sonic-pi-server.rb:621:in `block in <main>'"]
Exception!
Connection refused - send(2)
["/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/bin/sonic-pi-server.rb:621:in `block in <main>'"]
Exception!
Connection refused - send(2)
["/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/bin/sonic-pi-server.rb:621:in `block in <main>'"]

The server still works for a simple command like sonic-pi-tool eval 'play 60'. Should I just ignore these errors?

Cannot compile due to outdated dependecy

Hello!

I just tried to install by compiling directly with cargo and got the following error message:

$ cargo install --git https://github.com/lpil/sonic-pi-tool/ --force
    Updating git repository `https://github.com/lpil/sonic-pi-tool/`
  Installing sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#1f94c5e0)
    Updating crates.io index
error: failed to compile `sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#1f94c5e0)`, intermediate artifacts can be found at `/tmp/cargo-installjhtGcs`

Caused by:
  failed to select a version for the requirement `clap = "~2.20"`
  candidate versions found which didn't match: 2.33.3, 2.33.2, 2.33.1, ...
  location searched: crates.io index
  required by package `sonic-pi-tool v0.1.0 (/home/alejandro/.cargo/git/checkouts/sonic-pi-tool-647a8cc43a045f33/1f94c5e)`

Homebrew formula

Hello, First of all, Thanks to make this repo! I'm really excited to play Sonic Pi from CLI ;)

I open this issue to inform my (personal) Homebrew formula repository for this repo.
You can use it as:

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

Here's the repository for it: https://github.com/Cj-bc/homebrew-sonic-pi-tool
Thanks.

Look for Sonic Pi server in ~/Applications

I have Sonic Pi installed in ~/Applications, a standard place to install applications on macOS. sonic-pi-tool doesn't look there, so I'm not able to use sonic-pi-tool start-server.

This function would be updated to implement this request, using std::env::home_dir().

I attempted to do so, but was unable to make it work because I don't know Rust well enough to appease the sorrow checker.

Use Ruby included with Sonic Pi for start-server

Sonic Pi's server/bin/sonic-pi-server.rb has a shebang line for #!/usr/bin/env ruby. When running sonic-pi-tool start-server from the command line, it uses whatever ruby it finds in your PATH. If it's not 2.3 (the version bundled with Sonic Pi), it fails:

$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

$ sonic-pi-tool start-server
/Users/chris/Applications/Sonic Pi.app/app/server/vendor/fast_osc-0.0.11/lib/fast_osc.rb:22:in `require_relative': cannot load such file -- /Users/chris/Applications/Sonic Pi.app/app/server/rb-native/osx/2.4.0/fast_osc (LoadError)
        from /Users/chris/Applications/Sonic Pi.app/app/server/vendor/fast_osc-0.0.11/lib/fast_osc.rb:22:in `rescue in <top (required)>'
[omitted]

It's looking for files in Sonic Pi.app/app/server/rb-native/osx/2.4.0 instead of Sonic Pi.app/app/server/rb-native/osx/2.3.0.

It would be super cool if the start-server command, after determining the correct path to the Sonic Pi installation, started the server using the Ruby included in the package (Sonic Pi.app/app/server/native/osx/ruby/bin).

Again, as mentioned in #17, I'd gladly implement this but I don't have the Rust knowledge to make it happen :(

Installation issue: could not find `https://github.com/lpil/sonic-pi-tool`

I get this when trying to install:

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

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: could not find `https://github.com/lpil/sonic-pi-tool` in `registry https://github.com/rust-lang/crates.io-index`

Tested on Arch Linux:

cargo --version
cargo 0.15.0-dev (298a0127 2016-12-20)

start-server command

Proposal

sonic-pi-tool start-server finds the script to start the Sonic Pi audio server and runs it.

error: this needs a `'static` lifetime or the `static_in_const` feature, see #35897

Hi,

Got this error on Raspberry Pi 3 / Raspbian Stretch after running :
sudo cargo install --git https://github.com/lpil/sonic-pi-tool/ --force --verbose

 Running `rustc /root/.cargo/git/checkouts/sonic-pi-tool-647a8cc43a045f33/e0461a474e468c954d61c9d261dd1ff2dbd840b5/src/lib.rs --crate-name lib --crate-type lib -C opt-level=3 -C metadata=da26fcb8219d1c89 -C extra-filename=-da26fcb8219d1c89 --out-dir /tmp/cargo-install.OOLPErj1BELF/release/deps --emit=dep-info,link -L dependency=/tmp/cargo-install.OOLPErj1BELF/release/deps --extern ansi_term=/tmp/cargo-install.OOLPErj1BELF/release/deps/libansi_term-b026d5281af837e6.rlib --extern nix=/tmp/cargo-install.OOLPErj1BELF/release/deps/libnix-23d5811ff288eae2.rlib --extern rosc=/tmp/cargo-install.OOLPErj1BELF/release/deps/librosc-ae2e7f681f8b7a98.rlib --extern clap=/tmp/cargo-install.OOLPErj1BELF/release/deps/libclap-10e0c1958631b63e.rlib`

error: this needs a 'static lifetime or the static_in_const feature, see #35897
--> /root/.cargo/git/checkouts/sonic-pi-tool-647a8cc43a045f33/e0461a474e468c954d61c9d261dd1ff2dbd840b5/src/lib.rs:62:24
|
62 | const ADDR_IN_USE_MSG: &str =
| ^^^^

error: aborting due to previous error

error: failed to compile sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#e0461a47), intermediate artifacts can be found at /tmp/cargo-install.OOLPErj1BELF

Caused by:
Could not compile sonic-pi-tool.

Caused by:
process didn't exit successfully: rustc /root/.cargo/git/checkouts/sonic-pi-tool-647a8cc43a045f33/e0461a474e468c954d61c9d261dd1ff2dbd840b5/src/lib.rs --crate-name lib --crate-type lib -C opt-level=3 -C metadata=da26fcb8219d1c89 -C extra-filename=-da26fcb8219d1c89 --out-dir /tmp/cargo-install.OOLPErj1BELF/release/deps --emit=dep-info,link -L dependency=/tmp/cargo-install.OOLPErj1BELF/release/deps --extern ansi_term=/tmp/cargo-install.OOLPErj1BELF/release/deps/libansi_term-b026d5281af837e6.rlib --extern nix=/tmp/cargo-install.OOLPErj1BELF/release/deps/libnix-23d5811ff288eae2.rlib --extern rosc=/tmp/cargo-install.OOLPErj1BELF/release/deps/librosc-ae2e7f681f8b7a98.rlib --extern clap=/tmp/cargo-install.OOLPErj1BELF/release/deps/libclap-10e0c1958631b63e.rlib (exit code: 101)

OSC not working

Hi,

Sonic Pi version 3.3.1

The simple OSC receiver code that works flawlessly in the Sonic Pi GUI does not work while using the tool:

live_loop :receive_sequence do
  use_real_time
  seq = sync "/osc*/gen/sequence"
  s = sync "/osc*/gen/steps"
  set :sequence, seq.zip(s)
end

The port used by the client for sending messages is 4560 and as per the startup logs, the same port is used by the cli tool:

OSC cues port: 4560
  - OK

If I understood correctly, then this issue is common as per:
https://in-thread.sonic-pi.net/t/sonic-pi-headless-doesnt-receive-osc-cues/2171
emlyn/sonic-pi-tool#19

Is there a current workaround for this? Since the issues above are related to older SP versions.

Run and record a Sonic Pi file

Feature request: run and record a Sonic Pi file.

For example, running:

sonic-pi-tool record-file path/to/music.rb path/to/music.wav path/to/logs.txt

would create two files once there is nothing else to be played:

  • path/to/music.wav: the audio recorded during the evaluation of the code
  • path/to/logs.txt: corresponding logs

It would be useful in order to create tracks and automatically export them. Of course, this would not work if there is a live_loop in the code.

Sonic Pi exposes the routes /start-recording, /stop-recording and /save-recording to it should be feasible :)

installation by cargo does not work: error: could not compile `clap`.

Hi!
This is what I tried:
$ cargo install --git https://github.com/lpil/sonic-pi-tool/ --force Updating git repository https://github.com/lpil/sonic-pi-tool/`
Installing sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#3f1b64e9)
Updating crates.io index
Compiling libc v0.2.118
Compiling semver v0.1.20
Compiling unicode-width v0.1.9
Compiling byteorder v1.4.3
Compiling bitflags v0.4.0
Compiling ansi_term v0.11.0
Compiling vec_map v0.8.2
Compiling strsim v0.8.0
Compiling cfg-if v0.1.10
Compiling void v1.0.2
Compiling bitflags v1.3.2
Compiling ansi_term v0.9.0
Compiling textwrap v0.11.0
Compiling rustc_version v0.1.7
Compiling rosc v0.1.6
Compiling nix v0.7.0
Compiling atty v0.2.14
Compiling dirs v1.0.5
Compiling clap v2.33.4
error[E0658]: if is not allowed in a const fn
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.4/src/app/settings.rs:7:1
|
7 | / bitflags! {
8 | | struct Flags: u64 {
9 | | const SC_NEGATE_REQS = 1;
10 | | const SC_REQUIRED = 1 << 1;
... |
51 | | }
52 | | }
| |_^
|
= note: for more information, see rust-lang/rust#49146
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0658]: if is not allowed in a const fn
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.4/src/args/settings.rs:6:1
|
6 | / bitflags! {
7 | | struct Flags: u32 {
8 | | const REQUIRED = 1;
9 | | const MULTIPLE = 1 << 1;
... |
28 | | }
29 | | }
| |_^
|
= note: for more information, see rust-lang/rust#49146
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try rustc --explain E0658.
error: could not compile clap.
warning: build failed, waiting for other jobs to finish...
error: failed to compile sonic-pi-tool v0.1.0 (https://github.com/lpil/sonic-pi-tool/#3f1b64e9), intermediate artifacts can be found at /tmp/cargo-installJEGF1N

Caused by:
build failed
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.