Oh that last snippet is wrong, it should be: sample = audioTable.table[audioTable.phase[0] += leftPhase]; sample = audioTable.table[audioTable.phase[1] += rightPhase]; :)