How to playback piano chords with an android?

412 Views Asked by At

I am looking for a way to play chords (4 notes together), threw audiotrack.

What is the best way to do this? I consider about starting from a single sampled note, applying pitch filters to it. Is there a simpler solution for doing this?

thanks

2

There are 2 best solutions below

0
On

A simpler way is to have an audio file for each note.

To play them at the same you will need to sum the signals of all the files. A java virtual machine is not the best environment to do this, take a look at the ByteBuffer API if you want to do it this way.

0
On

You can also use audiotrack objects in 4 different threads, so the write methode of AudioTrack won't block the other audiotracks playing sounds, I do this with 5 threads and it works.