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 PitchShift deformer to take list for n_semitones #41

Closed
justinsalamon opened this issue Feb 28, 2017 · 4 comments
Closed

Allow PitchShift deformer to take list for n_semitones #41

justinsalamon opened this issue Feb 28, 2017 · 4 comments
Assignees
Milestone

Comments

@justinsalamon
Copy link

The PitchShift deformer only takes a single semitone parameter (n_semitones), which makes it a little awkward to work with when you want to perform multiple pitch shifts. LinearPitchShift can perform multiple shifts, but they have to be linearly spaced, which might not be the desired functionality (e.g. I may want n_semitones = [ -2, -1, 1, 2]).

It would be nice if PitchShift would accept (in addition to a single value) a list for the n_semitones parameter, in which case it would generate an output audio/jams for every pitch shift value in the list (times n_samples). This would make the behavior more consistent with other deformers (e.g. DynamicRangeCompression), and would allow (what I'm really after) writing more generic code that can apply a deformer agnostically of which deformer it actually is because the deformer is fully defined during initialization.

@bmcfee
Copy link
Owner

bmcfee commented Feb 28, 2017

This would be pretty easy to do if we just tweak PitchShift to accept a float-or-array instead of a single float. Should be a minor hack, if you want to take a crack at it.

@justinsalamon
Copy link
Author

Cool, I'll try and squeeze in a PR sometime before the end of this week

@bmcfee
Copy link
Owner

bmcfee commented Feb 28, 2017

Check background for an example of this kind of logic. All you need to do is then make this part iterate over the list of pitch values, instead of yielding a single value.

@bmcfee bmcfee modified the milestones: 0.1.2, 0.1.3 Mar 1, 2017
@bmcfee
Copy link
Owner

bmcfee commented Mar 1, 2017

Cool, I'll try and squeeze in a PR sometime before the end of this week

Actually, I wound up on a spree of muda hacking last night, so I don't mind taking this one over today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants