Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps can be increamented with - Semitone, Tone, Octave. According to choice of user #822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ul.btn-group {
display: flex;
flex-flow: row wrap;
align-items: stretch;
gap: 0.15rem;
gap: 0.15rem 0.15rem;
}
.control-group h2 {
margin-bottom: unset;
Expand Down
23 changes: 18 additions & 5 deletions src/components/ScaleControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { ref } from 'vue'
import ScaleRule from './ScaleRule.vue'
import palette from '@/character-palette.json'

const stepx = ref("1")

const scale = useScaleStore()

const updateScale = debounce(scale.computeScale)
Expand Down Expand Up @@ -53,13 +55,24 @@ defineExpose({ focus, clearPaletteInfo })
<input
id="base-midi-note"
type="number"
step="1"
:step="stepx"
v-model="scale.baseMidiNote"
@input="updateScale()"
/>
<span class="midi-name">{{
midiNoteNumberToName(scale.baseMidiNote, -1, scale.accidentalPreference)
}}</span>
midiNoteNumberToName(scale.baseMidiNote, -1, scale.accidentalPreference)
}}</span>

<span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while since I've programmed Vue, but it's something along the lines of adding the new preference, const state = useStateStore() and replacing this line with: <span v-if="state.showMidiStepVariants">.

<label for="select-step">Step : </label>
<select id = "select-step" v-model="stepx">
<option value = "1">Semitone</option>
<option value = "2">Tone </option>
<option value = "12">Octave</option>
</select>

</span>

</div>

<div class="control">
Expand Down Expand Up @@ -165,8 +178,8 @@ defineExpose({ focus, clearPaletteInfo })
<style scoped>
.midi-name {
width: 1em;
margin-left: 0.4em;
margin-right: 0.4em;
margin-left: 0.5em;
margin-right: 1em;
}
.info {
height: 3em;
Expand Down
Loading