NatronGitHub / openfx-arena

Extra OpenFX plugins for Natron
Other
41 stars 11 forks source link

AudioCurve node improvements #18

Open fen31 opened 3 years ago

fen31 commented 3 years ago

Hi, I think AudioCurve would be a very powerful node if I could select (with parameters) a frequency and a decibel (for that frequency) to act on to insert a keyframe. Thus, it will be possible to animate each character on a specific frequency. I implemented something similar in browser JavaScript and was about to adapt it to Affter Effects. But here it is almost finished. I have been able to see the part of the code where the audio file is read. But I haven't accomplished much else, maybe with some help and documentation I could. Thank you.

rodlie commented 3 years ago

(lib)SoX is used in AudioCurve, sadly documentation is lacking.

fen31 commented 3 years ago

Yes. I just wanted a little some comment from line 266 to 283 of AudioCurve.cpp. I think that would speed up the learning process and I could develop it earlier. This is because the "Import Curve from ASCII file" function does not work. If not, I could generate the curve with other software and import it into Natron. I wonder what would be easier to do. Thanks.

rodlie commented 3 years ago

https://github.com/NatronGitHub/openfx-arena/blob/master/Audio/AudioCurve.cpp#L266 Here we iterate through the blocks of audio

https://github.com/NatronGitHub/openfx-arena/blob/master/Audio/AudioCurve.cpp#L274 Here we convert from SoX internal sample format to doubles

SoX example I based my code on: https://github.com/dmkrepo/libsox/blob/master/src/example2.c

fen31 commented 3 years ago

OK thank you. I'm going to read the example well to know how to analyze the audio with sox.

fen31 commented 3 years ago

No, I think libsox is not well maintained, I think it is necessary to implement a Fourier Analysis on the read data. I am not an expert on that but I will try it before using another library.