Cleaner AllSoundtracks example.

This commit is contained in:
litter 2019-10-29 11:57:41 -04:00
parent 5552589502
commit aaf65c3a9b
1 changed files with 11 additions and 19 deletions

View File

@ -1,37 +1,29 @@
import processing.sound.*;
import soundtrack.optical.*;
SoundtrackOptical soundtrack1;
SoundtrackOptical soundtrack2;
SoundtrackOptical soundtrack3;
SoundtrackOptical soundtrack4;
SoundtrackOptical soundtrack5;
SoundtrackOptical[] soundtracks = {null, null, null, null, null };
String[] types = { "unilateral", "variable area", "dual variable area", "maurer", "variable density" };
//String soundtrackFile = "../../data/barking.wav";
String soundtrackFile = "/Users/matthewmcwilliams9/Documents/Processing/optical_soundtrack/barking.wav";
String soundtrackFile = "../../data/barking.wav";
int dpi = 2400;
float volume = 1.0;
String pitch = "long";
boolean positive = true;
void setup() {
size(1065, 620);
soundtrack1 = new SoundtrackOptical(this, soundtrackFile, dpi, volume, "unilateral", pitch, positive);
soundtrack2 = new SoundtrackOptical(this, soundtrackFile, dpi, volume, "variable area", pitch, positive);
soundtrack3 = new SoundtrackOptical(this, soundtrackFile, dpi, volume, "dual variable area", pitch, positive);
soundtrack4 = new SoundtrackOptical(this, soundtrackFile, dpi, volume, "maurer", pitch, positive);
soundtrack5 = new SoundtrackOptical(this, soundtrackFile, dpi, volume, "variable density", pitch, positive);
size(1065, 620, P2D);
for (int i = 0; i < types.length; i++) {
soundtracks[i] = new SoundtrackOptical(this, soundtrackFile, dpi, volume, types[i], pitch, positive);
}
}
void draw () {
soundtrack1.frame(0, 0);
soundtrack2.frame(213, 0);
soundtrack3.frame(213 * 2, 0);
soundtrack4.frame(213 * 3, 0);
soundtrack5.frame(213 * 4, 0);
for (int i = 0; i < types.length; i++) {
soundtracks[i].frame(i * 213, 0);
}
stroke(255, 0, 0);
for (int i = 1; i < 5; i++) {
for (int i = 1; i < types.length; i++) {
line(213 * i, 0, 213 * i, height);
}
}