Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for legato to the mininotation #193

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bpow
Copy link
Contributor

@bpow bpow commented Aug 20, 2022

I just found out about legato!

It's pretty cool, and it could be a lot easier to express staccato that way as opposed to shortening durations and following up with rests of exactly the right size. However, there's no support for it in the mininotation, so here's a proposal.

For instance, you could do something like "[a4 c5 e5]=0.5 [a5 e5 c5]"

Note: the mini-notation is rapidly running out of sigils to use for different operators, I went with = for now, but that might bear some discussion since = has been mentioned as a possibility to use for notes held over after a tie. It looks like maybe & and $ may be still available...

@yaxu
Copy link
Member

yaxu commented Aug 23, 2022

Thanks for this, however legato is moving from 'context' metadata to data #111 , which I think this approach wouldn't work with

There are many other aspects of a sound that we could want to pattern in this way, and as you say we're running out of operators.

note "c e f g" # legato "0.5 0.25 0.2 0.2" is fiddly if you want to adjust every note but the same can be said for any other kind of effect.

A more general but yet-to-be-implemented approach similar to what is seen in tidal would be to use : as a delimiter for making a pattern of lists. Then doing something like:

"[a4 c5 e5]:0.5 [a5 e5 c5]".assign(note, legato)

We can build this into some 'compound' controls so e.g. adsr("0.25:0.5:0.25:0.1") and sound("bd:4 sd:2") works

I think duck typing makes this approach more practical in javascript than it is in haskell.

@felixroos
Copy link
Collaborator

assigning control params (like legato) to bare values should work with #288

"[a4 c5 e5]=0.5 [a5 e5 c5]" // { value:'a4', legato:0.5} etc...
.note() // { note:'a4', legato:0.5 } etc...

@felixroos felixroos marked this pull request as draft June 26, 2023 20:49
@felixroos
Copy link
Collaborator

A more general but yet-to-be-implemented approach similar to what is seen in tidal would be to use : as a delimiter for making a pattern of lists. Then doing something like:

"[a4 c5 e5]:0.5 [a5 e5 c5]".assign(note, legato)

We can build this into some 'compound' controls so e.g. adsr("0.25:0.5:0.25:0.1") and sound("bd:4 sd:2") works

I think duck typing makes this approach more practical in javascript than it is in haskell.

update from the future: the ":" operator exists. The above mentioned assign function is prototyped here: #595 called "as". It can be used to solve the specific problem of this PR using the following syntax:

"[a4 c5 e5]:0.5 [a5 e5 c5]".as("note:clip")

note: clip is basically the same as legato (pun intended :P)

I generally like the idea of using ":" instead of adding a new operator, because there is only a limited number of available operators + any operator that would set a key on the hap.value is problematic to use on a hap of plain values.
Also, the as function is very self-explanatory, so you don't need to learn special syntax

@felixroos felixroos mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants