From 48c8ac474f37af00a92cd887700b83a7ef34fd45 Mon Sep 17 00:00:00 2001 From: AShiningRay Date: Sat, 7 Dec 2024 18:42:23 -0300 Subject: [PATCH] Manager: Use square wave as playTone()'s player instrument. This makes sure all tone formats are consistent instrument-wise. --- src/javax/microedition/media/Manager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/javax/microedition/media/Manager.java b/src/javax/microedition/media/Manager.java index 8c242005..d270edbf 100644 --- a/src/javax/microedition/media/Manager.java +++ b/src/javax/microedition/media/Manager.java @@ -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.