-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Ramp values to and from a default value while active. #1280
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
Conversation
This reduces the popping sound on initial playback of an audio sample. The M4 DAC has a pop on startup that cannot be prevented. It also does not allow readback so current values of the DAC are ignored. Fixes micropython#1090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff.
I have a basic question. When I heard about doing this I thought you were going to doing the ramping when you started and stopped playing a sample, so that no matter what was at the beginning or end of the sample, the output would smoothly rise to match that. I read the issue in more detail and I realize it was not spec'd that way. [copied this to the issue for discussion there]
shared-bindings/audioio/AudioOut.c
Outdated
@@ -43,13 +43,15 @@ | |||
//| | |||
//| AudioOut can be used to output an analog audio signal on a given pin. | |||
//| | |||
//| .. class:: AudioOut(left_channel, right_channel=None) | |||
//| .. class:: AudioOut(left_channel, *, right_channel=None, default_value=0x8000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to think of a more descriptive name for this than "default_value". Maybe "silence_value" or "midpoint value"?. @CedarGroveStudios, is there a standard name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term "quiescent value" is frequently used to describe both the bipolar zero value of the sample stream data and the corresponding unipolar-biased value of the DAC. How does that sound to you? @dhalbert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good but @tannewt can weight in too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quiescent_value
works for me. I don't expect people to change it very often. Will update it soon.
* default_value is now quiescent_value * Use step = -step format for sign switch * Add note about analogout_reset being empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Too bad SAMD51 is so finicky.
This reduces the popping sound on initial playback of an audio
sample.
The M4 DAC has a pop on startup that cannot be prevented. It also
does not allow readback so current values of the DAC are ignored.
Fixes #1090