olear / audio2ascii

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

audio2ascii

frame

screenshot-2

Natron2.0 python plugin to animate you parameters with waveform from an audio file(mp3, wav,aiff,...). It can do a basic preview audio while viewer playing, this can be usefull until a sound support in future Natron versions (>2.0).

An external app can be set and launch from the plugin to edit audio file (e.g. audacity..)

The plugin use AudioCurve written by @olear on Linux and Windows, and a bash script(audio2ascii.sh) on MacOSX.

sox is use to convert audio.
ffplay(from ffmpeg) to play the preview (only for OSX and Linux for now).

Here is a Demo/tuto.

Other videos in the examples section below.

For Windows users, a multiplatform Qt version of the bash script are currently being developed by olear

#Installation / Usage

  • Linux
$ wget https://github.com/rcspam/audio2ascii/releases/download/v2.0/v2.0-linux64.tar.gz
$ tar xvzf audio2ascii-2.0.tar.gz
$ cd audio2ascii-2.0beta
$ ./install_Unix.sh
  • MacOSX

    Download last version. Decompress it where you want and launch 'install_Unix.sh' from the decompress directory in a terminal, or open archive and copy all files in '/Users/<username>/Library/Application Support/INRIA/Natron/Plugins'.

  • Windows

    Download last version. Open archive and copy all files in 'C:\Users\<username>\Local Settings\Application Data\INRIA\Natron\Plugins'

Install some extras (Optional)

  • If you want add a menu command to the Natron menu-bar, add the following lines in the init.py of your home Natron plugin directory (create it if doesn't exist):
# Linux
import os
def audioToAscii():
    os.system("$HOME/.local/share/INRIA/Natron/Plugins/audio2ascii.sh -g &")
NatronGui.natron.addMenuCommand("Ext-Tools/AudioToAscii","audioToAscii",QtCore.Qt.Key.Key_L,QtCore.Qt.KeyboardModifier.ShiftModifier)
# OSX
import os
def audioToAscii():
    os.system("$HOME/Library/Application\ Support/INRIA/Natron/Plugins/audio2ascii.sh -g &")
NatronGui.natron.addMenuCommand("Ext-Tools/AudioToAscii","audioToAscii",QtCore.Qt.Key.Key_L,QtCore.Qt.KeyboardModifier.ShiftModifier)
  • Linux users can run audio2ascii.sh as standalone to create ascii curves (yad must be installed)
$ your/path/to/audio2ascii.sh -g

#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)
  • Tuto/Demo (animate a rotopaint point on music)

#Requirements

  • sox:

    • Debian/Ubuntu: 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

    • Mac OSX: sudo port install sox (After have installed Xcode and Command Line Tools)

    • No needed for Widows users

  • ffmpeg:

    • Debian/Ubuntu: sudo apt-get install ffmpeg or sudo yum install ffmpeg

    • Mac OSX: sudo port install ffmpeg

  • gawk (Mac OSX users only, awk doesn't support floats):

    • sudo port install gawk
  • yad (optional, stand alone GUI on Linux):

    • Debian/Ubuntu: sudo apt-get install yad

    • Fedora:sudo yum install yad

About

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

License:GNU General Public License v2.0


Languages

Language:Python 71.1%Language:Shell 28.9%