import processing.serial.*; import processing.sound.*; SoundFile[] soundfile = {null,null,null,null,null,null}; Serial myPort; String dataIn = ""; int linefeed = 10; int currentLang = 0; String[] langs = {"NONE","Italian","English","Spanish","German","French"}; void setup() { size(600, 400); myPort = new Serial(this, "/dev/ttyUSB0", 9600); for(int i=0; i 0) { dataIn = myPort.readStringUntil(linefeed); if (dataIn != null) { String[] split = dataIn.split("\t"); currentLang = parseInt(trim(split[1])); for(int i=0; i "+currentLang); } } }