@@ -22,6 +22,10 @@ local steplength = 0
22
22
23
23
local graphVecs = {}
24
24
local jackdiffs = {}
25
+ local cvvals = {}
26
+ local cva = {}
27
+ local cvmax = 1
28
+ local cvmin = 0
25
29
local ssrs = {}
26
30
local grindscaler = 0
27
31
local activeModGroup = 1
@@ -32,6 +36,28 @@ local debugstrings
32
36
local topgraph = nil
33
37
local bottomgraph = nil
34
38
39
+ local function calcCVA ()
40
+ cva = {0 ,0 ,0 ,0 }
41
+ cvmax = - 1
42
+ cvmin = 999
43
+ if # cvvals [" Left" ][" Left" ] == 0 and # cvvals [" Left" ][" Right" ] == 0 and # cvvals [" Right" ][" Left" ] == 0 and # cvvals [" Right" ][" Right" ] == 0 then
44
+ return
45
+ end
46
+ local i = 1
47
+ for h , hand in pairs (cvvals ) do
48
+ for c , col in pairs (hand ) do
49
+ local sum = 0
50
+ for _ , v in ipairs (col ) do
51
+ if v [2 ] < cvmin then cvmin = v [2 ] end
52
+ if v [2 ] > cvmax then cvmax = v [2 ] end
53
+ sum = sum + v [2 ]
54
+ end
55
+ cva [i ] = sum / # col
56
+ i = i + 1
57
+ end
58
+ end
59
+ end
60
+
35
61
local function fitX (x , lastX ) -- Scale time values to fit within plot width.
36
62
if lastX == 0 then
37
63
return 0
@@ -462,7 +488,10 @@ local diffGroups = {
462
488
NPSBase = true ,
463
489
CJBase = true ,
464
490
},
465
- { -- Group 14
491
+ { -- Group 15
492
+ CV = true ,
493
+ },
494
+ { -- Group 16
466
495
SSRS = true ,
467
496
},
468
497
}
@@ -495,6 +524,7 @@ local function updateCoolStuff()
495
524
steplength = (finalSecond - firstSecond ) -- this is "doubled" here
496
525
end
497
526
jackdiffs = {Left = {}, Right = {}}
527
+ cvvals = {Left = {Left = {}, Right = {}}, Right = {Left = {}, Right = {}}}
498
528
if steps then
499
529
-- Only load SSRs if currently displaying them; this is a major slowdown
500
530
if diffGroups [activeDiffGroup ][" SSRS" ] then
@@ -571,22 +601,35 @@ local function updateCoolStuff()
571
601
for h = 1 ,2 do
572
602
local hand = h == 1 and " Left" or " Right"
573
603
graphVecs [name .. ss ][h ] = {}
574
- for j = 1 , # arr [hand ][i ] do
575
- local val = arr [hand ][i ][j ]
576
- if val ~= val or val == nil or val == math.huge or val == - math.huge then val = fallbackValue end -- get rid of nan and nil
577
- if top then
578
- if val > upperGraphMax then upperGraphMax = val end
579
- else
580
- if val > lowerGraphMax then lowerGraphMax = val end
604
+ if arr ~= nil then
605
+ for j = 1 , # arr [hand ][i ] do
606
+ local val = arr [hand ][i ][j ]
607
+ if val ~= val or val == nil or val == math.huge or val == - math.huge then val = fallbackValue end -- get rid of nan and nil
608
+ if top then
609
+ if val > upperGraphMax then upperGraphMax = val end
610
+ else
611
+ if val > lowerGraphMax then lowerGraphMax = val end
612
+ end
613
+ graphVecs [name .. ss ][h ][j ] = val
581
614
end
582
- graphVecs [name .. ss ][h ][j ] = val
583
615
end
584
616
end
585
617
end
586
618
end
587
- fc (pap [" DebugTotalPatternMod" ], " TotalPatternMod" , 1 , true )
588
- fc (pap [" DebugPtLoss" ], " PtLoss" , 0 , false )
589
- fc (pap [" DebugMSD" ], " MSD" , 0 , false )
619
+
620
+ if pap ~= nil then
621
+ fc (pap [" DebugTotalPatternMod" ], " TotalPatternMod" , 1 , true )
622
+ fc (pap [" DebugPtLoss" ], " PtLoss" , 0 , false )
623
+ fc (pap [" DebugMSD" ], " MSD" , 0 , false )
624
+ for hand , handvals in pairs (pap [" DebugMovingWindowCV" ]) do
625
+ for col , colvals in pairs (handvals ) do
626
+ for i , vv in ipairs (colvals ) do
627
+ cvvals [hand ][col ][i ] = {vv [1 ] + firstSecond / 2 / getCurRateValue (), vv [2 ]}
628
+ end
629
+ end
630
+ end
631
+ end
632
+ calcCVA ()
590
633
591
634
upperGraphMin = 0.3
592
635
upperGraphMax = 1.25
@@ -952,6 +995,23 @@ o[#o + 1] = UIElements.QuadButton(1, 1) .. {
952
995
modText = modText :sub (1 , # modText - 1 ) -- remove the end whitespace
953
996
end
954
997
998
+ if diffGroups [activeDiffGroup ][" CV" ] then
999
+ modText = modText .. " \n "
1000
+ for h = 1 ,2 do
1001
+ for c = 1 ,2 do
1002
+ local hnd = h == 1 and " Left" or " Right"
1003
+ local cl = c == 1 and " Left" or " Right"
1004
+ local hand = h == 1 and " L" or " R"
1005
+ local col = c == 1 and " L" or " R"
1006
+ if cvvals [hnd ][cl ] ~= nil and # cvvals [hnd ][cl ] > 0 then
1007
+ local index = convertPercentToIndexForJack (mx - leftEnd , rightEnd - leftEnd , cvvals [hnd ][cl ])
1008
+ modText = modText .. string.format (" %s : %5.4f\n " , " CV-" .. hand .. col , cvvals [hnd ][cl ][index ][2 ])
1009
+ end
1010
+ end
1011
+ end
1012
+ modText = modText :sub (1 , # modText - 1 ) -- remove the end whitespace
1013
+ end
1014
+
955
1015
txt :settext (modText )
956
1016
elseif diffGroups [activeDiffGroup ][" SSRS" ] then
957
1017
local ssrindex = convertPercentToIndex (perc )
@@ -1169,6 +1229,13 @@ local jackdiffColors = {
1169
1229
color (" 1,0,0,1" ), -- jack loss right
1170
1230
}
1171
1231
1232
+ local cvColors = {
1233
+ color (" 1,1,0" ), -- cv left hand left finger
1234
+ color (" 1,1,0" ), -- cv left hand right finger
1235
+ color (" 1,0,0" ), -- cv right hand left finger
1236
+ color (" 1,0,0" ), -- cv right hand right finger
1237
+ }
1238
+
1172
1239
-- these are all CalcDiffValue mods only
1173
1240
-- in the same order
1174
1241
local calcDiffValueColors = {
@@ -1321,6 +1388,8 @@ o[#o + 1] = LoadFont("Common Normal") .. {
1321
1388
local afterloss = maxpoints - jackLossSumRight - jackLossSumLeft
1322
1389
local reqpoints = tappoints * 0.93
1323
1390
self :settextf (" Upper Bound: %.2f | Loss Sum L: %5.2f | Loss Sum R: %5.2f | Pt AfterLoss/Req/Max: %5.2f/%5.2f/%5.2f" , lowerGraphMaxJack * 0.9 , jackLossSumLeft , jackLossSumRight , afterloss , reqpoints , maxpoints )
1391
+ elseif diffGroups [activeDiffGroup ][" CV" ] and steps then
1392
+ self :settextf (" Upper Bound: %.2f | Lower Bound: %.2f | Average CVs - LL = %5.2f | LR = %5.2f | RL = %5.2f | RR = %5.2f" , cvmax , cvmin , cva [1 ], cva [2 ], cva [3 ], cva [4 ])
1324
1393
else
1325
1394
self :settextf (" Upper Bound: %.4f | Grindscaler: %5.2f" , lowerGraphMax , grindscaler )
1326
1395
end
@@ -1612,6 +1681,59 @@ local function bottomGraphLineJackloss(colorToUse, hand)
1612
1681
}
1613
1682
end
1614
1683
1684
+ local function bottomGraphLineCoeffVariance (colorToUse , hand , col )
1685
+ return Def .ActorMultiVertex {
1686
+ InitCommand = function (self )
1687
+ self :y (plotHeight + 5 )
1688
+ end ,
1689
+ DoTheThingCommand = function (self )
1690
+ if song and enabled then
1691
+ self :SetVertices ({})
1692
+ self :SetDrawState {Mode = " DrawMode_Quads" , First = 1 , Num = 0 }
1693
+
1694
+ if activeDiffGroup == - 1 or (diffGroups [activeDiffGroup ] and diffGroups [activeDiffGroup ][" CV" ]) then
1695
+ self :visible (true )
1696
+ else
1697
+ self :visible (false )
1698
+ end
1699
+
1700
+ local hand = hand == 1 and " Left" or " Right"
1701
+ local col = col == 1 and " Left" or " Right"
1702
+ local verts = {}
1703
+ local values = cvvals [hand ][col ]
1704
+ if not values or not values [1 ] then return end
1705
+
1706
+ for i = 1 , # values do
1707
+ -- local x = fitX(i, #values) -- vector length based positioning
1708
+ -- if used, final/firstsecond must be halved
1709
+ -- they need to be halved because the numbers we use here are not half second interval based, but row time instead
1710
+ local x = fitX (values [i ][1 ], finalSecond / 2 / getCurRateValue ()) -- song length based positioning
1711
+ local y = fitY2 (values [i ][2 ], cvmin - 0.1 , cvmax + 0.25 )
1712
+
1713
+ setOffsetVerts (verts , x , y , colorToUse )
1714
+ end
1715
+
1716
+ if # verts <= 1 then
1717
+ verts = {}
1718
+ end
1719
+ self :SetVertices (verts )
1720
+ self :SetDrawState {Mode = " DrawMode_LineStrip" , First = 1 , Num = # verts }
1721
+ else
1722
+ self :visible (false )
1723
+ end
1724
+ end ,
1725
+ UpdateActiveLowerGraphMessageCommand = function (self )
1726
+ if song and enabled then
1727
+ if activeDiffGroup == - 1 or (diffGroups [activeDiffGroup ] and diffGroups [activeDiffGroup ][" CV" ]) then
1728
+ self :visible (true )
1729
+ else
1730
+ self :visible (false )
1731
+ end
1732
+ end
1733
+ end
1734
+ }
1735
+ end
1736
+
1615
1737
local function bottomGraphLineSSR (lineNum , colorToUse )
1616
1738
return Def .ActorMultiVertex {
1617
1739
InitCommand = function (self )
@@ -1740,6 +1862,18 @@ for h = 1,2 do
1740
1862
o [# o + 1 ] = bottomGraphLineJackloss (colr , h )
1741
1863
end
1742
1864
1865
+ -- cv vals
1866
+ do
1867
+ local i = 1
1868
+ for h = 1 ,2 do
1869
+ for c = 1 ,2 do
1870
+ local colr = cvColors [i ]
1871
+ i = i + 1
1872
+ o [# o + 1 ] = bottomGraphLineCoeffVariance (colr , h , c )
1873
+ end
1874
+ end
1875
+ end
1876
+
1743
1877
-- a bunch of things for stuff and things
1744
1878
o [# o + 1 ] = LoadFont (" Common Normal" ) .. {
1745
1879
Name = " Seektext1" ,
0 commit comments