Skip to content

Add more geiger#1

Merged
lukechampine merged 1 commit intolukechampine:masterfrom
klauspost:more-geiger
Aug 12, 2019
Merged

Add more geiger#1
lukechampine merged 1 commit intolukechampine:masterfrom
klauspost:more-geiger

Conversation

@klauspost
Copy link
Contributor

While the current implementation does well for emulating an avant-garde synthesizer theme the package name is a bit misleading. I attempt to fix that.

Other than that, this also adds a baseline to sort of account for the allocations by the application itself.

"Test" added. Confirmed it sorta-kinda works.

While the current implementation does well for emulating an avant-garde synthesizer theme the name does sound a bit misleading.

Other than that, this also adds a baseline to sort of account for the allocations by the application itself.

"Test" added.
rate := float64(diff)/memSampleRate.Seconds() - baseline
// If it becomes too high it becomes inaudible.
// Limit at 3.6 Roentgen.
rate = math.Min(rate, float64(sr)/3.6)
Copy link
Owner

Choose a reason for hiding this comment

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

not great, not terrible

const sr = beep.SampleRate(44100)
const memSampleRate = 100 * time.Millisecond
const memSampleRate = 500 * time.Millisecond
const baseline = 160
Copy link
Owner

Choose a reason for hiding this comment

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

ideally we could measure this empirically somehow, but I suppose this is better than nothing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it was a bit "twitchy" with 100... At least now if you make a burst of allocations you will feel the pain for half a second :D

@lukechampine lukechampine merged commit 2821d78 into lukechampine:master Aug 12, 2019
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