plectrum

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 83c692732c69961fa0a1b03d96f8483e40d201ba
parent f0be3654374b4a75a2ffe67d0172a1eaddc48394
Author: gstraube <gstraube@mailbox.org>
Date:   Mon,  8 Jun 2020 16:49:47 +0200

Merge branch 'SiIky-bass_cgcf_tuning'

Diffstat:
Mapp/src/main/java/com/github/cythara/TuningMapper.java | 14+++++++++-----
Aapp/src/main/java/com/github/cythara/tuning/DropCBassTuning.java | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mapp/src/main/res/values-de-rDE/strings.xml | 1+
Mapp/src/main/res/values-pt-rBR/strings.xml | 1+
Mapp/src/main/res/values/strings.xml | 1+
5 files changed, 70 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/com/github/cythara/TuningMapper.java b/app/src/main/java/com/github/cythara/TuningMapper.java @@ -2,6 +2,7 @@ package com.github.cythara; import android.util.Log; +import com.github.cythara.tuning.DropCBassTuning; import com.github.cythara.tuning.BassTuning; import com.github.cythara.tuning.CelloTuning; import com.github.cythara.tuning.ChromaticTuning; @@ -24,11 +25,12 @@ class TuningMapper { private static final int DROP_C_SHARP_TUNING_POSITION = 4; private static final int OPEN_G_TUNING = 5; private static final int BASS_TUNING_POSITION = 6; - private static final int UKULELE_TUNING_POSITION = 7; - private static final int D_TUNING_POSITION = 8; - private static final int VIOLIN_TUNING_POSITION = 9; - private static final int CELLO_TUNING_POSITION = 10; - private static final int VIOLA_TUNING_POSITION = 11; + private static final int BASS_DROP_C_TUNING_POSITION = 7; + private static final int UKULELE_TUNING_POSITION = 8; + private static final int D_TUNING_POSITION = 9; + private static final int VIOLIN_TUNING_POSITION = 10; + private static final int CELLO_TUNING_POSITION = 11; + private static final int VIOLA_TUNING_POSITION = 12; static Tuning getTuningFromPosition(int position) { switch (position) { @@ -46,6 +48,8 @@ class TuningMapper { return new OpenGGuitarTuning(); case BASS_TUNING_POSITION: return new BassTuning(); + case BASS_DROP_C_TUNING_POSITION: + return new DropCBassTuning(); case UKULELE_TUNING_POSITION: return new UkuleleTuning(); case D_TUNING_POSITION: diff --git a/app/src/main/java/com/github/cythara/tuning/DropCBassTuning.java b/app/src/main/java/com/github/cythara/tuning/DropCBassTuning.java @@ -0,0 +1,58 @@ +package com.github.cythara.tuning; + +import com.github.cythara.Note; +import com.github.cythara.NoteName; +import com.github.cythara.Tuning; + +import static com.github.cythara.NoteName.*; + +public class DropCBassTuning implements Tuning { + + @Override + public Note[] getNotes() { + return Pitch.values(); + } + + @Override + public Note findNote(String name) { + return Pitch.valueOf(name); + } + + private enum Pitch implements Note { + + C1(C, 1, 32.7f), + G1(G, 1, 49f), + C2(C, 2, 65.41f), + F2(F, 2, 87.31f); + + private final String sign; + private final int octave; + private final float frequency; + private NoteName name; + + Pitch(NoteName name, int octave, float frequency) { + this.name = name; + this.octave = octave; + this.sign = ""; + this.frequency = frequency; + } + + public NoteName getName() { + return name; + } + + public float getFrequency() { + return frequency; + } + + @Override + public int getOctave() { + return octave; + } + + @Override + public String getSign() { + return sign; + } + } +} diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml @@ -21,6 +21,7 @@ <item>Gitarre (Drop C#)</item> <item>Gitarre (Open G)</item> <item>Bass (Standard)</item> + <item>Bass (Drop C)</item> <item>Ukulele (Standard)</item> <item>Ukulele (D tuning)</item> <item>Geige (Standard)</item> diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml @@ -21,6 +21,7 @@ <item>Violão (Drop C#)</item> <item>Violão (Open G)</item> <item>Bass (padrão)</item> + <item>Bass (Drop C)</item> <item>Ukulele (padrão)</item> <item>Ukulele (D tuning)</item> <item>Violino (padrão)</item> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml @@ -23,6 +23,7 @@ <item>Guitar (Drop C#)</item> <item>Guitar (Open G)</item> <item>Bass (standard)</item> + <item>Bass (Drop C)</item> <item>Ukulele (standard)</item> <item>Ukulele (D tuning)</item> <item>Violin (standard)</item>