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

New audio! #335

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

New audio! #335

wants to merge 15 commits into from

Conversation

mattgodbolt
Copy link
Owner

@mattgodbolt mattgodbolt commented Dec 22, 2021

  • Outputs audio at chip frequency
  • Spits it out as buffers to a web audio thread that then (terribly) downsamples it.
  • Various queues and stats
  • Horrible hacks to try and keep things in sync.

@mattgodbolt mattgodbolt changed the title A very long and painful attempt at getting new audio New audio! Dec 23, 2021
This reverts commit 58642bd.

It was not good enough - averaging works better to reduce noise
on e.g. depeche mode.
@mattgodbolt mattgodbolt marked this pull request as ready for review December 23, 2021 21:48
new AudioWorklet(
new URL("./audio-renderer.js", import.meta.url)
)
);
if (audioFilterFreq !== 0) {
this.soundChip.filterNode = this.audioContext.createBiquadFilter();
this.soundChip.filterNode.type = "lowpass";
this.soundChip.filterNode.frequency.value = audioFilterFreq;
this.soundChip.filterNode.Q.value = audioFilterQ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a cleaner separation of web API I/O vs pure emulation code,filterNode doesn't need to be instanced as a property of soundChip

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm only noticing this due to my weird use case running JSbeeb in a worker)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think I put it there purely to "hang on to it" as I think in some cases if it gets GC'd maybe it stops working?

@mattgodbolt
Copy link
Owner Author

Webpack's lack of decent support still gives me pause, but...I brought this up to date at least.

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