StereoType: The coding part


This post will be an update on how the coding part functions for my interactive sound project – Stereo Type.

The coding and everything is being done is processing at the moment. So far its entirely focused around sound and the playback of sound but as soon as sound part is dealt with I will put my entire focus on the visualisation part.

The point that I arrived with the sound coding is actually quite promising. The Minim library that’s actually integrated with the Processing is very helpful. The function of pressing a key and hearing a pre-recorded sound brought me the idea of a piano application. Since the action is essentially: you press a key and you hear a sound. I’ve found some piano applications that were created in Processing and I’ve found the open sources. That way I had an idea how to go from there.

With the help of this “approximation” I managed to code everything to maintain a successful playback for all the sound recordings I’ve made so far.

I will provide the information through screenshots and pasting the codes in the forum from now on to underline which code is representing which function.







So far this is the entire code in processing window:

import ddf.minim.*;
Minim minim;

AudioPlayer playerA;
AudioPlayer playerB;
AudioPlayer playerC;
AudioPlayer playerD;
AudioPlayer playerE;
AudioPlayer playerF;
AudioPlayer playerG;
AudioPlayer playerH;
AudioPlayer playerI;
AudioPlayer playerJ;
AudioPlayer playerK;
AudioPlayer playerL;
AudioPlayer playerM;
AudioPlayer playerN;
AudioPlayer playerO;
AudioPlayer playerP;
AudioPlayer playerQ;
AudioPlayer playerR;
AudioPlayer playerS;
AudioPlayer playerT;
AudioPlayer playerU;
AudioPlayer playerV;
AudioPlayer playerW;
AudioPlayer playerX;
AudioPlayer playerY;
AudioPlayer playerZ;

void setup() {

minim = new Minim(this);
playerA = minim.loadFile(“a.wav”);
playerB = minim.loadFile(“b.wav”);
playerC = minim.loadFile(“c.wav”);
playerD = minim.loadFile(“d.wav”);
playerE = minim.loadFile(“e.wav”);
playerF = minim.loadFile(“f.wav”);
playerG = minim.loadFile(“g.wav”);
playerH = minim.loadFile(“h.wav”);
playerI = minim.loadFile(“i.wav”);
playerJ = minim.loadFile(“j.wav”);
playerK = minim.loadFile(“k.wav”);
playerL = minim.loadFile(“l.wav”);
playerM = minim.loadFile(“m.wav”);
playerN = minim.loadFile(“n.wav”);
playerO = minim.loadFile(“o.wav”);
playerP = minim.loadFile(“p.wav”);
playerQ = minim.loadFile(“q.wav”);
playerR = minim.loadFile(“r.wav”);
playerS = minim.loadFile(“s.wav”);
playerT = minim.loadFile(“t.wav”);
playerU = minim.loadFile(“u.wav”);
playerV = minim.loadFile(“v.wav”);
playerW = minim.loadFile(“w.wav”);
playerX = minim.loadFile(“x.wav”);
playerY = minim.loadFile(“y.wav”);
playerZ = minim.loadFile(“z.wav”);

void draw(){

if (keyPressed) {
if (key == ‘a’ || key == ‘A’)
if (key == ‘b’ || key == ‘B’)
if (key == ‘c’ || key == ‘C’)
if (key == ‘d’ || key == ‘D’)
if (key == ‘e’ || key == ‘E’)
if (key == ‘f’ || key == ‘F’)
if (key == ‘g’ || key == ‘G’)
if (key == ‘h’ || key == ‘H’)
if (key == ‘i’ || key == ‘I’)
if (key == ‘j’ || key == ‘J’)
if (key == ‘k’ || key == ‘K’)
if (key == ‘l’ || key == ‘L’)
if (key == ‘m’ || key == ‘M’)
if (key == ‘n’ || key == ‘N’)
if (key == ‘o’ || key == ‘O’)
if (key == ‘p’ || key == ‘P’)
if (key == ‘q’ || key == ‘Q’)
if (key == ‘r’ || key == ‘R’)
if (key == ‘s’ || key == ‘S’)
if (key == ‘t’ || key == ‘T’)
if (key == ‘u’ || key == ‘U’)
if (key == ‘v’ || key == ‘V’)
if (key == ‘w’ || key == ‘W’)
if (key == ‘x’ || key == ‘X’)
if (key == ‘y’ || key == ‘Y’)
if (key == ‘z’ || key == ‘Z’)

This code as a whole is working without problems. One thing I was worried was to load 26 players and if Processing would allow me to do so. But it did. There’s no problems with the playback and the sounds can play on top of each other without interrupting one another. Minim is great afterall 🙂

Next update will include more finished sounds and coding of the visual parts.

What to do:


-I’m thinking of doing an animation for each letter to sort of have a karaoke sort of effect – where the playbacked letter will be highlighted as the sound plays to show which sounds represent which letter.

-I also want to show what people have typed so far. This will make it easier for them to track their input and output better.

-Hopefully, if I can finish in time, I want to upload the entire thing on the web so I can share this with more people and receive feedbacks for my work. Maybe even implement this in my portfolio website: ahmetalperworks so I can promote everything together. Too much greed? Maybe 🙂

Until then.


Leave a Reply