Commit Graph

133 Commits

Author SHA1 Message Date
Dave Yarwood
6fdfe8fa6c Attempt at adding alda-code function to alda-lisp 2021-08-03 23:24:23 -04:00
David Lu
968bce60b1 MusicXML Importer - Unpitched Percussion (#363) and Optimization (#364)
Add support for unpitched percussion instruments in MusicXML import and an optimization layer to generate more idiomatic Alda
2021-06-30 22:41:16 -04:00
Dave Yarwood
ecb5aae370 Hack to work around aurora not supporting NO_COLOR 2021-06-28 11:04:48 -04:00
David Lu
f78f9055ab Fixed tests 2021-06-06 21:09:55 -04:00
David Lu
c8afe42062 Added tests 2021-06-06 21:03:48 -04:00
David Lu
fc83d51db2 Fixed lisp early return with no arguments bug 2021-06-06 21:03:48 -04:00
David Lu
c7ec39fa06 Set Alda dynamic marking volumes 2021-06-06 21:03:48 -04:00
David Lu
320095a649 Added support for dynamic markings 2021-06-06 21:03:48 -04:00
Dave Yarwood
506682a399 Don't apply global attribute changes immediately to the current parts
They will be applied right before those parts play their next
notes/rests/chords or right before they jump to a marker.
2021-06-06 20:30:45 -04:00
Dave Yarwood
4960e1b699 Add list function to alda-lisp 2021-06-06 20:24:38 -04:00
Dave Yarwood
4323b6c55d Improve/fix tests of global attribute changes being applied 2021-06-06 20:24:23 -04:00
Dave Yarwood
632be89a6c Bugfix: adjust when we do and don't apply global attributes
This improves things a bit with respect to global attributes being applied too
often. Usually you don't notice because we're just applying the same attribute
values multiple times, but it's particularly noticeable with things like
(octave! 'up).

I haven't quite 100% fixed the (octave! 'up) case yet. I think I also need to
make it so that global attribute changes don't immediately apply the attribute
change, because then it'll just get applied again right before the next
note/rest.
2021-06-06 20:23:50 -04:00
Dave Yarwood
93670d5bba Add quote special form 2021-06-06 16:49:31 -04:00
David Lu
6795bc6bf0 Set up preliminary musicxml importer 2021-05-01 20:01:46 -04:00
Dave Yarwood
0251100739 Fix linter warning about unneeded upper bound on slice 2021-02-14 21:20:55 -05:00
Dave Yarwood
3e1d7d587d use bright yellow instead of yellow 2021-01-28 22:38:31 -05:00
Dave Yarwood
6fa9ea0c17 less gobbledygook in this error message 2021-01-25 21:02:26 -05:00
Dave Yarwood
0d74a7caaa work around edge cases where the source context is missing 2021-01-25 21:02:12 -05:00
Dave Yarwood
8921917d9b improve "invalid offset reference" error message 2021-01-19 12:50:42 -05:00
Dave Yarwood
b3956dde60 scaffolding for better user-facing error messages 2021-01-16 15:27:22 -05:00
Dave Yarwood
e0d11b1ec2 include source context EVERYWHERE
This provides filename/line/column context for any error I could possibly find.
To achieve this, I made it so that all ScoreUpdates have source context, so when
updating the score results in an error, we can print out the line and column
number corresponding to the error.

It's a bit more complicated than that, because score updates are nestable (e.g.
event sequences can contain cram expressions can contain chords, etc.), which
essentially gives us a stacktrace whenever a score update results in an error. I
punted on giving the user the full stacktrace, in favor of doing something
simpler and just showing the bottom-most error, because that's probably going to
be the line and column number that's the most helpful.
2020-11-14 20:34:04 -05:00
Dave Yarwood
b2adf1760b Beats() signature change: (float64, error) => float64
Notionally, I can't think of a reason why Beats() should ever return an error. I
think the only reason why I included an error argument was so that I could
return a clear non-value in the case of miliseconds => beats conversion. But
milliseconds => beats conversion _is_ possible, it's just that I've been punting
on it (and am continuing to punt now). Eventually, if I want to implement
Beats() for NoteLengthMs, I'll need to adjust the signature again to include a
tempo argument (i.e. `Beats(tempo float64)`). Until then, I think it's OK to
panic in that scenario. In practice, it shouldn't be possible for the end user
to go down that code path.
2020-11-14 15:48:13 -05:00
Dave Yarwood
f961abfd3c reorganize source context stuff a bit 2020-10-29 20:42:46 -04:00
Dave Yarwood
2570c6ace6 improve the error message when mixing unnamed and named instances in a part declaration 2020-10-24 14:30:43 -04: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
ad659577b9 implement REPL :instruments command 2020-09-17 21:00:59 -04:00
Dave Yarwood
3386b31b59 JSON fixes/adjustments
* Omit "duration" on notes, rests and crams when the duration value is implicit
* Omit "slurred?" on notes when false, for brevity.
* Fix an issue I just noticed where `.Set(...)` doesn't work with the
  declarative JSON thing I'm doing. Sigh.
