mirror of https://github.com/nealey/vail.git
Adapter: actually change pitches
This commit is contained in:
parent
1c8ab50f0a
commit
f8b5cf22af
|
@ -269,29 +269,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">
|
||||
<span data-i18n="label.gain">noise</span>:
|
||||
<output for="noiseGain"></output>%
|
||||
<i class="mdi mdi-volume-off muted"></i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input
|
||||
id="noiseGain"
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="0"
|
||||
step="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">
|
||||
|
@ -361,6 +338,29 @@
|
|||
</label>
|
||||
</p>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">
|
||||
<span data-i18n="label.gain">noise</span>:
|
||||
<output for="noiseGain"></output>%
|
||||
<i class="mdi mdi-volume-off muted"></i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input
|
||||
id="noiseGain"
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="0"
|
||||
step="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -137,6 +137,9 @@ export class MIDI extends Input{
|
|||
this.midiStateChange()
|
||||
}
|
||||
|
||||
// If you're looking for the thing that sets the tx tone,
|
||||
// that's in outputs.mjs:SetMIDINote
|
||||
|
||||
sendState() {
|
||||
for (let output of this.midiAccess.outputs.values()) {
|
||||
// Turn off keyboard mode
|
||||
|
|
|
@ -44,23 +44,26 @@ class Noise extends AudioSource {
|
|||
modulatorGain: new GainNode(context),
|
||||
filter: WhiteNoise(context),
|
||||
filterGain: new GainNode(context),
|
||||
filterGainModulator: new OscillatorNode(context),
|
||||
filterGainModulatorGain: new GainNode(context),
|
||||
}
|
||||
|
||||
wn.modulator.frequency.value = 0
|
||||
wn.modulatorGain.gain.value = 0
|
||||
wn.filter.frequency.value = 800
|
||||
wn.filterGain.gain.value = 0.8 / noises
|
||||
wn.filterGainModulator.frequency.value = 1
|
||||
wn.filterGainModulatorGain.gain.value = 1
|
||||
|
||||
wn.modulator.connect(wn.modulatorGain)
|
||||
wn.modulatorGain.connect(wn.filter.frequency)
|
||||
wn.filter.connect(wn.filterGain)
|
||||
wn.filterGain.connect(this.masterGain)
|
||||
wn.filter.connect(this.masterGain)
|
||||
|
||||
wn.modulator.start()
|
||||
this.whiteNoise.push(wn)
|
||||
}
|
||||
|
||||
this.SetNoiseParams(0, 0.07, 70, 400, 0.4)
|
||||
this.SetNoiseParams(0, 0.07, 70, 400, 0.0)
|
||||
this.SetNoiseParams(1, 0.03, 200, 1600, 0.4)
|
||||
this.masterGain.gain.value = 0.5
|
||||
}
|
||||
|
|
|
@ -423,7 +423,6 @@ class MIDIBuzzer extends Buzzer {
|
|||
if (tx) {
|
||||
return
|
||||
}
|
||||
|
||||
this.sendAt(when, [0x90, this.note, 0x7f])
|
||||
}
|
||||
|
||||
|
@ -443,10 +442,11 @@ class MIDIBuzzer extends Buzzer {
|
|||
*/
|
||||
SetMIDINote(tx, note) {
|
||||
if (tx) {
|
||||
return
|
||||
}
|
||||
this.sendAt(0, [0xB0, 0x02, note])
|
||||
} else {
|
||||
this.note = note
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Collection extends AudioSource {
|
||||
|
|
|
@ -106,7 +106,10 @@ class VailClient {
|
|||
}
|
||||
this.inputInit(
|
||||
"#rx-tone",
|
||||
e => this.outputs.SetMIDINote(false, e.target.value),
|
||||
e => {
|
||||
this.noise.SetNoiseFrequency(1, Music.MIDINoteFrequency(e.target.value))
|
||||
this.outputs.SetMIDINote(false, e.target.value)
|
||||
},
|
||||
toneTransform,
|
||||
)
|
||||
this.inputInit(
|
||||
|
|
Loading…
Reference in New Issue