mardi 27 janvier 2015

Java - play polyphonic tones

I have a question concerning Audio Programming. So in Java I have a number of Byte Arrays which contain the same number of values, these are my audio samples (for example this are the samples of sine waves, but with different frequencies).


Now I want to play all these samples using a SourceDataLine (similar to this example: http://ift.tt/1yYHElM) like a polyphonic synthesizer does when more than one key is pressed.


Which data do I have to give to the SourceDataLine now? Is this just the sum of all values in the byte arrays? So do I have to decrease the amplitude of these waves if the bit size is 2bit and the sum of all waves would need a higher one?


Aucun commentaire:

Enregistrer un commentaire