• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

MIDI Chord Helper機能追加版(GOは五度圏や碁盤の「ご」。別に移動式じゃありません)


Commit MetaInfo

Revisión452a0fda039d31ebd4296ef49c5a352a93a596fc (tree)
Tiempo2022-11-15 02:13:20
Autork-hatano <kent.ruffle.mgj626@gmai...>
Commiterk-hatano

Log Message

10チャンネル選択中にスクロールバーにカーソルを合わせた場合、各ノートに対応するパーカッションの頭文字を表示

Cambiar Resumen

Diferencia incremental

--- a/src/camidion/chordhelper/music/MIDISpec.java
+++ b/src/camidion/chordhelper/music/MIDISpec.java
@@ -614,7 +614,7 @@ public class MIDISpec {
614614 /**
615615 * パーカッション用MIDIノート番号の最小値
616616 */
617- public static final int MIN_PERCUSSION_NUMBER = 35;
617+ public static final int MIN_PERCUSSION_NUMBER = 27;
618618
619619 /**
620620 * パーカッション用のMIDIチャンネル(通常はCH.10)における
@@ -629,6 +629,14 @@ public class MIDISpec {
629629 }
630630
631631 public static final String PERCUSSION_NAMES[] = {
632+ "High Q",
633+ "Slap 49",
634+ "Scratch Push",
635+ "Scratch Pull",
636+ "Sticks",
637+ "Square Click",
638+ "Metronome Click",
639+ "Metronome Bell",
632640 "Acoustic Bass Drum",
633641 "Bass Drum 1",
634642 "Side Stick",
--- a/src/camidion/chordhelper/pianokeyboard/PianoKeyboard.java
+++ b/src/camidion/chordhelper/pianokeyboard/PianoKeyboard.java
@@ -146,6 +146,17 @@ public class PianoKeyboard extends JComponent {
146146 private int[] modulations = new int[MIDISpec.MAX_CHANNELS];
147147
148148 int programs[] = new int[16];
149+
150+ final String DRUM_LABELS[] = {
151+ "", "", "", "", "", "", "", "", "", "", "", "",
152+ "", "", "", "", "", "", "", "", "", "", "", "",
153+ "", "", "", "Hq", "Sl", "Sc", "Sc", "St", "Ck", "Mm", "Mm", "Bs",
154+ "Bs", "St", "Sn", "Cp", "Sn", "Tm", "Hh", "Tm", "Hh", "Tm", "Hh", "Tm",
155+ "Tm", "Cy", "Tm", "Cy", "Cy", "Bl", "Tb", "Cy", "Bl", "Cy", "Sl", "Cy",
156+ "Bg", "Bg", "Cg", "Cg", "Cg", "Tb", "Tb", "Ag", "Ag", "Cb", "Mr", "Wh",
157+ "Wh", "Gr", "Gr", "Cv", "Wb", "Wb", "Cc", "Cc", "Tr", "Tr", "Sk", "Bl",
158+ "Bt", "Cs", "Sd", "Sd", "", "", "", "", "", "", "", "",
159+ };
149160
150161 private class MidiChannelStatus extends AbstractMidiChannelStatus {
151162 public MidiChannelStatus(int channel) {
@@ -394,6 +405,16 @@ public class PianoKeyboard extends JComponent {
394405 return true;
395406 }
396407
408+ boolean paintDrumLabel(Graphics2D g2, int octave) {
409+ String label = "";
410+ int note = position + 12 * octave;
411+ if (note >= 0 && note < DRUM_LABELS.length) {
412+ label = DRUM_LABELS[note];
413+ }
414+ g2.drawString(label, x + width / 6, indicator.y - 2);
415+ return true;
416+ }
417+
397418 boolean paintIndicator(Graphics2D g2, boolean isSmall, int pitchBendValue) {
398419 if (isSmall) {
399420 g2.fillOval(
@@ -649,12 +670,21 @@ public class PianoKeyboard extends JComponent {
649670 }
650671 }));
651672 if (showingOctave) {
652- // Show octave
653- Arrays.stream(keys).forEach(k -> {
654- g2.setColor(
655- k.isBlack ? Color.gray.brighter() : isDark ? getForeground() : getForeground().brighter());
656- k.paintKeyOctave(g2, octaveRangeModel.getValue());
657- });
673+ if (midiChComboboxModel.getSelectedChannel() == 9) {
674+ // Show drum labels
675+ Arrays.stream(keys).forEach(k -> {
676+ g2.setColor(
677+ k.isBlack ? Color.gray.brighter() : isDark ? getForeground() : getForeground().brighter());
678+ k.paintDrumLabel(g2, octaveRangeModel.getValue());
679+ });
680+ } else {
681+ // Show octave
682+ Arrays.stream(keys).forEach(k -> {
683+ g2.setColor(
684+ k.isBlack ? Color.gray.brighter() : isDark ? getForeground() : getForeground().brighter());
685+ k.paintKeyOctave(g2, octaveRangeModel.getValue());
686+ });
687+ }
658688 } else if (isFocusOwner()) {
659689 // Show PC-key binding
660690 Arrays.stream(bindedKeys).forEach(k -> {