Run it
Copy the script and paste it into your executor.
Players = :()
UIS = :()
GuiService = :()
HttpService = :()
TweenService = :()
VIM = :()
lp = Players.LocalPlayer
playerGui = lp:()
httpRequest = ( .request) ( .request)
(()
().AutoPianoGui
().AutoPianoGui:()
)
(s)
(s:(, ) == , )
hlen = .(, s, )
_, _, division = .(, s, )
pos = + hlen
notes, tempos = {}, {}
()
v =
b = s:(pos)
pos = pos +
v = v * + (b % )
b <
v
pos + <= #s
id = s:(pos, pos + )
len = .(, s, pos + )
pos = pos +
stop = pos + len
id ==
t, run = ,
pos < stop
t = t + ()
st = s:(pos)
st >=
run = st
pos = pos +
st = run
st ==
typ = s:(pos)
pos = pos +
l = ()
typ == l >=
a, b, c = s:(pos, pos + )
tempos[#tempos + ] = { t = t, us = a * + b * + c }
pos = pos + l
st == st ==
pos = pos + ()
hi = st - (st % )
hi == hi ==
pos = pos +
a, b = s:(pos, pos + )
pos = pos +
hi == b > (st % ) ~=
notes[#notes + ] = { t = t, n = a }
pos = stop
.(tempos, (a, b) a.t < b.t )
.(notes, (a, b) a.t < b.t )
ti, curTempo, lastTick, sec = , , ,
_, n (notes)
tempos[ti] tempos[ti].t <= n.t
sec = sec + (tempos[ti].t - lastTick) * curTempo / / division
lastTick = tempos[ti].t
curTempo = tempos[ti].us
ti = ti +
sec = sec + (n.t - lastTick) * curTempo / / division
lastTick = n.t
n.time = sec
notes
panelOpen =
boxOn =
scanActive =
playing =
detected = {}
conns = {}
(s)
(s) == #s == s:()
s
(o)
sg = o:()
c = o.AbsolutePosition + o.AbsoluteSize /
sg sg.IgnoreGuiInset
c = c + GuiService:()
c
flash = ()
touchOk = (() VIM.SendTouchEvent )
touchId =
(obj)
obj.Parent
c = (obj)
touchOk
touchId = touchId % +
id = touchId
ok = (() VIM:(id, , c.X, c.Y) )
ok
.()
(() VIM:(id, , c.X, c.Y) )
touchOk =
VIM:(c.X, c.Y, )
VIM:(c.X, c.Y, , , , )
.()
VIM:(c.X, c.Y, , , , )
(keys)
_, k (keys)
.(tapKey, k.obj)
(k.i)
majorDegree = { [] = , [] = , [] = , [] = , [] = , [] = , [] = , [] = , [] = , [] = , [] = , [] = }
inMajor = { [] = , [] = , [] = , [] = , [] = , [] = , [] = }
(notes)
hist = {}
i = , hist[i] =
_, n (notes)
pc = n.n %
hist[pc] = hist[pc] +
best, bestScore, bestTie = , -, -
t = ,
score =
pc = ,
inMajor[(pc - t) % ] score = score + hist[pc]
tie = hist[t] + hist[(t + ) % ]
score > bestScore (score == bestScore tie > bestTie)
best, bestScore, bestTie = t, score, tie
best
(keys)
minH, maxH, minY, maxY = .huge, , .huge, -.huge
_, k (keys)
minH = .(minH, k.h)
maxH = .(maxH, k.h)
minY = .(minY, k.y)
maxY = .(maxY, k.y)
(maxH / .(minH, ) >= ) (maxY - minY > * maxH)
(notes, N, diatonic)
tonic = diatonic (notes)
unit = diatonic
(note)
diatonic
d = note - tonic
.(d / ) * + majorDegree[d % ]
note
counts, vals = {}, {}
minV, maxV = .huge, -.huge
_, n (notes)
v = (n.n)
counts[v] = (counts[v] ) +
vals[#vals + ] = v
v < minV minV = v
v > maxV maxV = v
.(vals)
med = vals[.(#vals / )]
bestBase, bestOut, bestDist = , .huge, .huge
base = (.(minV / unit) - ) * unit, maxV, unit
out =
v, c (counts)
v < base v > base + N - out = out + c
dist = .(base + N / - med)
out < bestOut (out == bestOut dist < bestDist)
bestBase, bestOut, bestDist = base, out, dist
(note)
idx = (note) - bestBase
N >= unit
idx < idx = idx + unit
idx >= N idx = idx - unit
idx = idx % N
idx
WHITE = .(, , )
C = {
bg = .(, , ),
card = .(, , ),
card2 = .(, , ),
line = .(, , ),
text = .(, , ),
muted = .(, , ),
accent = .(, , ),
accent2 = .(, , ),
good = .(, , ),
= .(, , ),
bad = .(, , ),
dark = .(, , ),
}
FONT, FONT_M, FONT_B = .Font.Gotham, .Font.GothamMedium, .Font.GothamBold
(class, props, parent)
i = .(class)
k, v (props) i[k] = v
i.Parent = parent
i
(o, r) (, { CornerRadius = .(, r ) }, o)
(o, color, th, tr)
(, {
Color = color, Thickness = th , Transparency = tr ,
ApplyStrokeMode = .ApplyStrokeMode.Border,
}, o)
(o, c1, c2, rot)
(, { Color = ColorSequence.(c1, c2), Rotation = rot }, o)
(o, l, t, r, b)
(, {
PaddingLeft = .(, l), PaddingTop = .(, t l),
PaddingRight = .(, r l), PaddingBottom = .(, b t l),
}, o)
(o, t, props)
TweenService:(o, TweenInfo.(t, .EasingStyle.Quad, .EasingDirection.Out), props):()
(parent, props)
props.BackgroundTransparency =
props.Font = props.Font FONT
props.TextColor3 = props.TextColor3 C.text
props.TextSize = props.TextSize
(, props, parent)
(parent, props, base, over)
props.AutoButtonColor =
props.BackgroundColor3 = base
props.Font = props.Font FONT_B
props.TextColor3 = props.TextColor3 C.text
props.TextSize = props.TextSize
b = (, props, parent)
b.MouseEnter:(() (b, , { BackgroundColor3 = over }) )
b.MouseLeave:(() (b, , { BackgroundColor3 = base }) )
b
gui = (, {
Name = ,
ResetOnSpawn = ,
IgnoreGuiInset = ,
ZIndexBehavior = .ZIndexBehavior.Sibling,
DisplayOrder = ,
})
okParent = (()
gui.Parent = (gethui ()) :()
)
okParent gui.Parent gui.Parent = playerGui
(() ().AutoPianoGui = gui )
gui.Destroying:(()
playing =
_, c (conns) c:()
)
vp = .CurrentCamera.ViewportSize
box = (, {
Name = ,
Position = .(vp.X / - , vp.Y / - ),
Size = .(, ),
BackgroundColor3 = C.accent,
BackgroundTransparency = ,
Active = ,
Visible = ,
ZIndex = ,
}, gui)
(box, )
boxStroke = (box, C.accent, )
chip = (, {
AutomaticSize = .AutomaticSize.X,
Size = .(, ),
Position = .(, , , -),
BackgroundColor3 = C.dark,
BackgroundTransparency = ,
ZIndex = ,
}, box)
(chip, )
(chip, C.accent, , )
(chip, , )
boxLabel = (, {
AutomaticSize = .AutomaticSize.X,
Size = .(, ),
BackgroundTransparency = ,
Text = ,
Font = FONT_B,
TextSize = ,
TextColor3 = C.accent,
ZIndex = ,
}, chip)
grip = (, {
Size = .(, ),
AnchorPoint = .(, ),
Position = .(, , , ),
BackgroundColor3 = C.accent,
Text = ,
Font = FONT_B,
TextSize = ,
TextColor3 = C.dark,
AutoButtonColor = ,
ZIndex = ,
}, box)
(grip, )
(grip, C.dark, , )
markers = {}
(i)
m = markers[i]
m
m = (, {
Size = .(, ),
AnchorPoint = .(, ),
BackgroundColor3 = C.accent,
BorderSizePixel = ,
Visible = ,
ZIndex = ,
}, gui)
(m, )
(m, C.dark, , )
markers[i] = m
m
()
show = scanActive boxOn
i, k (detected)
m = (i)
m.Position = .(k.x, k.y)
m.Visible = show
i = #detected + , #markers
markers[i].Visible =
flash = (i)
m = markers[i]
m
m.Size = .(, )
m.BackgroundColor3 = WHITE
(m, , { Size = .(, ), BackgroundColor3 = C.accent })
()
show = boxOn
box.Active = show playing
chip.Visible = show
grip.Visible = show
bgT = ( show) (playing )
(box, , { BackgroundTransparency = bgT })
(boxStroke, , {
Color = playing C.good C.accent,
Transparency = show ,
})
PW = .(, vp.X - )
PH = .(, vp.Y - )
panel = (, {
Name = ,
Position = .(.(, vp.X - - PW), .(, (vp.Y - PH) / )),
Size = .(PW, PH),
BackgroundColor3 = C.bg,
Active = ,
Visible = ,
ClipsDescendants = ,
ZIndex = ,
}, gui)
(panel, )
(panel, C.line, )
scale = (, { Scale = }, panel)
header = (, {
Size = .(, , , ),
BackgroundColor3 = WHITE,
BorderSizePixel = ,
Active = ,
}, panel)
(header, .(, , ), C.card, )
(header, {
Position = .(, ), Size = .(, -, , ),
Text = , Font = FONT_B, TextSize = , TextXAlignment = .TextXAlignment.Left,
})
(header, {
Position = .(, ), Size = .(, -, , ),
Text = , TextSize = , TextColor3 = C.muted,
TextXAlignment = .TextXAlignment.Left,
})
hideBtn = (, {
AnchorPoint = .(, ), Position = .(, -, , ),
Size = .(, ), BackgroundColor3 = C.card2, Text = ,
Font = FONT_B, TextSize = , TextColor3 = C.text, AutoButtonColor = ,
}, header)
(hideBtn, )
hideBtn.MouseEnter:(() (hideBtn, , { BackgroundColor3 = C.line }) )
hideBtn.MouseLeave:(() (hideBtn, , { BackgroundColor3 = C.card2 }) )
boxBtn = (, {
AnchorPoint = .(, ), Position = .(, -, , ),
Size = .(, ), BackgroundColor3 = C.accent, Text = ,
Font = FONT_B, TextSize = , TextColor3 = C.dark, AutoButtonColor = ,
}, header)
(boxBtn, )
body = (, {
Position = .(, ),
Size = .(, , , -),
BackgroundTransparency = ,
BorderSizePixel = ,
ScrollBarThickness = ,
ScrollBarImageColor3 = C.line,
CanvasSize = .(),
AutomaticCanvasSize = .AutomaticSize.Y,
}, panel)
(body, )
(, { Padding = .(, ), SortOrder = .SortOrder.LayoutOrder }, body)
(text, order)
(body, {
Size = .(, , , ), Text = text, Font = FONT_B, TextSize = ,
TextColor3 = C.muted, TextXAlignment = .TextXAlignment.Left, LayoutOrder = order,
})
statusCard = (, { Size = .(, , , ), BackgroundColor3 = C.card, LayoutOrder = }, body)
(statusCard, )
dot = (, {
Size = .(, ), Position = .(, , , -), BackgroundColor3 = C.bad,
}, statusCard)
(dot, )
status = (statusCard, {
Position = .(, ), Size = .(, -, , ),
Text = , TextSize = , TextWrapped = ,
TextXAlignment = .TextXAlignment.Left,
})
lockUntil =
(text, kind, lock)
status.Text = text
col = ({ good = C.good, play = C.accent, = C.warn, bad = C.bad })[kind] C.muted
(dot, , { BackgroundColor3 = col })
lock lockUntil = .() + lock
(, )
seg = (, { Size = .(, , , ), BackgroundColor3 = C.card, LayoutOrder = }, body)
(seg, )
(seg, )
(, {
FillDirection = .FillDirection.Horizontal, Padding = .(, ), SortOrder = .SortOrder.LayoutOrder,
}, seg)
modeNames = { , , }
modeBtns = {}
modeIdx =
()
i, b (modeBtns)
on = (i == modeIdx)
(b, , { BackgroundColor3 = on C.accent C.card, TextColor3 = on C.dark C.muted })
i, n (modeNames)
b = (, {
Size = .( / , -, , ), BackgroundColor3 = C.card, Text = n,
Font = FONT_B, TextSize = , TextColor3 = C.muted, AutoButtonColor = , LayoutOrder = i,
}, seg)
(b, )
modeBtns[i] = b
b.MouseButton1Click:(()
modeIdx = i
()
)
()
(, )
speedRow = (, { Size = .(, , , ), BackgroundColor3 = C.card, LayoutOrder = }, body)
(speedRow, )
minus = (speedRow, {
Position = .(, ), Size = .(, , , -), Text = , TextSize = ,
}, C.card2, C.line)
(minus, )
plus = (speedRow, {
AnchorPoint = .(, ), Position = .(, -, , ), Size = .(, , , -),
Text = , TextSize = ,
}, C.card2, C.line)
(plus, )
speedLabel = (speedRow, {
Position = .(, ), Size = .(, -, , ), Text = , Font = FONT_B, TextSize = ,
})
speed =
(v)
speed = .(.(v * + ) / , , )
speedLabel.Text = .(, speed)
minus.MouseButton1Click:(() (speed - ) )
plus.MouseButton1Click:(() (speed + ) )
search = (, {
Size = .(, , , ), BackgroundColor3 = C.card, PlaceholderText = , Text = ,
ClearTextOnFocus = , Font = FONT, TextSize = , TextColor3 = C.text, PlaceholderColor3 = C.muted,
TextXAlignment = .TextXAlignment.Left, LayoutOrder = ,
}, body)
(search, )
(search, , )
(search, C.line, , )
list = (, {
Size = .(, , , ), BackgroundColor3 = C.card, BorderSizePixel = ,
ScrollBarThickness = , ScrollBarImageColor3 = C.line, CanvasSize = .(),
AutomaticCanvasSize = .AutomaticSize.Y, LayoutOrder = ,
}, body)
(list, )
(list, )
(, { Padding = .(, ), SortOrder = .SortOrder.LayoutOrder }, list)
np = (, { Size = .(, , , ), BackgroundColor3 = C.card, LayoutOrder = }, body)
(np, )
songLabel = (np, {
Position = .(, ), Size = .(, -, , ), Text = ,
Font = FONT_M, TextSize = , TextColor3 = C.accent, TextXAlignment = .TextXAlignment.Left,
TextTruncate = .TextTruncate.AtEnd,
})
barBg = (, {
Position = .(, , , -), Size = .(, -, , ), BackgroundColor3 = C.card2,
}, np)
(barBg, )
barFill = (, { Size = .(, , , ), BackgroundColor3 = WHITE }, barBg)
(barFill, )
(barFill, C.accent, C.accent2, )
row = (, { Size = .(, , , ), BackgroundTransparency = , LayoutOrder = }, body)
playBtn = (row, {
Size = .(, -, , ), Text = , TextSize = , TextColor3 = C.dark,
}, C.accent, .(, , ))
(playBtn, )
stopBtn = (row, {
AnchorPoint = .(, ), Position = .(, , , ), Size = .(, -, , ),
Text = , TextSize = ,
}, C.card2, C.bad)
(stopBtn, )
togBg = (, {
Size = .(, ), AnchorPoint = .(, ), Position = .(, -, , ),
BackgroundColor3 = WHITE, ZIndex = ,
}, gui)
(togBg, )
(togBg, C.accent, C.accent2, )
togStroke = (togBg, WHITE, , )
toggle = (, {
Name = , Size = .(, ), AnchorPoint = .(, ),
Position = .(, -, , ), BackgroundTransparency = , Text = ,
Font = FONT_B, TextSize = , TextColor3 = C.dark, AutoButtonColor = , ZIndex = ,
}, gui)
miniStop = (, {
Name = , Size = .(, ), AnchorPoint = .(, ),
Position = .(, -, , -), BackgroundColor3 = C.bad, Text = ,
Font = FONT_B, TextSize = , TextColor3 = WHITE, AutoButtonColor = , Visible = , ZIndex = ,
}, gui)
(miniStop, )
(miniStop, WHITE, , )
()
miniStop.Visible = playing
(togStroke, , {
Color = playing C.good WHITE,
Transparency = playing ,
})
()
(v)
panelOpen = v
panel.Visible = v
v
scanActive
scanActive =
box.Visible =
()
scale.Scale =
(scale, , { Scale = })
()
(v)
boxOn = v
(boxBtn, , {
BackgroundColor3 = v C.accent C.card2,
TextColor3 = v C.dark C.muted,
})
()
()
toggle.MouseButton1Click:(() ( panelOpen) )
hideBtn.MouseButton1Click:(() () )
boxBtn.MouseButton1Click:(() ( boxOn) )
miniStop.MouseButton1Click:(() playing = )
(handle, begin, update, allowed)
active, origin, state
handle.InputBegan:((i)
(i.UserInputType == .UserInputType.MouseButton1 i.UserInputType == .UserInputType.Touch)
( allowed ())
active =
origin = i.Position
state = ()
i.Changed:(()
i.UserInputState == .UserInputState.End active =
)
)
conns[#conns + ] = UIS.InputChanged:((i)
active (i.UserInputType == .UserInputType.MouseMovement i.UserInputType == .UserInputType.Touch)
(state, i.Position - origin)
)
(box,
() box.Position ,
(p, d) box.Position = .(p.X.Offset + d.X, p.Y.Offset + d.Y) ,
() playing boxOn )
(grip,
() box.AbsoluteSize ,
(s, d) box.Size = .(.(, s.X + d.X), .(, s.Y + d.Y)) ,
() playing boxOn )
(header,
() panel.Position ,
(p, d) panel.Position = .(p.X.Offset + d.X, p.Y.Offset + d.Y) )
(o)
p = o
p p ~= playerGui
p:()
p.Visible
p:()
p.Enabled
p = p.Parent
()
bp, bs = box.AbsolutePosition, box.AbsoluteSize
found = {}
_, o (playerGui:())
o:() o:(gui)
isBtn = o:()
isLbl = o:() (o.Text) ~=
o:()
(isBtn isLbl) o.AbsoluteSize.X > o.AbsoluteSize.Y >
c = (o)
c.X >= bp.X c.X <= bp.X + bs.X c.Y >= bp.Y c.Y <= bp.Y + bs.Y (o)
found[#found + ] = { obj = o, x = c.X, y = c.Y, h = o.AbsoluteSize.Y }
.(found, (a, b)
.(a.x - b.x) < a.y < b.y
a.x < b.x
)
i, k (found) k.i = i
detected = found
boxLabel.Text = .. #found ..
.(()
gui.Parent
scanActive playing
(scan)
()
.() > lockUntil
#detected >
( .. #detected .. , )
(, )
.()
)
songs = {}
selected =
loadState =
btnSong = {}
()
_, c (list:())
c:() c:()
btnSong = {}
q = search.Text:()
n =
_, s (songs)
q == s.label:():(q, , )
n +=
n >
b = (, {
Size = .(, -, , ),
BackgroundColor3 = (s == selected) C.accent2 C.card2,
Text = s.label, Font = FONT, TextSize = , TextColor3 = C.text,
TextXAlignment = .TextXAlignment.Left, TextTruncate = .TextTruncate.AtEnd,
AutoButtonColor = , LayoutOrder = n,
}, list)
(b, )
(b, , )
btnSong[b] = s
b.MouseButton1Click:(()
selected = s
songLabel.Text = .. s.label
btn, sg (btnSong)
(btn, , { BackgroundColor3 = (sg == selected) C.accent2 C.card2 })
)
n ==
msg = (loadState == )
(loadState == )
(list, { Size = .(, , , ), Text = msg, TextSize = , TextColor3 = C.muted })
search:():(renderList)
()
.(()
httpRequest
loadState =
()
(, , )
ok, res = (httpRequest, { Url = , Method = })
ok res res.StatusCode ==
okJ, data = (HttpService.JSONDecode, HttpService, res.Body)
okJ
_, s (data)
songs[#songs + ] = {
label = (s.name) .. .. (s.artists),
file = s.midiFilename,
}
loadState =
()
loadState =
()
(, , )
)
()
playing =
()
(barFill, , { Size = .(, , , ) })
()
playing
selected
(, , )
(scan)
()
#detected ==
(, , )
playing =
()
keys = detected
N = #keys
(, )
url = .. (selected.file:(, ))
ok, res = (httpRequest, { Url = url, Method = })
playing
(, , )
()
ok res res.StatusCode ~=
(, , )
()
okP, notes = (parseMidi, res.Body)
okP #notes ==
(, , )
()
diatonic
modeIdx ==
diatonic = (keys)
diatonic = (modeIdx == )
mapper = (notes, N, diatonic)
maxChord = (N <= )
spd = speed
total = .(notes[#notes].time, )
songLabel.Text = .. selected.label
((diatonic ) .. .. N .. .. .(, spd), )
t0 = .()
i =
i <= #notes playing
target = notes[i].time / spd
now = .() - t0
target > now .(target - now)
playing
group = {}
j = i
j <= #notes notes[j].time / spd - target <
group[#group + ] = notes[j].n
j = j +
.(group, (a, b) a > b )
chord, seen = {}, {}
_, nn (group)
idx = (nn)
seen[idx] keys[idx + ]
seen[idx] =
chord[#chord + ] = keys[idx + ]
#chord >= maxChord
.(pressMany, chord)
barFill.Size = .(.(notes[i].time / total, , ), , , )
i = j
songLabel.Text = .. selected.label
(playing , playing , )
()
playBtn.MouseButton1Click:(() .(play) )
stopBtn.MouseButton1Click:(() playing = )Good for Aura farming

Universal