We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48ff27f commit e86e1e3Copy full SHA for e86e1e3
src/main/java/com/xxmicloxx/NoteBlockAPI/utils/NoteUtils.java
@@ -84,16 +84,15 @@ public static float getPitchTransposed(Note note) {
84
* @return pitch
85
*/
86
public static float getPitchTransposed(byte key, short pitch) {
87
- // Apply pitch to key
88
- key += pitch % 100;
89
- pitch /= 100;
+ // Apply key to pitch
+ pitch += key * 100;
90
91
- while (key < 33) key += 12;
92
- while (key > 57) key -= 12;
+ while (pitch < 3300) pitch += 1200;
+ while (pitch > 5700) pitch -= 1200;
93
94
- key -= 33;
+ pitch -= 3300;
95
96
- return pitches[key * 100 + pitch];
+ return pitches[pitch];
97
}
98
99
/**
0 commit comments