< Home

sixteenmillimeter.com

free and open-source tools for analog filmmaking

soundtrack.optical

Download library

Library for generating 16mm optical soundtracks with Processing.

Install library by downloading library as .zip, uncompressing and placing SoundtrackOptical in your Processing library directory. Note: When extracting the .zip, the folder may be named "SoundtrackOptical-master" and should be renamed "SoundtrackOptical" before installing. Start up (or restart) Processing to use this library in a sketch.

Supports mono audio only (at the moment, feel free to contribute).

Draws various kinds of 16mm soundtracks. Read about them here..

Example Usage

import processing.sound.*;
import soundtrack.optical.*;

SoundtrackOptical soundtrack;

String soundtrackFile = "../../data/barking.wav";
int dpi = 2400;
float volume = 1.0;
String type = "dual variable area";
String pitch = "long";
boolean positive = true;

void setup() {
  size(213, 620, P2D);
  frameRate(24);
  soundtrack = new SoundtrackOptical(this, soundtrackFile, dpi, volume, type, pitch, positive);
}

void draw () {
  soundtrack.draw(0, 0);
}

Alternate usage

Use the frame(int x, int y, int frameNumber) method to draw specific frames--used for laying out multiple frames of soundtrack on a single screen.

void draw () {
    soundtrack.frame(0, 0, frameCount);
}