Skip to content

Commit

Permalink
fixes suggested by frostburn
Browse files Browse the repository at this point in the history
  • Loading branch information
000masa000 committed Apr 15, 2024
1 parent 46d5652 commit 655f24b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
7 changes: 5 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ function sendNoteOn(frequency: number, rawAttack: number) {
}
function midiNoteOn(index: number, rawAttack?: number, channel?: number) {
// in multichannel-to-equave mode calculate an offset based on the incoming channel
if (midi.multichannelToEquave && channel !== undefined) {
let offset = mmod(channel - midi.multichannelCenter + midi.multichannelEquavesDown, midi.multichannelNumEquaves) - midi.multichannelEquavesDown
let offset =
mmod(
channel - midi.multichannelCenter + midi.multichannelEquavesDown,
midi.multichannelNumEquaves
) - midi.multichannelEquavesDown
offset = offset * scale.scale.size
index = index + offset
}
Expand Down
2 changes: 1 addition & 1 deletion src/stores/midi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useMidiStore = defineStore('midi', () => {
// State
input,
output,
outputChannels,
outputChannels,
multichannelToEquave,
multichannelCenter,
multichannelNumEquaves,
Expand Down
2 changes: 1 addition & 1 deletion src/views/AboutView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const tagline = computed(() => TAGLINES[Math.floor(Math.random() * TAGLINES.leng
Forrest Cahoon - <i>developer</i> <br />
Videco - <i>developer</i> <br />
Inthar - <i>developer</i> <br />
Marc Sabat - <i>composer / developer</i> <br />
Marc Sabat - <i>developer / notation-hardware advisor</i> <br />
Kraig Grady - <i>lattice advisor</i> <br />
Abnormality - <i>quality assurance</i> <br />
Kite Giedraitis - <i>notation advisor</i> <br />
Expand Down
44 changes: 37 additions & 7 deletions src/views/MidiView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ onUnmounted(() => {
/>
</span>
</div>
<div class="control checkbox-group-scoped">
<div class="control checkbox-group">
<span>
<input type="checkbox" id="midi-velocity" v-model="midi.velocityOn" />
<label for="midi-velocity"> Use velocity </label>
Expand All @@ -189,12 +189,42 @@ onUnmounted(() => {
</span>
</div>
<label>Settings for multichannel-to-equave mode</label>
<div class="control multichannel-input-scoped">
<span> Center channel <input id="multichannel-center" class="control" type="number" min="1" max="16" value="3" v-model="midi.multichannelCenter" />
<div class="control multichannel-input">
<span>
Center channel
<input
id="multichannel-center"
class="control"
type="number"
min="1"
max="16"
value="3"
v-model="midi.multichannelCenter"
/>
</span>
<span> Total equaves <input id="multichannel-num-equaves" class="control" type="number" min="1" max="16" value="8" v-model="midi.multichannelNumEquaves" />
<span>
Total equaves
<input
id="multichannel-num-equaves"
class="control"
type="number"
min="1"
max="16"
value="8"
v-model="midi.multichannelNumEquaves"
/>
</span>
<span> Equaves down <input id="multichannel-equaves-down" class="control" type="number" min="0" max="15" value="4" v-model="midi.multichannelEquavesDown" />
<span>
Equaves down
<input
id="multichannel-equaves-down"
class="control"
type="number"
min="0"
max="15"
value="4"
v-model="midi.multichannelEquavesDown"
/>
</span>
</div>
<div class="control radio-group">
Expand Down Expand Up @@ -303,12 +333,12 @@ div.channels-wrapper span {
text-align: center;
}
div.checkbox-group-scoped {
div.checkbox-group {
flex-flow: unset;
gap: 0.15rem 1rem;
}
div.multichannel-input-scoped {
div.multichannel-input {
gap: 0.15rem 1rem;
}
Expand Down

0 comments on commit 655f24b

Please sign in to comment.