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

Fix changing plugin parameters example code in README.md #107

Merged
merged 2 commits into from Jul 10, 2022

Conversation

nashaad
Copy link
Contributor

@nashaad nashaad commented Jun 9, 2022

The example code under Does Pedalboard support changing a plugin's parameters in README.md is incomplete and didn't run in current state. Additionally, when trying to modify it to work, I noticed that it wasn't iterating through the correct ndarray needed to show the percentage which the code was also trying to do.

Completed the input, output parts, changes to the chunking code, in keeping with the simplicity of the original (i.e. without using sounddevice library). Added tqdm to show a progress bar, and verified by testing with sample audio.

@psobot
Copy link
Member

psobot commented Jul 10, 2022

Thanks @nashaad! I've updated your PR a bit to make some further changes:

  • Instead of reading the entire audio file in at once, the example code now suggests reading in chunks and processing each chunk independently.
  • The usage of chunkl and chunkr in your example was generating subtly incorrect output; the left and right channels were being passed into the board object in an alternating fashion, which would cause a ring modulation-style effect (or add a tone at ~441Hz) if the channels don't contain the same audio. Pedalboard supports multi-channel processing, so I changed this example to pass a stereo chunk into the plugin.

In addition, your PR exposed a bug in the implementation of __getitem__ (and similar methods) in PluginContainer, where negative indices are not considered valid, although they should be. I've tracked this as #112 and plan to have a fix up shortly.

@psobot psobot merged commit a745661 into spotify:master Jul 10, 2022
@nashaad
Copy link
Contributor Author

nashaad commented Jul 12, 2022

@psobot looks good :) processing both in and out in chunks makes sense

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

Successfully merging this pull request may close these issues.

None yet

2 participants