lpil / lpil/sonic-pi-tool

Thread name not displayed in logs

Open
#37 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
234
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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}
...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the sonic-pi-tool logs command and trace how log entries are formatted, comparing its output with the Sonic Pi output shown in the issue. Done means log entries generated by named threads include the thread name, while unnamed entries retain their existing format.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.