2020-09-07 21:21:51 -04:00
Dave Yarwood
638a2341b7 fix JSON representation of part declaration 2020-09-07 16:50:18 -04:00
Dave Yarwood
28f58ee8a4 jsonify ALL THE THINGS
in preparation for `alda parse` and the corresponding REPL commands
2020-09-07 16:30:36 -04:00
Dave Yarwood
7d2bec538b make part.currentRepetition private
Just because it's an implementation detail.
2020-09-07 16:28:01 -04:00
Dave Yarwood
e5e1cdc90d remove TODO comment (i'm deciding not to do this) 2020-08-16 21:09:01 -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
602bc2d957 synchronize note scheduling for series of input sent to the REPL 2020-07-18 13:52:45 -04:00
Dave Yarwood
65fb309867 it would be weird if this was > 3, so use == instead of >= 2020-07-10 20:03:31 -04:00
Dave Yarwood
6a770639c5 fix typo 2020-07-10 20:01:56 -04:00
Dave Yarwood
95754fc644 v1 parity: alda play --from and --to options 2020-06-28 20:53:30 -04:00
Dave Yarwood
84e8946979 when emitting, sort the events in chronological order, and schedule volume and panning control change messages only when necessary 2020-06-17 09:32:05 -04:00
Dave Yarwood
8e0ddd81a3 add debug logging 2020-05-25 14:32:43 -04:00
Dave Yarwood
b115bc3b91 fix: the specified outer duration of a cram should become the parts' new default duration 2020-04-25 16:18:02 -04:00
Dave Yarwood
8346d1d189 fix: correctly reset voices at the end of a voice group 2020-04-23 07:44:03 -04:00
Dave Yarwood
7899058d4b duration equivalence sanity test 2020-04-18 21:03:08 -04:00
Dave Yarwood
ed570636b0 use float64 everywhere to fix inaccuracies caused by converting float32 <=> float64 2020-04-18 21:02:35 -04:00
Dave Yarwood
05b675ff90 fix bug where the last specified duration inside a cram affects the duration outside 2020-03-13 08:08:27 -04:00
Dave Yarwood
8be840fd19 fix bug where the duration of a chord inside a cram doesn't consider time scale 2020-03-11 22:03:46 -04:00
Dave Yarwood
aeb633e33d rm irrelevant part of Chord doc comment copy-pasted from Note.DurationMs doc comment 2020-03-10 22:51:09 -04:00
Dave Yarwood
ebfe961c38 note => audible duration test case 2020-03-10 22:42:50 -04:00
Dave Yarwood
1dfc5bb5fa support percussion 2020-01-18 09:57:40 -05:00
Dave Yarwood
5fba46ac76 add logging around getting and setting variables 2019-11-17 20:47:01 -05:00
Dave Yarwood
d98814b3cd bugfix related to the disconnect between part clones and parts 2019-11-17 17:19:09 -05:00
Dave Yarwood
75d3ba995f fix bug causing too many nested aliases to be defined 2019-11-17 08:08:23 -05:00