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

Add audio input for induced motion #102

Closed
sbaier1 opened this issue Apr 1, 2022 · 8 comments
Closed

Add audio input for induced motion #102

sbaier1 opened this issue Apr 1, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@sbaier1
Copy link
Contributor

sbaier1 commented Apr 1, 2022

This is merely a ticket to notify you of my work in case you're working on something similar, i'm planning to create a PR in the near future once my initial implementation is somewhat ready (need to do some cleanup and perhaps some minor improvements as shown below, though it does work and produce usable results already).

I'd like to use pytti to make music visualizations / animations.

For that purpose i am in the process of adding some config parameters:

  • input audio file for reading arbitrary audio files
  • FFT window size for configuring the analysis window
  • offset parameter for testing or offsetting audio for other reasons
  • some band parameters. i'm not 100% set on this yet, currently it splits the FFT frequencies into discrete bands with a hard cutoff, but i'm considering adding support for configuring arbitrary bandpass filters with configurable Q and frequency in the near future.

the amplitude of the bands in relation to the overall signal is then passed into the transforming math envs.

This allows for making animated music visualizations by reacting to the audio spectrum.
It could also be considered to add beat detection later on, but for now this is a relatively simple approach to the problem.

@dmarx dmarx added the enhancement New feature or request label Apr 1, 2022
@dmarx
Copy link
Member

dmarx commented Apr 1, 2022

i've thought about doing something like this but mostly just haven't out of laziness. looking forward to your PR!

FYI: I just merged some changes that included a new config option, so you might need to rebase your feature branch.

@dmarx
Copy link
Member

dmarx commented Apr 21, 2022

merged into test branch with PR #140 . Still to do:

  • demonstration of this feature for documentation
  • minimal test case

@dmarx
Copy link
Member

dmarx commented Apr 24, 2022

Documentation added: https://pytti-tools.github.io/pytti-book/Settings.html#audio-reactivity-controls

@sbaier1
Copy link
Contributor Author

sbaier1 commented Apr 27, 2022

thank you! just had some free time and would've built something but the docs look pretty neat already.
perhaps i'll extend the guide with a bit of audio pre-processing info because it can be a little tricky to use it easily for sort of beat detection

FWIW here's a snippet of my first bit of testing :)

dazzled_cut_small.mp4

@dmarx
Copy link
Member

dmarx commented Apr 28, 2022

lit. Mind if I tweet that out?
also yeah, any kind of tutorials or guides you wanna contribute to the docs would be very welcome!

@dmarx
Copy link
Member

dmarx commented Apr 28, 2022

aw fuck... I think it might be off by a frame (which is totally on me if that's the case). try adding an empty frame or duplicating the first frame and re-rendering the video. if it synchs better, I'm pretty sure I know what the problem is.

@sbaier1
Copy link
Contributor Author

sbaier1 commented May 2, 2022

Mind if I tweet that out?

fine with me, 👍 go ahead

I think it might be off by a frame

oops, yeah i messed up my ffmpeg commands, here:

dazzled_cut.mp4

@dmarx
Copy link
Member

dmarx commented May 2, 2022

sweet, glad there wasn't more synch stuff in pytti for the moment :p

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

Successfully merging a pull request may close this issue.

2 participants