Coder Social home page Coder Social logo

Comments (4)

daveyarwood avatar daveyarwood commented on June 9, 2024

Hi, thanks for the issue!

Player logs are written into files in a directory whose location varies depending on your OS. To see the location, run alda-player info.

Another thing you can do is run a player process in the foreground like this:

alda-player -v run

-v is for verbose mode. There is also a very verbose mode, -vv.

You can also include -p 12345 to run the player process on a specific port. (By default, a random open port is used.)

When running a player process in the foreground like this, the logs are printed to stdout.

The other piece of the puzzle is to ensure that that player is used, so that you can test what you wanted to test. There are two ways you can do this: one is to specify the port that you started the player on (if you didn't specify a port, you can see what port is used in the player logs):

alda play -p 12345 -c "piano: c8 d e f g a"

The other way is to look at the player logs and note the three-letter ID at the beginning of each line. This is an automatically generated player ID that you can specify instead of the port:

alda play -p xxx -c "piano: c8 d e f g a"

Either way, note that the player process will automatically shut down at the end of the first "play" command it receives. This is by design, to help ensure that fresh players are used and stale players aren't left running forever. The player process will also shut itself down after a period of inactivity, for the same reason.

Does that help?

from alda.

daveyarwood avatar daveyarwood commented on June 9, 2024

I'd like to be able to include debug messages in my scores; just echoing the notes that are being played (in text form) would be start.

An old idea that I had, possibly related: #430

from alda.

holtzermann17 avatar holtzermann17 commented on June 9, 2024

Hi, thanks; for example, I can see the output from the existing log.trace { "${address} ${args}" } on line 223 of Parser.tk this way.

Potentially clarifying my initial question: I had been wondering about how to get player messages to appear alongside interactions on a REPL. Indeed, #430 would be an example feature of broader debugging suite, maybe adjusting the syntax there to (debug 'offset) and also accommodating (debug "message"). These could print out on the REPL rather than in the log we were talking about here.

from alda.

daveyarwood avatar daveyarwood commented on June 9, 2024

That's an interesting idea! I think it could be implemented in a way that would also allow us to do things like what @UlyssesZh was talking about in #451, where you could write an editor plugin that moves your cursor to the note in the score that was just played.

The thing that makes this challenging right now is that all of the communication is unidirectional from the client to the player. Aside from tailing logs, we don't have any way of receiving updates from player processes in real time. But we could add a separate stream of updates coming from the player, and build tooling to do all kinds of interesting things with that data, including debugging.

Because latency is important, and we're already using OSC for the client -> player communication, I think it would make sense for the player to broadcast OSC messages for this.

Hopefully there is some way to do this without a lot of performance overhead that would affect playback 🤔 I don't know off-hand that perf would be a problem, but it's something we should watch out for when implementing this.

from alda.

Related Issues (20)

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.