midi and whoop
This commit is contained in:
parent
2b775ac7e4
commit
ae12b4f09f
2 changed files with 10 additions and 3 deletions
|
@ -43,7 +43,7 @@ public class AuthPlugin extends PlayersPlugin.Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playerJoined(PlayerEntry target) {
|
public void playerJoined(PlayerEntry target) {
|
||||||
if (!target.profile.getName().equals(bot.config.ownerName.replaceAll("§", "")) || !bot.options.useCore) return;
|
if (!target.profile.getName().equals(bot.config.ownerName.replaceAll("§[a-f0-9rlonmk]", "")) || !bot.options.useCore) return;
|
||||||
|
|
||||||
bot.executor.schedule(() -> sendVerificationMessage(target, true), 2, TimeUnit.SECONDS);
|
bot.executor.schedule(() -> sendVerificationMessage(target, true), 2, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,11 +130,18 @@ public class MidiConverter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pitch = midiPitch-instrument.offset;
|
int pitch = (midiPitch-instrument.offset) + /* lazy -> */ 33;
|
||||||
|
|
||||||
|
// these 2 lines are totallynotskidded from https://github.com/OpenNBS/OpenNoteBlockStudio/blob/master/scripts/selection_transpose/selection_transpose.gml
|
||||||
|
// so huge thanks to them uwu
|
||||||
|
// will this do anything if it's midi?
|
||||||
|
while (pitch < 33) pitch += 12;
|
||||||
|
while (pitch > 57) pitch -= 12;
|
||||||
|
|
||||||
float volume = (float) velocity / 127.0f;
|
float volume = (float) velocity / 127.0f;
|
||||||
long time = microTime / 1000L;
|
long time = microTime / 1000L;
|
||||||
|
|
||||||
return new Note(instrument, pitch, volume, time, -1, 100);
|
return new Note(instrument, pitch - 33, volume, time, -1, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Note getMidiPercussionNote (int midiPitch, int velocity, long microTime) {
|
private static Note getMidiPercussionNote (int midiPitch, int velocity, long microTime) {
|
||||||
|
|
Loading…
Reference in a new issue