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

Feature "Once" : #3

Open
mr-eggleton opened this issue Nov 20, 2022 · 0 comments
Open

Feature "Once" : #3

mr-eggleton opened this issue Nov 20, 2022 · 0 comments

Comments

@mr-eggleton
Copy link
Collaborator

Being able to designate a line or method to be only done once.

Problem, when you play something like this :

@nextBar
def a():
    d1 >> play("Xx")  #the drums we will solo 
    l1 >> pads() # the new melody coming in
d1.soloBars()

It sounds great but when you then add to l1 it runs it all again (including the soloBars which is never what i want).

Basically once() in should only run the code once unless it has been edited

Syntax suggestion 1:

@nextBar
def a():
    l1 >> pads() # the new melody coming in
@once
def b():
    d1 >> play("Xx").soloBars(end=True)

I don't like using a decorator for this but I'm not sure how to do Syntax suggestion 2:

l1 >> pads().nextBar()
d1 >> play("Xx").soloBars(end=True).once()
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

No branches or pull requests

1 participant