diff --git a/examples/BasicOptical/BasicOptical.pde b/examples/BasicOptical/BasicOptical.pde index a5cd4f4..41e7cdf 100755 --- a/examples/BasicOptical/BasicOptical.pde +++ b/examples/BasicOptical/BasicOptical.pde @@ -11,9 +11,10 @@ String pitch = "long"; //whether the film is "long" or "sh boolean positive = true; //whether the film is positive or negative void setup() { - size(213, 620); //this will perfectly fill the frame with the soundtrack @ 2400DPI + size(213, 620, P2D); //this will perfectly fill the frame with the soundtrack @ 2400DPI + //must run in P2D or P2D (acheives realtime playback easier) - frameRate(24); //this will playback at realtime speed + frameRate(24); //this will playback at realtime speed soundtrack = new SoundtrackOptical(this, soundtrackFile, dpi, volume, type, pitch, positive); } diff --git a/examples/OpticalWithPlayback/OpticalWithPlayback.pde b/examples/OpticalWithPlayback/OpticalWithPlayback.pde index 9ad525c..ef9840a 100644 --- a/examples/OpticalWithPlayback/OpticalWithPlayback.pde +++ b/examples/OpticalWithPlayback/OpticalWithPlayback.pde @@ -12,12 +12,12 @@ String pitch = "long"; boolean positive = true; void setup() { - size(213, 620); + size(213, 620, P2D); frameRate(24); soundtrack = new SoundtrackOptical(this, soundtrackFile, dpi, volume, type, pitch, positive); playback = new SoundFile(this, soundtrackFile); - playback.play(); + playback.play(); //playback alongside image } void draw () { diff --git a/library/SoundtrackOptical.jar b/library/SoundtrackOptical.jar index 94d9b24..0230963 100644 Binary files a/library/SoundtrackOptical.jar and b/library/SoundtrackOptical.jar differ diff --git a/src/soundtrack/optical/SoundtrackOptical.java b/src/soundtrack/optical/SoundtrackOptical.java index 6214dbd..e2ffa61 100755 --- a/src/soundtrack/optical/SoundtrackOptical.java +++ b/src/soundtrack/optical/SoundtrackOptical.java @@ -63,7 +63,7 @@ public class SoundtrackOptical { FRAMES = (int) Math.ceil(soundfile.frames() / RAW_FRAME_H); frameSample = new float[RAW_FRAME_H]; - raw = parent.createGraphics(RAW_FRAME_W, RAW_FRAME_H); + raw = parent.createGraphics(RAW_FRAME_W, RAW_FRAME_H, parent.P2D); for (int x = 0; x < soundfile.frames(); x++) {