Commit Graph

39 Commits

Author SHA1 Message Date
Dave Yarwood
840cf554eb Bugfix: don't attempt to write file if the directory doesn't exist yet 2021-08-01 17:21:07 -04:00
Dave Yarwood
e67adb84c9 Alda REPL servers write state files 2021-08-01 17:05:46 -04:00
Dave Yarwood
ecb5aae370 Hack to work around aurora not supporting NO_COLOR 2021-06-28 11:04:48 -04:00
Dave Yarwood
6b77a5affc Add -m, --message flag to alda repl to enable sending arbitrary messages to the server 2021-05-15 16:02:59 -04:00
Dave Yarwood
57bff9f0fb Extract a function that returns errors in server response; print to stderr 2021-05-15 16:01:52 -04:00
Dave Yarwood
4741999712 Add an option to disable automatic printing of errors in server responses 2021-05-15 16:00:44 -04:00
Dave Yarwood
06db5c2693 Revert "Expose public client.EvalAndPlay function"
This reverts commit ff5eeea646.
2021-05-15 09:49:56 -04:00
Dave Yarwood
ff5eeea646 Expose public client.EvalAndPlay function 2021-05-15 09:20:04 -04:00
Dave Yarwood
49a275e2fb Better user-facing error message when the REPL client fails to connect 2021-05-15 09:19:09 -04:00
Dave Yarwood
8af12432dd Automatically print errors in REPL server responses 2021-05-15 00:38:33 -04:00
Dave Yarwood
a991a27e82 Write .alda-nrepl-port file instead of .nrepl-port file
So as not to conflict with a Clojure nREPL server that might be running in the
same directory, e.g. when using alda-clj.
2021-05-14 23:31:23 -04:00
Dave Yarwood
d772f64c30 handle errors from os.MkdirAll 2021-01-30 20:59:44 -05:00
Dave Yarwood
316695d3b2 print "Starting player processes..." in local REPL session when there are no player processes available yet 2021-01-19 22:04:18 -05:00
Dave Yarwood
5c03af50fb keep line lengths <= 80 characters 2021-01-19 21:00:48 -05:00
Dave Yarwood
11eccc4563 include tempo messages in the output MIDI sequence
Related necessary REPL changes:

* In normal REPL usage, suppress tempo messages because they complicate things
  and we don't need them.

* When exporting a score via the REPL, we reload the score into a fresh player
  process first, then we _do_ include the tempo messages because we need the
  exported MIDI to contain tempo messages.
2020-10-13 08:38:14 -04:00
Dave Yarwood
ca107e5584 implement REPL :save command 2020-09-17 21:23:16 -04:00
Dave Yarwood
d45e487c02 implement REPL :quit command 2020-09-17 21:10:24 -04:00
Dave Yarwood
ad659577b9 implement REPL :instruments command 2020-09-17 21:00:59 -04:00
Dave Yarwood
b890750d24 rm TODO item 2020-09-16 22:01:07 -04:00
Dave Yarwood
3407fe460c implement REPL :export command 2020-09-16 22:00:53 -04:00
Dave Yarwood
3adcaff033 fix a bug related to evalAndPlay after loading a score 2020-09-16 20:51:34 -04:00
Dave Yarwood
236d46c4aa implement REPL :score command 2020-09-12 08:05:57 -04:00
Dave Yarwood
48f08c094a fix: add missing import 2020-09-07 16:49:45 -04:00
Dave Yarwood
ace30d1eb2 bugfix: don't add extraneous newlines to the input 2020-09-07 16:44:20 -04:00
Dave Yarwood
1ffe512701 implement REPL :new command 2020-08-26 20:43:38 -04:00
Dave Yarwood
837f3574c4 implement REPL :load command 2020-08-22 20:47:05 -04:00
Dave Yarwood
b1e1360729 implement :version REPL command; include both client and server versions in the initial information that is printed when you run alda repl 2020-08-21 21:35:39 -04:00
Dave Yarwood
19230258a7 implement :stop REPL command 2020-08-21 20:54:34 -04:00
Dave Yarwood
9791280b6f implement REPL :help command 2020-08-18 21:53:56 -04:00
Dave Yarwood
e0c1c53089 tweak player-spawning parameters
With the previous settings, I was finding it too easy during regular REPL usage
to end up with no players available and have to wait for a new one to spawn.

Increasing the number of desired players from 2 to 3 also helps a lot to ensure
that enough players are available when playing a bunch of score files in rapid
succession with `alda play`. With these new settings, I was able to go through
all of the example scores in the repo one by one and play them (overlapping)
with `alda play` and it worked out great!
2020-08-17 20:32:54 -04:00
Dave Yarwood
54eaee4614 implement "from" and "to" options for REPL :play command 2020-08-17 20:30:21 -04:00
Dave Yarwood
dcda01b872 correctly handle client closing the connection 2020-08-16 20:43:11 -04:00
Dave Yarwood
9a79ba43d0 handle client connection error 2020-08-16 20:42:44 -04:00
Dave Yarwood
b898ec5ef3 add REPL smoke tests to the alda doctor routine 2020-08-16 19:31:49 -04:00
Dave Yarwood
0a31d2a615 implement nREPL server and client for Alda REPL 2020-08-15 21:49:11 -04:00
Dave Yarwood
248b1b01e6 global rename of "emit(ter)" => "transmit(ter)"
Emitter always sounded weird to me the way I've been using it. I looked up the
difference in the definitions and Transmit definitely makes more sense, not to
mention it sounds better.
2020-07-26 15:06:30 -04:00
Dave Yarwood
045c202fb0 REPL server: player management, basic :play command working 2020-07-26 14:48:52 -04:00
Dave Yarwood
602bc2d957 synchronize note scheduling for series of input sent to the REPL 2020-07-18 13:52:45 -04:00
Dave Yarwood
2562acba2f basic MVP of an Alda REPL client + server
There's lots of work yet to be done here, this is just the basic scaffolding,
including:

* readline emulation / history file support, via a good library
* basic client/server interaction, all within a single process
* the REPL server keeps track of input and a score object and uses them to apply
  successive updates within the context of the existing score

Not yet implemented:
* The various REPL commands, for parity with v1.
* Client/server communication via some sort of network protocol (maybe nREPL?)
* Better player management (see comments in the code)
* Command line options to optionally start client only or server only.
2020-07-12 21:58:37 -04:00