|
@@ -20,6 +20,9 @@ export class BasicAudioPlayer implements IAudioPlayer<SoundfontPlayer.Player> {
|
|
|
protected channelToSoundFont: Map<number, number> = new Map();
|
|
|
|
|
|
public SoundfontInstrumentOptions = {}; // e.g. set { from: 'server.com/soundfonts/' } for soundfont fetching url
|
|
|
+ /** Multiplicator for gain (volume output). 1 represents the maximum volume in OSMD (100%),
|
|
|
+ * but it looks like soundfont-player is louder with volumes > 1, e.g. 3 */
|
|
|
+ public GainMultiplier: number = 1;
|
|
|
|
|
|
public async open(uniqueInstruments: number[], numberOfinstruments: number = 16): Promise<void> {
|
|
|
if (this.piano === undefined) {
|
|
@@ -61,7 +64,7 @@ export class BasicAudioPlayer implements IAudioPlayer<SoundfontPlayer.Player> {
|
|
|
this.channelToSoundFont.get(instrumentChannel)
|
|
|
);
|
|
|
soundFont.schedule(0, [
|
|
|
- { note: key, duration: lengthInMs / 1000, gain: sampleVolume },
|
|
|
+ { note: key, duration: lengthInMs / 1000, gain: sampleVolume * this.GainMultiplier },
|
|
|
]);
|
|
|
}
|
|
|
|