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

`pause` is not supported in Alda 2, but `note` is #382

Closed UlyssesZh closed 2 years ago

UlyssesZh commented 3 years ago

Something like

alda play -c "piano: (note (pitch '(a sharp)) (duration (ms 1000)))"

can be played without error, but in

alda play -c "piano: (pause (duration (ms 1000)))"

the pause is an unresolvable symbol.

daveyarwood commented 3 years ago

Good call! I think we should add pause to help with backwards compatibility.

(BTW, I appreciate all the issues you've been filing, I'm sorry I haven't had time to respond to them yet! I hope to spend some time doing that this weekend.)

ManasviGoyal commented 3 years ago

hi. can you pls elaborate ? would like to work on this

UlyssesZh commented 3 years ago

hi. can you pls elaborate ? would like to work on this

You can refer to the pause function in Alda 1.

daveyarwood commented 3 years ago

@ManasviGoyal The pause function returns a rest. There are two arities:

;; equivalent to "r", i.e. a rest with the last specified duration
(pause)

;; equivalent to "r4", i.e. a quarter note rest
(pause (note-length 4))

If you're interested in implementing this, have a look at how the note function is implemented in lisp.go, as a starting point.

I'd be happy to help if you get stuck! Feel free to reach out either here in the issue, or in the #development channel in Alda Slack.

JustinLocke commented 2 years ago

Hi,

Is this still an issue in alda 2? I would be willing to work on this task if it is still open.

daveyarwood commented 2 years ago

@JustinLocke Yes, pause is still not implemented. You're welcome to work on it, that would be great!

daveyarwood commented 2 years ago

Implemented in #413 (Thanks @JustinLocke!) I will include this in a new release soon, hopefully today!

daveyarwood commented 2 years ago

Fixed in Alda 2.2.1.