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 CV outputs to hit precisely zero (fix #187) #188

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/common/core/LibAVR32Module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ struct LibAVR32Module : rack::engine::Module, GridConsumerBase

inline float LibAVR32Module::dacToVolts(uint16_t dac)
{
// special case 0 so CV outs used as gates hit true zero (see issue #187)
if (dac == 0) {
return 0;
}

// 12 bits of information left aligned in a 16-bit word, add a small offset to get the 12-bit data closer to true
return (10.0 * dac / (0xFFFF * 1.0)) + dacOffsetVolts;
}
Expand Down