Skip to content

Allow noteblock to play multiple pitches in same frame - #129

Open
MrDuck557 wants to merge 7 commits into
sk7725:masterfrom
MrDuck557:SingleNoteblock
Open

Allow noteblock to play multiple pitches in same frame#129
MrDuck557 wants to merge 7 commits into
sk7725:masterfrom
MrDuck557:SingleNoteblock

Conversation

@MrDuck557

Copy link
Copy Markdown
Contributor

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

@MrDuck557

Copy link
Copy Markdown
Contributor Author

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

@sk7725

sk7725 commented Nov 13, 2021

Copy link
Copy Markdown
Owner

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
Copy Markdown
Contributor Author

unable to play identical pitches in the same frame

I'll try doing this

@MrDuck557

MrDuck557 commented Nov 13, 2021

Copy link
Copy Markdown
Contributor Author

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

sk7725 commented Nov 15, 2021

Copy link
Copy Markdown
Owner

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

MrDuck557 commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

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

MrDuck557 commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

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.

2 participants