can I see debug messages while the player is running? #477
Replies: 4 comments
-
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 Another thing you can do is run a player process in the foreground like this:
You can also include 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):
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:
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? |
Beta Was this translation helpful? Give feedback.
-
An old idea that I had, possibly related: #430 |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks; for example, I can see the output from the existing 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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
🔧 Feature request 🔧
Description
E.g., on line 375 of
Parser.kt
it occurred to me that I could add this:However, I'm not sure where these logs can be viewed. In short, I can run a client, server, and player all separately — but how can I control which player the server connects to?
Examples
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.
Motivation
This would be directly useful, but also potentially interesting as the start of a way to send signals to downstream programs!
Alternatives
Not sure.
Beta Was this translation helpful? Give feedback.
All reactions