alda-lang / alda

A music programming language for musicians. :notes:
https://alda.io
Eclipse Public License 2.0
5.59k stars 286 forks source link

Can't play alda file in window #399

Closed 715yeung closed 2 years ago

715yeung commented 2 years ago

🐞 Bug report 🐞

Description

I tried to play alda file at window system , and that's not work ,even i use the file from the example

alda play -c "..." is work , can play some suff alda repl is work too and i use the jdk from eclipse foundation version are 16.0.2.7

PS C:\Users\...> alda play --file bach_cello_suite_no_1.alda
bach_cello_suite_no_1.alda:1:1 Unexpected '' at the top level

Steps to Reproduce

1. 2. 3. 4.

Expected Behavior

Actual Behavior

Environment

Operating system and version:

Alda version:

$ alda version
alda 2.0.5
$ alda-player info
alda-player 2.0.5
log path: C:\Users\..

Health check:

$ alda doctor
[32mOK  Parse source code
OK  Generate score model
OK  Ensure that there are no stale player processes
OK  Find an open port
OK  Send and receive OSC messages
OK  Locate alda-player executable on PATH
OK  Check alda-player version
OK  Spawn a player process
OK  Ping player process
OK  Play score
OK  Export score as MIDI
OK  Locate player logs
OK  Player logs show the ping was received
OK  Shut down player process
OK  Spawn a player on an unknown port
OK  Discover the player
OK  Ping the player
OK  Shut the player down
OK  Start a REPL server
nREPL server started on port 49661 on host localhost - nrepl://localhost:49661
OK  Find the REPL server
OK  Interact with the REPL server
OK  Shut down the REPL server

Logs:

daveyarwood commented 2 years ago

Hi @715yeung , thanks for reporting this!

I think the immediate problem is that this error message isn't very good:

Unexpected '' at the top level

There appears to be some kind of unexpected character at the beginning of the file you're attempting to play, however, the error message doesn't really say what character it is. I think it's some kind of character that doesn't have a visual representation.

I would have guessed that it's a control character of some kind, but we do check for control characters and print the code point, and that's not what's happening here. So, it must be some other kind of unexpected character. Maybe a Unicode character of some kind?

If you could attach the file you're trying to play to this issue, that would be helpful to me in debugging this issue.

715yeung commented 2 years ago

Hi @daveyarwood Thanks for your advice, I follow your suggestion and use the notepad++ change the encoding from uft-8 BOM to uft-8 , then its work so i thought it should be the encoding problem Thanks very much for your help and hope the result can help