Open Source Virtual Pianos

Solution:

(Replace to code from “Settings” with this)

local settings = {}

Piano = script.Parent
Box = Piano.Keys.Camera

--EDIT BELOW----------------------------------------------------------------------
settings.PianoSoundRange = 50

settings.KeyAesthetics = true

settings.PianoSounds = {
	"233836579",
	"233844049",
	"233845680",
	"233852841",
	"233854135",
	"233856105"
}
-- Each note takes up exactly 8 seconds in audio. i.e C2 lasts 8 secs, C2# lasts 8 secs, C3 lasts 8 secs, C3# lasts 8 secs etc. for each audio
-- These are the IDs of the piano sounds.

settings.SoundSource = Piano.Keys.KeyBox

settings.CameraCFrame = CFrame.new(
	(Box.CFrame * CFrame.new(0, 0, 1)).p, -- +z is towards player
	(Box.CFrame * CFrame.new(0, 0, 0)).p
)
-----------------------------------------------------------------------------------

return settings

4 Likes