Skip to content

Commit

Permalink
Manager: Use square wave as playTone()'s player instrument.
Browse files Browse the repository at this point in the history
This makes sure all tone formats are consistent instrument-wise.
  • Loading branch information
AShiningRay committed Dec 7, 2024
1 parent e5f85f9 commit 48c8ac4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/javax/microedition/media/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static void playTone(int note, int duration, int volume) throws MediaExce
catch (MidiUnavailableException e) { Mobile.log(Mobile.LOG_ERROR, Manager.class.getPackage().getName() + "." + Manager.class.getSimpleName() + ": " + "Couldn't open Tone Player: " + e.getMessage()); return;}
}

dedicatedToneChannel.programChange(80); // Set it to use the square wave instrument, just so all tones formats are using the same
/*
* There's no need to calculate the note frequency as per the MIDP Manager docs,
* they are pretty much the note numbers used by Java's Built-in MIDI library.
Expand Down

0 comments on commit 48c8ac4

Please sign in to comment.