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

Allow noteblock to play multiple pitches in same frame #129

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MrDuck557
Copy link
Contributor

I only changed logic because that is the only way it is feasibly happening

@MrDuck557
Copy link
Contributor Author

yes this works, given that I'm playing bad apple on a single noteblock without any note drops

@sk7725
Copy link
Owner

sk7725 commented Nov 13, 2021

You need a way to limit this (10 sounds per 10 ticks) or make the noteblock unable to play identical pitches in the same frame, snynoe with a malicious intent or just a beginner at logic can easily play wind3.ogg @ipt times per tick, which is unfortunate if you do be happening to be wearing earphones or something

@MrDuck557
Copy link
Contributor Author

unable to play identical pitches in the same frame

I'll try doing this

@MrDuck557
Copy link
Contributor Author

MrDuck557 commented Nov 13, 2021

playing wind3 60 times a second is still earsplitting, but it can't break your eardrums at 1500 times a second
it still works the same

@sk7725
Copy link
Owner

sk7725 commented Nov 15, 2021

the new implementation looks horrible, doing 72 calculations every play attempt.
I myself don't see a good solution, just make your music players not so compact

@MrDuck557
Copy link
Contributor Author

MrDuck557 commented Nov 15, 2021

ok do you want me to reinit the array
also it's still constant time
as well at being a fairly light operation (setting a variable isn't difficult)
and it's not every play attempt, it's every play attempt that isn't on the same frame

@MrDuck557
Copy link
Contributor Author

MrDuck557 commented Nov 15, 2021

Doing the operation 1,000,000,000 times takes 12,438 milliseconds, which means each one takes 12.438 nanoseconds
Initing a new array 1,000,000,000 times takes 15,549 milliseconds, which is more than the current operation and takes 15.549 nanoseconds
In order to lag the game by one millisecond relative to before this pr you would need to fire 80,398 noteblocks at the same time
Note that these tests were done in a separate program, so it may not be perfectly accurate

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.

None yet

2 participants