-
Notifications
You must be signed in to change notification settings - Fork 23
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
Adding support for single valued rbargs
#25
Adding support for single valued rbargs
#25
Conversation
Hey there! Just your usual internet stranger here, practicing some foo. I'm not sure how the review process works here. I just submitted one to get this little fix moving, but please let me know if I should be doing something different... appreciate your thoughts/inputs, and thanks for a great repo! Cheers! @bmcfee @faroit @waldyrious |
Thanks @adityatb ! Sorry to be slow on this, but I'll try to give it a review in the next week or so. I have a lot of dev maintenance work queued up for the near future, but I appreciate your patience. |
Sure, no worries, I understand. Thanks for the update! 🎉 |
Ok, gave it a look. Seems basically okay to me. I agree that it's not particularly elegant, but it gets the job done. Since @justinsalamon raised the original issue, maybe he could chime in on whether this sufficiently fixes it for him? |
Oh great! Thanks a bunch! |
Yes this fixes my issue (and yes it’s not the most elegant but a good interim solution). Probably missing:
thanks! |
I'll handle version bumps separately; that should be the job of a release PR. Unit tests: yeah probably :) |
Sorry to be MIA. The warm weather here means I'm finally out of hibernation. A small note, the case |
I just stumbled over this as well, great that this is being addressed! Would changes here "automatically" move over to librosa as well? (Not that important oc, as perfectly fine to use this package directly). BR |
Thanks @nullmightybofo for nudging this - it had fallen off my radar. @adityatb the tests look good to me! I agree that packing flags and valued arguments into a dictionary structure is a little inelegant, but I can live with it.
No; librosa does not use or depend on pyrb. It has its own completely different (and, I dare say, much worse) implementation of pitch shift and time stretch. |
Well, thanks first of all for this handy tool, certainly makes using rubberband easier! I saw the link to this package's time-stretch function in the librosa doc ("sse also" section here https://librosa.org/doc/main/generated/librosa.effects.time_stretch.html#librosa.effects.time_stretch) and didn't realize it leads to this package here! Instead I thought that it is used in librosa as a submodule as well, hence my question above. |
This totally fell off the radar, but now seems like a good time to do some maintenance merging. Thanks again for the PR! |
Reference Issue
Fixes Issue #21
What does this implement/fix? Explain your changes.
Arguments to CLI, parsed through
rbargs
can be single or dual valued, but currently breaks if it's single valued. for e.g.pyrb.pitch_shift(wav_data, n_semitones, rbargs={'--formant'})
won't work.This current implementation allows us to restore that functionality by parsing an empty value
''
to the CLI.This fix allows us to parse flags through in the form of
rbargs={'--flag' : ''}
while retaining thekwargs
format.Any other comments?
I do feel that this leaves us a bit wanting for something nicer but it's just a step forward to allow some functionality for now. We can explore making the extra argument as
None
instead of''
, but I figured this is probably just as intuitive for these occasional use-cases.