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

asl builder proof-of-concept #918

Merged
merged 2 commits into from
Jan 15, 2020
Merged

asl builder proof-of-concept #918

merged 2 commits into from
Jan 15, 2020

Conversation

pq
Copy link
Collaborator

@pq pq commented Oct 15, 2019

food for thought.

caveat: i'm flummoxed as to why explicit unloading of asl is needed (where it isn't for other libraries brought in by a require, like, for example beat_clock).

anyway, the idea is a norns script with a line like this:

require 'asl'

will then be able to do things like:

crow.output[1].action = loop{ to(0,0), to(5,0.1), to(1,2) }
crow.output[1].action = lfo(1, 5) 

and have it behave like in druid.
...

the dynamic case is tricky of course and requires a low-level send. so, something like:

    crow.send[[
      output[1].action = ar(1, math.random(5))
    ]]

the bet is that a string-builder like this will be useful in the common-case and at least not confusing in the complex one...

it has the benefits of feedback from linters and IDEs (since it's valid lua) and scores bonus points for highlighting nicely in maiden

image

and generally in IDES (like vs code):

image

as for the global pollution issue (see #557), asl functions only get added to _G if asl is included and only hang around until the next script is loaded.

i think that's probably the right thing.

i should emphasize that i think of this purely as food for thought and i'm not hugely invested in it landing as is (or at all). i just wanted to see the idea through...

fixes: #890

/cc @tehn @catfact @trentgill

@tehn tehn requested a review from trentgill October 16, 2019 11:59
@tehn
Copy link
Member

tehn commented Oct 16, 2019

this is great! and perplexing about the asl require bug. i'll take a minute to look at it.

@tehn
Copy link
Member

tehn commented Oct 20, 2019

i'm thinking i'll merge this in parallel with a doc update. i like the approach, thanks for taking the time

@tehn
Copy link
Member

tehn commented Oct 29, 2019

ack, sorry for lagging on this. need to find to test. will get it in the next-next update (should be forthcoming)

@pq
Copy link
Collaborator Author

pq commented Oct 29, 2019

no worries. more food for thought than anything!

@tehn tehn merged commit d523b1e into master Jan 15, 2020
@tehn tehn deleted the asl_hax_2 branch January 15, 2020 16:39
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.

crow output action assignments use quotes
2 participants