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

macos: clip output values on supernova #5454

Merged
merged 3 commits into from
Jun 4, 2021

Conversation

dyfer
Copy link
Member

@dyfer dyfer commented May 21, 2021

Purpose and Motivation

Clip loud signals on macOS on supernova. See scsynth version #5412 for the detailed description. Thanks @elgiano !

I've taken @elgiano 's WIP branch and his implementation seems to work as expected for me so I'm submitting this PR made some changes.

Fixes #5412

Types of changes

  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

@dyfer dyfer force-pushed the topic/macos-clipping branch from d198b59 to f78552d Compare May 21, 2021 06:32
@dyfer dyfer marked this pull request as ready for review May 21, 2021 06:33
@dyfer dyfer requested a review from joshpar May 21, 2021 06:33
@dyfer dyfer force-pushed the topic/macos-clipping branch from eaf2616 to 9705ce6 Compare May 21, 2021 21:39
joshpar
joshpar previously approved these changes May 21, 2021
Copy link
Member

@joshpar joshpar left a comment

Choose a reason for hiding this comment

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

looks and sounds good to me!

@dyfer dyfer marked this pull request as draft May 21, 2021 22:56
@dyfer
Copy link
Member Author

dyfer commented May 24, 2021

(still doesn't work, WIP)

@dyfer dyfer force-pushed the topic/macos-clipping branch from 9705ce6 to 901fb28 Compare May 25, 2021 07:26
@dyfer
Copy link
Member Author

dyfer commented May 25, 2021

I think this works now. I used nova_simd functions to perform vectorized clip2. More in the comments below.

I don't really know what I'm doing here - please review and test carefully!

Here is my testing code:

s.options.outDevice_("Built-in Output"); // optionally

(
Server.supernova;
s.options.safetyClipThreshold_(0.16); // clips
s.reboot;
s.doWhenBooted({
	x = {SinOsc.ar(600, 0, 0.dbamp)}.play;
})
)

(
Server.scsynth;
s.options.safetyClipThreshold_(1.26); // default - clips (LOUD!)
s.reboot;
s.doWhenBooted({
	x = {SinOsc.ar(600, 0, 6.dbamp)}.play;
})
)

(
Server.scsynth;
s.options.safetyClipThreshold_(nil); // also default - clips (LOUD!)
s.reboot;
s.doWhenBooted({
	x = {SinOsc.ar(600, 0, 6.dbamp)}.play;
})
)

( // WARNING
Server.scsynth;
s.options.safetyClipThreshold_(0); // NO CLPPING (LOUD!)
s.reboot;
s.doWhenBooted({
	x = {SinOsc.ar(600, 0, 6.dbamp)}.play;
})
)

@dyfer dyfer force-pushed the topic/macos-clipping branch from 901fb28 to 28ff671 Compare May 25, 2021 08:06
@dyfer dyfer marked this pull request as ready for review May 25, 2021 08:14
@dyfer dyfer requested a review from joshpar May 25, 2021 08:15
@dyfer dyfer dismissed joshpar’s stale review May 25, 2021 08:16

Needs another review after changes :)

@dyfer dyfer merged commit f622b66 into supercollider:develop Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[supernova] clip output values
3 participants