Skip to content

Commit e260db4

Browse files
authored
Implement the poly/mono button (#196)
1 parent d44e57f commit e260db4

File tree

12 files changed

+123
-20
lines changed

12 files changed

+123
-20
lines changed

package-lock.json

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/website/css/synthesizer_ui/synthesizer_ui.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,16 @@
108108
min-width: var(--voice-meter-height);
109109
}
110110

111+
.mute_button pre {
112+
font-size: 1.5rem;
113+
font-weight: bold;
114+
}
115+
111116
.mute_button_light * {
112117
color: black;
113118
}
114119

115-
.mute_button svg {
120+
.mute_button > * {
116121
transition: transform 0.2s ease;
117122
}
118123

@@ -125,7 +130,7 @@
125130
cursor: pointer;
126131
}
127132

128-
.mute_button:hover svg {
133+
.mute_button:hover > * {
129134
transform: scale(1.1) rotate(5deg);
130135
}
131136

src/website/js/locale/locale_files/locale_en/synthesizer_controller/channel_controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,9 @@ export const channelControllerLocale = {
123123

124124
drumToggleButton: {
125125
description: "Toggle drums on channel {0}"
126+
},
127+
128+
polyMonoButton: {
129+
description: `Toggle poly/mono mode on channel {0}`
126130
}
127131
};

src/website/js/locale/locale_files/locale_pl/synthesizer_controller/channel_controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,9 @@ export const channelControllerLocale = {
121121

122122
drumToggleButton: {
123123
description: "Przełącz perkusję na kanale {0}"
124+
},
125+
126+
polyMonoButton: {
127+
description: `Przełącz tryb poly/mono na kanale {0}`
124128
}
125129
};

src/website/js/manager/export_audio/export_audio.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export async function renderAndExportAudioData(
9898
separateChannels,
9999
loopCount,
100100
preserveSynthParams: true,
101+
sequencerID: 0,
101102
enableEffects: !separateChannels,
102103
progressCallback: (progress, stage) => {
103104
if (stage === 0) {

src/website/js/manager/export_audio/export_dls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export function _exportDLS(this: Manager) {
119119
bankID: this.soundBankID,
120120
trim: trimmed,
121121
writeEmbeddedSoundBank: true,
122+
sequencerID: 0,
122123
progressFunction: (p) => {
123124
const progress = p.sampleIndex / p.sampleCount;
124125
progressDiv.style.width = `${progress * 100}%`;

src/website/js/manager/export_audio/export_rmidi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ export function _exportRMIDI(this: Manager) {
279279
trim: true,
280280
writeEmbeddedSoundBank: true,
281281
format: "sf2",
282+
sequencerID: 0,
282283
decompress: false,
283284
writeDefaultModulators: true,
284285
writeExtendedLimits: true,

src/website/js/manager/export_audio/export_soundfont.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export function exportAndSaveSF2(this: Manager) {
147147
const progress = p.sampleIndex / p.sampleCount;
148148
progressDiv.style.width = `${progress * 100}%`;
149149
detailMessage.textContent = `${exportingMessage} ${Math.floor(progress * 100)}%`;
150-
}
150+
},
151+
sequencerID: 0
151152
}
152153
);
153154
this.seq?.play();

src/website/js/manager/manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ export class Manager {
206206
const sf = await writeDLS.call(this, {
207207
trim: false,
208208
bankID: "main",
209-
writeEmbeddedSoundBank: false
209+
writeEmbeddedSoundBank: false,
210+
sequencerID: 0
210211
});
211212
this.saveBlob(new Blob([sf.binary]), sf.fileName);
212213
}

src/website/js/sequencer_ui/sequencer_ui.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ export class SequencerUI {
708708
// Media session
709709
this.silencePlayer = new Audio();
710710
// Default
711-
this.silencePlayer.loop = true;
711+
this.silencePlayer.loop = false;
712712
if (navigator.mediaSession) {
713713
// Silent audio element for media session to show up
714714

@@ -828,11 +828,9 @@ export class SequencerUI {
828828
if (loop) {
829829
this.seq.loopCount = Infinity;
830830
this.enableIcon(this.loopButton);
831-
this.silencePlayer.loop = true;
832831
} else {
833832
this.seq.loopCount = 0;
834833
this.disableIcon(this.loopButton);
835-
this.silencePlayer.loop = false;
836834
}
837835
}
838836

@@ -924,7 +922,8 @@ export class SequencerUI {
924922
this.seq.playbackRate = this.silencePlayer.playbackRate;
925923
}
926924
if (this.silencePlayer.loop != this.seq.loopCount > 0) {
927-
this.setLoopState(this.silencePlayer.loop);
925+
// Causes issues by looping the audio, triggering a user seek too early
926+
this.silencePlayer.loop = false;
928927
}
929928
}
930929

0 commit comments

Comments
 (0)