spotify / pedalboard

🎛 🔊 A Python library for audio.
https://spotify.github.io/pedalboard
GNU General Public License v3.0
5.25k stars 262 forks source link

Anaglyph is not working! (?) #53

Open charlesneimog opened 2 years ago

charlesneimog commented 2 years ago

Hi again @psobot, this is one more problem with a specific plugin.

I am running this code:

import soundfile as sf
from pedalboard import load_plugin

plugin = load_plugin(r'C:\USERS\CHARL\ONEDRIVE_USP.BR\DOCUMENTS\PLUGINS\VST3\anaglyph-win-v0.9.4c\Anaglyph.vst3')

#all_parameters = list(plugin.parameters.keys())

plugin.azimuth = 90
audio, sample_rate = sf.read(r'C:\Users\charl\Documents\OM#\temp-files\om-ckn\Mus_Suja.wav-v-stereo.wav')
final_audio = plugin.process(audio, sample_rate)
sf.write(r'C:\Users\charl\OneDrive_usp.br\Documents\OpenMusic\out-files\Mus_Suja2.wav', final_audio, sample_rate)

Is it my mistake?

(I am writing this here because I think that it is not. Maybe it can be an issue).

Thank you, Merry Christmas!

http://anaglyph.dalembert.upmc.fr/

psobot commented 2 years ago

Hi @charlesneimog! I'm not sure I follow what the problem is here - what happens when you run the above code, and how does it differ from what you expect to happen?

When I run the above code (with paths changed, and on macOS) the output does sound noticeably different from the input.

charlesneimog commented 2 years ago

Weird!!!

To show you that here is not working, some audio files:

  1. Original sound:

Original.zip

  1. PedalBoard sound (azimuth 90).

PedalBoard.zip

  1. Using Reaper and putting the GUI of Anaglyph in azimuth 90 too.

Reaper.zip

Is it some problem with Windows OS?

Thank you!

ravicodelabs commented 2 years ago

Hi All - I decided to give this a shot to provide another data point, using macOS i5.

I think I see the problem that @charlesneimog is having. In particular, pedalboard is not providing the same processed output as Reaper when using the Anaglyph plugin with "default" values. However, it does seem that pedalboard is doing some processing, since it is not exactly the same as the original (the bass sounds higher in the pedalboard processed audio when compared to the original audio that Charles provided).

It turns out that when I tried this using the AudioUnits version of Anaglyph plugin, I had the same issue as Charles. In fact, when I compared the raw audio output data after processing with pedalboard, the output seems very similar between my run and Charles' run (the small difference seems like it could be system-dependent rounding or representation error). Below is some data that shows this:

Code: print(audio_original.sum(), audio_charles_processed.sum(), audio_ravi_processed.sum()) Output: 3.6747537 -49.634502 -49.647076

The next thing I thought is whether the default values are somehow not the same when using Anaglyph via pedalboard versus when using with a DAW like Reaper (or Logic in my case). I spot checked a few of the parameters and could not find any difference between the default values that either setup is using, though. For reference, below is a print out of all the default parameters I'm getting for Anaglpyh via pedalboard:

bypass False
bypass_ild False
bypass_itd False
bypass_distgain False
bypass_hrir False
bypass_parallax False
bypass_reverb False
reverb_only False
itd_individualization False
micro_oscillations False
wet 100.0
dist_gain_exponent 1.0
gain 0.0
reverb_gain 0.0
head_circum 575.0
elevation 0.0
azimuth 0.0
distance 0.3
reverb_order 1.0
view_id 0.0
hrtf_id 1.0
room_id 2.0
channel_mapping_configuration 3.0
bypass_interpolation False
bypass_doppler False
bypass_air_absorption False
zoom 10.0
min_distance_attenuation 0.1
max_distance_attenuation 10.0
ir_crossfade_duration 0.05
reverb_gain_low 0.0
reverb_gain_med 0.0
reverb_gain_high 0.0

In summary: