Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
playNote, stopNote and isNotePlaying implementations for the Piano tutorial
public void playNote(int note) {
if (!isNotePlaying(note)) {
PlayThread thread = new PlayThread(note);
threadMap.put(note, thread);
public void stopNote(int note) {
PlayThread thread = threadMap.get(note);
if (thread != null) {
public boolean isNotePlaying(int note) {
return threadMap.get(note) != null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.