TITLE IDOL initial chart and bpm averaging formula improvements
This commit is contained in:
parent
e35301d2ac
commit
d999c87485
1258
LLSIG/music/01-TITLE-IDOL.sig
Normal file
1258
LLSIG/music/01-TITLE-IDOL.sig
Normal file
File diff suppressed because it is too large
Load Diff
@ -103,7 +103,7 @@ public class Canvas extends JPanel implements AudioSpectrumListener{
|
|||||||
g.drawString("Average BPM: "+LLSIG.approximateBPM(),MIDDLE_X-128,MIDDLE_Y+64);
|
g.drawString("Average BPM: "+LLSIG.approximateBPM(),MIDDLE_X-128,MIDDLE_Y+64);
|
||||||
} else
|
} else
|
||||||
if (LLSIG.game.METRONOME) {
|
if (LLSIG.game.METRONOME) {
|
||||||
g.drawString("Offset: "+LLSIG.testOffset,MIDDLE_X-128,MIDDLE_Y+64);
|
g.drawString("Offset: "+LLSIG.offset,MIDDLE_X-128,MIDDLE_Y+64);
|
||||||
} else {
|
} else {
|
||||||
g.setColor(LLSIG.game.musicPlayer.getPlayPosition()-LLSIG.LAST_PERFECT<500?Color.WHITE:Color.DARK_GRAY);g.drawString("PERFECT: "+LLSIG.PERFECT_COUNT,MIDDLE_X-128,MIDDLE_Y-96);
|
g.setColor(LLSIG.game.musicPlayer.getPlayPosition()-LLSIG.LAST_PERFECT<500?Color.WHITE:Color.DARK_GRAY);g.drawString("PERFECT: "+LLSIG.PERFECT_COUNT,MIDDLE_X-128,MIDDLE_Y-96);
|
||||||
g.setColor(LLSIG.game.musicPlayer.getPlayPosition()-LLSIG.LAST_EXCELLENT<500?Color.WHITE:Color.DARK_GRAY);g.drawString("EXCELLENT: "+LLSIG.EXCELLENT_COUNT,MIDDLE_X-128,MIDDLE_Y-64);
|
g.setColor(LLSIG.game.musicPlayer.getPlayPosition()-LLSIG.LAST_EXCELLENT<500?Color.WHITE:Color.DARK_GRAY);g.drawString("EXCELLENT: "+LLSIG.EXCELLENT_COUNT,MIDDLE_X-128,MIDDLE_Y-64);
|
||||||
|
@ -37,7 +37,6 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
public static Font gameFont = new Font("Century Gothic",Font.BOLD,32);
|
public static Font gameFont = new Font("Century Gothic",Font.BOLD,32);
|
||||||
public static int bpm = 120;
|
public static int bpm = 120;
|
||||||
public static double offset = 0;
|
public static double offset = 0;
|
||||||
public static double testOffset = 0;
|
|
||||||
public static double beatDelay = ((1/((double)bpm/60))*1000);
|
public static double beatDelay = ((1/((double)bpm/60))*1000);
|
||||||
public static boolean lastHold = false; //A toggle. Decides primary/secondary color marking.
|
public static boolean lastHold = false; //A toggle. Decides primary/secondary color marking.
|
||||||
|
|
||||||
@ -47,15 +46,15 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
List<Lane> lanes = new ArrayList<Lane>();
|
List<Lane> lanes = new ArrayList<Lane>();
|
||||||
List<BeatTiming> timings = new ArrayList<BeatTiming>();
|
List<BeatTiming> timings = new ArrayList<BeatTiming>();
|
||||||
|
|
||||||
String song = "MiChi-ONE";
|
String song = "02-ワクワクmeetsトリップ";
|
||||||
|
|
||||||
final static Dimension WINDOW_SIZE = new Dimension(1280,1050);
|
final static Dimension WINDOW_SIZE = new Dimension(1280,1050);
|
||||||
|
|
||||||
public boolean EDITMODE = false;
|
public boolean EDITMODE = false;
|
||||||
public boolean METRONOME = false;
|
public boolean METRONOME = false;
|
||||||
public boolean BPM_MEASURE = false;
|
public boolean BPM_MEASURE = true;
|
||||||
public boolean PLAYING = true; //Whether or not a song is loaded and playing.
|
public boolean PLAYING = true; //Whether or not a song is loaded and playing.
|
||||||
public boolean EDITOR = true; //Whether or not we are in beatmap editing mode.
|
public boolean EDITOR = false; //Whether or not we are in beatmap editing mode.
|
||||||
public boolean HOLDING_CTRL_KEY = false;
|
public boolean HOLDING_CTRL_KEY = false;
|
||||||
|
|
||||||
public static double EDITOR_CURSOR_BEAT = 0;
|
public static double EDITOR_CURSOR_BEAT = 0;
|
||||||
@ -120,7 +119,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0;i<9;i++) {
|
for (int i=0;i<9;i++) {;
|
||||||
lanes.add(new Lane(new ArrayList<Note>()));
|
lanes.add(new Lane(new ArrayList<Note>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +130,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
//musicPlayer.jlpp.setVolume(0);
|
musicPlayer.jlpp.setVolume(1);
|
||||||
LoadSongData(song,lanes);
|
LoadSongData(song,lanes);
|
||||||
}
|
}
|
||||||
Canvas canvas = new Canvas(f.getSize());
|
Canvas canvas = new Canvas(f.getSize());
|
||||||
@ -305,12 +304,33 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double approximateBPM() {
|
public static double approximateBPM() {
|
||||||
|
long MAX_BEAT = Long.MIN_VALUE;
|
||||||
|
long MIN_BEAT = Long.MAX_VALUE;
|
||||||
long totalDiff = 0;
|
long totalDiff = 0;
|
||||||
|
int beatCount=0;
|
||||||
if (beats.size()>=2) {
|
if (beats.size()>=2) {
|
||||||
for (int i=1;i<beats.size();i++) {
|
for (int i=1;i<beats.size();i++) {
|
||||||
totalDiff+=beats.get(i)-beats.get(i-1);
|
long diff = beats.get(i)-beats.get(i-1);
|
||||||
|
if (MAX_BEAT<diff) {
|
||||||
|
MAX_BEAT=diff;
|
||||||
|
continue;
|
||||||
|
} else
|
||||||
|
if (MIN_BEAT>diff) {
|
||||||
|
MIN_BEAT=diff;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
totalDiff+=diff;
|
||||||
|
beatCount++;
|
||||||
|
long averageDiff = totalDiff/(beatCount);
|
||||||
|
MAX_BEAT = MAX_BEAT - (MAX_BEAT - averageDiff)/10;
|
||||||
|
MIN_BEAT = MIN_BEAT + (averageDiff - MIN_BEAT)/10;
|
||||||
|
//System.out.println("MAX: "+MAX_BEAT+"/MIN: "+MIN_BEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
long averageDiff = 0;
|
||||||
|
if (beatCount>=1) {
|
||||||
|
averageDiff=totalDiff/(beatCount);
|
||||||
}
|
}
|
||||||
long averageDiff = totalDiff/(beats.size()-1);
|
|
||||||
return (1/((double)averageDiff/1000000000l)*60);
|
return (1/((double)averageDiff/1000000000l)*60);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
@ -375,16 +395,24 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
}break;
|
}break;
|
||||||
case KeyEvent.VK_BACK_SLASH:{
|
case KeyEvent.VK_BACK_SLASH:{
|
||||||
if (METRONOME) {
|
if (METRONOME) {
|
||||||
testOffset=musicPlayer.getPlayPosition();
|
offset=musicPlayer.getPlayPosition();
|
||||||
beatNumber=Math.max(0,beatNumber-12);
|
|
||||||
}
|
}
|
||||||
|
beatNumber=Math.max(0,beatNumber-12);
|
||||||
musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12))));
|
musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12))));
|
||||||
LLSIG.game.lanes.forEach((l)->{
|
LLSIG.game.lanes.forEach((l)->{
|
||||||
l.noteChart.forEach((note)->{if (note.start>musicPlayer.getPlayPosition()) {note.markForDeletion();System.out.println("Marked "+note);}});
|
l.noteChart.forEach((note)->{if (note.start>musicPlayer.getPlayPosition()) {note.markForDeletion();System.out.println("Marked "+note);}});
|
||||||
});
|
});
|
||||||
}break;
|
}break;
|
||||||
case KeyEvent.VK_S:{lane=1;}break;
|
case KeyEvent.VK_S:{
|
||||||
case KeyEvent.VK_D:{lane=2;}break;
|
if (METRONOME) {
|
||||||
|
offset-=10;
|
||||||
|
}
|
||||||
|
lane=1;}break;
|
||||||
|
case KeyEvent.VK_D:{
|
||||||
|
if (METRONOME) {
|
||||||
|
offset+=10;
|
||||||
|
}
|
||||||
|
lane=2;}break;
|
||||||
case KeyEvent.VK_F:{lane=3;}break;
|
case KeyEvent.VK_F:{lane=3;}break;
|
||||||
case KeyEvent.VK_SPACE:{lane=4;}break;
|
case KeyEvent.VK_SPACE:{lane=4;}break;
|
||||||
case KeyEvent.VK_J:{lane=5;}break;
|
case KeyEvent.VK_J:{lane=5;}break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user