Open Source Virtual Pianos

Hiya! If you know me at all or have seen my name somewhere, I’m usually referred to as “That one piano guy” lol. So with that, I’m sure you can assume what this post is going to be about :stuck_out_tongue:

Here, I am releasing some of my more popular Virtual Piano models! Inside you should find some directions and just about everything that you should need! :musical_note:

I ask that you please leave the credits (name) on the models or somewhere in your game description (given you make only minor edits or none at all). For those just using this as a reference, feel free to credit yourself for your hard work! I hope you all enjoy, if there are any issues feel free to drop them down below and I’ll try my best to get back to you all! :musical_keyboard:

Open_Classic_Upright.rbxm (314.7 KB)
Classic_Grand.rbxm (305.8 KB)
Classic_Upright.rbxm (345.0 KB)
Electric_Keyboard.rbxm (146.4 KB)

32 Likes

Alrighty, I understand the problem :laughing:

You want to go inside of studio to open and use .rbxm models. You can’t open them from your files as you would a Roblox game file for instance. When you load up into your studio, you’re going to want to click the ‘Model’ tab, and then insert the model from a file.

Here is a visual if it helps! :yum:

1 Like

You download the model, open a an empty place and drag the file into the place. Is it that hard?

And obviously drop the stuff that are in the Workspace, StarterPlayerScripts and StarterGUI where they are supposed to go.

4 Likes

May I please see photos of it before I download it?

I’m not quite sure I understand what you mean here :sweat_smile:

They are physical piano models that you play using your laptop keyboard. But in order to use them, you have to actually insert the model, they aren’t just audio files of piano music :laughing:

If that helps answer your question any, I glad I could help! If not, shoot me back a message!

Sure! You can check my post here:

I can guarantee you the files are safe, they are in .rbxm format and have been used in Soro’s Italian Restaraunt and Virtual Piano Visualizations! :smile:

@nooneisback and @DeclinedCalls Ooh! I thought they where audio! Not models! :sweat_smile: :flushed:

Really nice models, I don’t know if I’ll ever end up using them, but they work really nice. Though I think the keys should stay dark as long as they are held and return to their color when you release. It feels a bit awkward having a key darkened when you already let go of it, or return to normal when you’re still holding it.

1 Like

The GUI is a bit outdated, I only made the physical models themselves :sweat_smile:

Scripting credits go to:
NickPatella
FumeiSencho
brianops1

1 Like

After 20 minutes of tinkering (the code’s quite a bit of a mess), I fixed that visual feedback issue in the PianoGui portion. Doing the same with the 3D movement and the sound would require adding an additional path for key up, which would probably require a bit of a rewrite.

FixedPianoGui.rbxm (19.1 KB)

EDIT: Forgot to remove a few prints and to clear unneeded connections.

4 Likes

Hey! That’s really nice of you my dude! Keep up the good work!

Hi,

Awesome models by the way.

I’ve seen tons of GUI and script elements and would like to ask you if these are working pianos, and if yes; How exactly do you get them to work?

Instructions are inside! It should be a script labeled ‘READ ME’

1 Like

I’ve tried reading that, hence why I tried to build contact with you here.

The problem is, I don’t really code to be able to read this.

You don’t need to be able to code, just follow the instructions provided in the “READ ME” script. No coding at all is required!

1 Like

I’ve actually realized this is uselss considering roblox’s new audio filtering system has blocked use of the audios needed to play the pianos in the first place!

Sorry to wake up an ond thread, but does anyone know of a way to play a song automatically on loop? sort of how that old autohotkey hack used virtualpiano.net to play these pianos.

Thanks for any help!

The simplest way is to interface with the events that trigger the piano to actually play a note using a table of timings and keypresses.

local bps = 70 / 60
local t = {
    {"i-f"},
    {"s"},
    {"a"},
    {"o"},
    {"i-f"},
    {"u-f", bps * 2}
}
-- equiv. to: "[if] s a o [if]| |[uf]"

local Connector = workspace.GlobalPianoConnector
for _, data in ipairs(t) do
    local waitTime = data[2] or bps
    task.wait(waitTime)
    for _, note in ipairs(data[1]:split("-")) do
        Connector:FireServer("play", note, 1, 0)
    end
end

example song

2 Likes

Thanks for the solution! coukd you tell me where I should insert this script? thanks!

Last night I actually did fiddle with this and figured out you’ll have to do something like this, It doesn’t look nice clarity-wise but it was something I quickly put together:

local bps = (70 / 60) / 3
local transpo = 0
local song = {
    "u-f", "g", "h", "k", "i-f", "|l" ,"s", "|k", ...
}

-----

local Connector = workspace.Pianos.RemoteEvents.GlobalPianoConnector
local letterNoteMap = "1!2@34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm"
local function letterToNote(key)
    local note = letterNoteMap:find(key, 1, true)
    if note then
        return note + trans
end

while true do
    for _, keyData in ipairs(song) do
        if key:match("^|") then
            task.wait(bps / 2)
            key = key:sub(2)
        else
            task.wait(bps)
        end

        for _, key in ipairs(key:split("-")) do
            local note = LetterToNote(key)
            Connector:FireServer("play", { Note = note, Transposition = transpo, Volume = 1 })
        end
    end
end

To be honest, it doesn’t really matter, but for clarity put it inside the piano.

As good as this is, it no longer has a use due to the roblox audio update.

1 Like