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

AudioCurve node improvements #18

Open
fen31 opened this issue Jul 10, 2021 · 5 comments
Open

AudioCurve node improvements #18

fen31 opened this issue Jul 10, 2021 · 5 comments

Comments

@fen31
Copy link

fen31 commented Jul 10, 2021

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
Copy link
Collaborator

rodlie commented Jul 11, 2021

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

@fen31
Copy link
Author

fen31 commented Jul 11, 2021

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
Copy link
Collaborator

rodlie commented Jul 11, 2021

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
Copy link
Author

fen31 commented Jul 11, 2021

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

@fen31
Copy link
Author

fen31 commented Jul 12, 2021

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.

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

No branches or pull requests

2 participants