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
Control for pitch adjust #534
Conversation
Any input on this? Do I need to read and agree to the long CLA first? |
Sorry I can’t even look at anything without the CLA signed. I License BlackHole to 3rd parties and I want to avoid any copyright infringement.
Devin
…On Feb 25, 2022, 1:17 AM -0800, Henrik Enquist ***@***.***>, wrote:
Any input on this? Do I need to read and agree to the long CLA first?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Alright, understood. I just find these legal things so tedious, but I have read and signed it now. |
This is interesting. Yes a custom control would be a better solution. I'm curious on how this would be implemented. Would you just monitor the clocks of BlackHole and another device and adjust BlackHole when it starts to drift? My solution, was to synchronize BlackHole clock with that of a different audio device. That's still in development but there were a couple hiccups that need to be ironed out. |
I basically record from one device, do some processing on the audio data, push it to a buffer, and play it back on another device from that buffer. At the same time I monitor how many frames I have in the buffer. If it's lower or higher that the target value, I adjust the speed of the capture device to keep the level constant. When the capture device is an Alsa loopback (on Linux), I adjust the virtual clock of that device. When it's anything else, I instead insert an asynchronous resampler that I adjust. If Blackhole is also adjustable, then I can get rid of this resampler on MacOs too. I'll continue and try to figure out how to add custom controls then. I think this adjust feature would coexist nicely with your other option of locking the clock to another device. |
BTW I'm struggling with finding relevant coreaudio documentation. Does anyone have any advice on where to find something? A book perhaps? |
I was thinking AudioSliderControl but just reading the docs it looks like it only uses UInt32. You probably want to use a float.
So maybe your idea of using the AudioStereoControlPan is the best. Doesn’t look like there’s much customizability with these built-in controls unfortunately.
Devin
…On Mar 12, 2022, 2:28 AM -0800, Henrik Enquist ***@***.***>, wrote:
BTW I'm struggling with finding relevant coreaudio documentation. Does anyone have any advice on where to find something? A book perhaps?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Uint32 should be just fine! I think an allowed range of +-1% is reasonable. Dividing that up into 2^32 steps already gives more precision than needed. |
It seems like custom controls are not shown in Audio Midi Setup. I think the rate control should be accessible from there, if not it needs some app to expose it to the user. |
I'm guessing that Audio Midi Setup only checks for (and shows) a few different standard controls. It doesn't seem to be possible to customize those with names etc (or at least I haven't managed). |
Just had a (maybe) good idea. What if we add a ClockSource control, with two values called something like "InternalFixed" and "InternalAdjustable"? Default is "InternalFixed" where everything is the same as before, and "InternalAdjustable" enables adjusting via the pan control. And later the list can be extended with the other devices for syncing the clock to another device. |
THere’s actually a clock source control that I was going to use for external syncing.
Devin
…On Mar 29, 2022, 4:36 AM -0700, Henrik Enquist ***@***.***>, wrote:
Just had a (maybe) good idea. What if we add a ClockSource control, with two values called something like "InternalFixed" and "InternalAdjustable"? Default is "InternalFixed" where everything is the same as before, and "InternalAdjustable" enables adjusting via the pan control. And later the list can be extended with the other devices for syncing the clock to another device.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
will there still be an update on this feature? |
I will finish it! I just haven't had enough free time lately. |
d9f2b7a
to
b6eab4f
Compare
Rebased on current master. I had to change the os target version back to 11.1 since my old Mac can't run the latest Xcode. This is a bit annoying since it meant I had to rename I haven't looked at the clock source selection yet. Should I continue using the balance control for the rate, and add the clock source selection as I suggested before? Just want to confirm this before I start any work. |
Why not do something like define kAudioObjectPropertyElementMain = kAudioObjectPropertyElementMaster if target is below a certain macOS version? Then it works in all instances. |
Good idea, done! I'm still wondering about the clock source select and use of the pan control, can you please share your view on that? |
The changes for adding a clock source selection are here: |
Hi, Devin any chance to prioritize the review and merge these changes in? Thanks! |
A friendly ping |
I'm still not sure what to do here. Should I merge the clock source select to this pr or not? |
Nah. I can deal with that another time.
But please merge master into your branch.
Devin
…On Nov 15, 2022 at 1:02 AM -0800, Henrik Enquist ***@***.***>, wrote:
> I'm still wondering about the clock source select and use of the pan control, can you please share your view on that?
I'm still not sure what to do here. Should I merge the clock source select to this pr or not?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
I did that a couple of weeks ago, I don't see any changes in master since then. Then I leave this PR as is, and submit another one for the clock source select. |
Should I get rid of the changes in the other files than Blackhole.c? |
Yeah.
Devin
…On Nov 15, 2022, 12:59 PM -0800, Henrik Enquist ***@***.***>, wrote:
Should I get rid of the changes in the other files than Blackhole.c?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
done |
Any chance this could be merged soon? |
I'll be able to look at this over the next week. |
Looking at this now! |
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.
Looks good. Thanks for all the hard work on this. I hope it help some people out.
Only took me a year. Lol. Sorry about that. |
Sweet thanks!! Then I will follow up with another pr very soon, for adding a clock source selector. |
I should mention I noticed some audio glitches when changing the value. I’ll look into the more.
Devin
…On Jan 16, 2023, 12:10 PM -0800, Henrik Enquist ***@***.***>, wrote:
Sweet thanks!! Then I will follow up with another pr very soon, for adding a clock source selector.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Oh I'll look into that too then! I haven't noticed any glitches, but I usually change the value very little. How big of a change did you make? |
Good news that this is finally merged in! |
This is a prototype that exposes a control for adjusting the sample rate of the Blackhole device by +- 1%. This functionality is provided by the standard Alsa loopback device on Linux, and is very useful for syncing the loopback to other things, that may or may not be another Alsa device.
For now it uses the balance control of the playback side for the control. The balance control is perhaps not the ideal choice., but I have not yet figured out how to (and if it's possible) to add a custom control.
Would you be willing to include something like this in Blackhole?