This commit is contained in:
Cameron Taylor 2024-01-27 06:16:46 -05:00
parent df2c01b2ff
commit c44e33c556
4 changed files with 17 additions and 13 deletions

6
.vscode/launch.json vendored
View file

@ -7,6 +7,12 @@
"type": "lime",
"request": "launch"
},
{
"name": "Debug",
"type": "lime",
"request": "launch",
"preLaunchTask": null
},
{
// Launch in browser
"name": "HTML5 Debug",

2
assets

@ -1 +1 @@
Subproject commit d094640f727a670a348b3579d11af5ff6a2ada3a
Subproject commit b2f8b6a780316959d0a79adc6dbf61f9e4ca675f

View file

@ -373,7 +373,13 @@ class Conductor
*/
public function getTimeWithDiff():Float
{
return this.songPosition + (Std.int(Timer.stamp() * 1000) - prevTimestamp);
// trace(this.songPosition);
@:privateAccess
this.songPosition = FlxG.sound.music._channel.position;
// return this.songPosition + (Std.int(Timer.stamp() * 1000) - prevTimestamp);
// trace("\t--> " + this.songPosition);
return this.songPosition;
}
public function mapTimeChanges(songTimeChanges:Array<SongTimeChange>)

View file

@ -63,9 +63,9 @@ class LatencyState extends MusicBeatSubState
FlxG.addChildBelowMouse(realStats);
PreciseInputManager.instance.onInputPressed.add(function(event:PreciseInputEvent) {
generateBeatStuff(event);
strumLine.pressKey(event.noteDirection);
strumLine.playPress(event.noteDirection);
generateBeatStuff(event);
});
PreciseInputManager.instance.onInputReleased.add(function(event:PreciseInputEvent) {
@ -80,14 +80,6 @@ class LatencyState extends MusicBeatSubState
diffGrp = new FlxTypedGroup<FlxText>();
add(diffGrp);
// var musSpec:PolygonSpectogram = new PolygonSpectogram(FlxG.sound.music, FlxColor.RED, FlxG.height, Math.floor(FlxG.height / 2));
// musSpec.x += 170;
// musSpec.scrollFactor.set();
// musSpec.waveAmplitude = 100;
// musSpec.realtimeVisLenght = 0.45;
// // musSpec.visType = FREQUENCIES;
// add(musSpec);
for (beat in 0...Math.floor(FlxG.sound.music.length / (Conductor.instance.stepLengthMs * 2)))
{
var beatTick:FlxSprite = new FlxSprite(songPosToX(beat * (Conductor.instance.stepLengthMs * 2)), FlxG.height - 15);
@ -178,7 +170,7 @@ class LatencyState extends MusicBeatSubState
Conductor.instance.update();
funnyStatsGraph.update(Conductor.instance.songPosition % 500);
funnyStatsGraph.update(swagSong.getTimeWithDiff() % 500);
realStats.update(Conductor.instance.getTimeWithDiff() % 500);
// Conductor.instance.songPosition += (Timer.stamp() * 1000) - FlxG.sound.music.prevTimestamp;
@ -266,7 +258,7 @@ class LatencyState extends MusicBeatSubState
beatTrail.x = songPosVis.x;
diffGrp.members[closestBeat].text = getDiff + "ms";
offsetsPerBeat[closestBeat] = Std.int(getDiff);
offsetsPerBeat[closestBeat] = Math.round(getDiff);
}
function songPosToX(pos:Float):Float