Library for generating optical soundtracks with Processing.
Go to file
Matt McWilliams dc9a5bd4d9 Add image for new website 2025-02-28 13:35:33 -05:00
.settings Create eclipse project for building jar of library. IDE is showing lots of errors. Will have to modify core functionality. 2019-10-29 00:15:19 -04:00
data Add two audio files to use with examples 2019-10-29 01:20:06 -04:00
examples Add a new `buffer()` method that returns the PGraphics object of a specific frame. This is needed for a new project that remains a secret. 2020-01-22 12:29:53 -05:00
img Add image for new website 2025-02-28 13:35:33 -05:00
library Add a new `buffer()` method that returns the PGraphics object of a specific frame. This is needed for a new project that remains a secret. 2020-01-22 12:29:53 -05:00
src/soundtrack/optical Add a new `buffer()` method that returns the PGraphics object of a specific frame. This is needed for a new project that remains a secret. 2020-01-22 12:29:53 -05:00
.classpath Build project to git repo 2019-10-29 01:19:54 -04:00
.gitignore Ignore DS_Store 2020-01-05 11:39:03 -05:00
.project Build project to git repo 2019-10-29 01:19:54 -04:00
LICENSE Add last name 2019-10-29 00:12:06 -04:00
README.md Add image for new website 2025-02-28 13:35:33 -05:00
library.properties Use parent renderer 2019-11-10 12:27:21 -05:00

README.md

soundtrack.optical

Illustration of all soundtrack formats displaying the same samples

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..

  • unilateral
  • dual unilateral (in progress!)
  • single variable area
  • dual variable area
  • multiple variable area (Maurer)
  • variable density

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 usages

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);
}

Use the buffer(int frameNumber) method to return the internal PGraphics object that contains the specific frame of soundtrack data specified by the frameNumber. You can then draw onto the canvas, address the pixels directly, or as in the provided BufferExample.pde assign the image data to a PImage to be manipulated using the built-in transformation methods.

void draw () {
	PGraphics soundtrackBuffer = soundtrack.buffer(frameCount);
	image(soundtrackBuffer, 0, 0);
}