Skip to content

Commit

Permalink
Merge pull request #20 from harmendv/feature/tunings
Browse files Browse the repository at this point in the history
Feature/tunings
  • Loading branch information
harmendv authored Feb 14, 2024
2 parents 12e49cb + 5cd3ae0 commit b63c3a3
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
</lv-flex>

<vue-fretboard
:strings="strings"
:strings="JSON.parse(tuning)"
:highlight="highlight"
:frets="frets"
:frets="20"
:chord-tone-root="chordToneRoot"
:show-degrees="noteNames === 'degrees'"
:root="note"
Expand Down Expand Up @@ -127,14 +127,12 @@
:width="4"
:md="12"
>
<lv-fieldset :legend="`Number of frets (${frets})`">
<lv-slider
:min="6"
:max="19"
:step="1"
v-model="frets"
realtime-update
></lv-slider>
<lv-fieldset legend="Tuning">
<lv-select
v-model="tuning"
:options="tuningOptions"
:clearable="false"
></lv-select>
</lv-fieldset>
</lv-grid-column>
</lv-grid-row>
Expand Down Expand Up @@ -211,12 +209,11 @@ export default {
return {
showFilters: false,
theme: this.preferredColorScheme(),
strings: ["E", "A", "D", "G", "B", "E"],
frets: Number.parseInt(params.frets, 10) || 14,
note: params.note || "C",
scale: params.scale || "major",
mode: Number.parseInt(params.mode, 10) || 1,
chord: Number.parseInt(params.chord, 10) || null,
tuning: params.tuning || JSON.stringify(["E", "A", "D", "G", "B", "E"]),
noteNames: params.noteNames || "degrees",
noteVisibility: params.noteVisibility || "only-scale",
noteNamesOptions: [
Expand All @@ -227,6 +224,18 @@ export default {
{ label: "All Notes", value: "all" },
{ label: "Only Scale Notes", value: "only-scale" },
],
tuningOptions: [
{ label: "Default", value: JSON.stringify(["E", "A", "D", "G", "B", "E"]) },
{ label: "Drop-C", value: JSON.stringify(["C", "G", "C", "F", "A", "D"]) },
{ label: "Drop-D", value: JSON.stringify(["D", "A", "D", "G", "B", "E"]) },
{ label: "Open C", value: JSON.stringify(["C", "G", "C", "G", "C", "E"]) },
{ label: "Open D", value: JSON.stringify(["D", "A", "D", "F♯", "A", "D"]) },
{ label: "Open E", value: JSON.stringify(["E", "B", "E", "G♯", "B", "E"]) },
{ label: "Open G", value: JSON.stringify(["D", "G", "D", "G", "B", "D"]) },
{ label: "DAD-GAD", value: JSON.stringify(["D", "A", "D", "G", "A", "D"]) },
{ label: "B standard", value: JSON.stringify(["B", "E", "A", "D", "F♯", "B"]) },
{ label: "Ukelele", value: JSON.stringify(["G", "C", "E", "A"]) },
],
};
},
mounted() {
Expand All @@ -245,9 +254,9 @@ export default {
params.note = value;
},
},
frets: {
tuning: {
handler(value) {
params.frets = value;
params.tuning = value;
},
},
noteNames: {
Expand Down

0 comments on commit b63c3a3

Please sign in to comment.