Skip to content

Convert an audio file to an ascii file read by Natron/Nuke (based on sox)

License

Notifications You must be signed in to change notification settings

rcspam/audio2ascii

Repository files navigation

audio2ascii

Natron2.0 python plugin to animate you parameters with waveform from an audio file(mp3, wav,aiff,...). It use a bash script that you must have in your $PATH. (This is a Linux version, but it can be easily adapted for OSX or other Unix-like). Here is a Demo/tuto

frame

screenshot-2

A multiplatform Qt version of the bash script are currently being developed by olear

#Requirements

  • Sox: sudo apt-get install sox or sudo yum install sox.

    For support more audio formats than 'wav': sudo apt-get install libsox-fmt-all (debian).

    Fedora: for mp3 support for sox you can read this

  • Yad: If you want a gui: sudo apt-get install yad ; sudo yum install yad

#Installation / Usage

$ wget https://github.com/rcspam/audio2ascii/archive/v1.8.tar.gz
$ tar xvzf audio2ascii-1.8.tar.gz
$ cd audio2ascii-1.8
$ cp ./audio2ascii.sh /somewhere/in/your/path  # must be in your $PATH

If you want start audio2ascii from Natron, you should run it with its gui (yad must be installed). To install the plugin AudioToAscii.py and its icon:

$ # create the local Plugins directory if it doesn't exist
$ mkdir $HOME/.local/share/INRIA/Natron/Plugins
$ cp ./AudioToAscii.*  $HOME/.local/share/INRIA/Natron/Plugins

If you want just add a menu command to the application’s menu-bar, add the following lines in your $HOME/.local/share/INRIA/Natron/Plugins/init.py (create init.py if doesn't exist):

import os
def audioToAscii():
    os.system("audio2ascii.sh -g &")
NatronGui.natron.addMenuCommand("Ext-Tools/AudioToAscii","audioToAscii",QtCore.Qt.Key.Key_L,QtCore.Qt.KeyboardModifier.ShiftModifier)

#Examples

Some short videos released with the Natron 2 Snapshot Transform Node:

  • Test1.mp4 ( x curve on scale)
  • Test2.mp4 ( xy curves (stereo) with x translate on left channel, y translate on right channel )
  • Test3.mp4 (y curve on y translate)