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

beach ball when setting degree to Nil #247

Open
eeeeaaii opened this issue Jun 27, 2021 · 4 comments
Open

beach ball when setting degree to Nil #247

eeeeaaii opened this issue Jun 27, 2021 · 4 comments

Comments

@eeeeaaii
Copy link

Hi, got a beach ball in the editor when setting degree to Nil.

screen shot of code attached. I also got this error:

Error in Player a1: float() argument must be a string or a number, not 'function'

Screen Shot 2021-06-27 at 12 57 18 PM

@Qirky
Copy link
Owner

Qirky commented Jun 29, 2021

When you say beach ball, do you mean it crashes / becomes unresponsive? This doesn't happen on Windows, so it might my MacOS related. What version of Python are you using? As for the error message, that's the intended output. Nil is a function defined in FoxDot.lib.Patterns.Operators defined as follows:

def Nil(a, b):
    return a

Inputs can't be functions, so instead of crashing the application, FoxDot prints that error message then tries to play the next event. What are you trying to do by setting the degree to "Nil"? I would suggest using a1.stop() if you want to not play anything, or use a1.degree = 0 if you want to set it back to it's original value. You can also use ~a1 or a1.reset() to all

@eeeeaaii
Copy link
Author

eeeeaaii commented Jun 29, 2021 via email

@Qirky
Copy link
Owner

Qirky commented Jun 30, 2021

So for each attribute, e.g. degree, duration, amplitude, there is a separate 'loop' if that makes sense. So there isn't a way to stop it after "complete loop" because that doesn't exist. However, you can use .after(n, <str:method> to call "stop" after n number of beats e.g.

p1 >> pluck([0, 1, 2], dur=1/2, amp=[0,1,1,0,1]).after(4, "stop")

@eeeeaaii
Copy link
Author

eeeeaaii commented Jun 30, 2021 via email

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

2 participants