♪♫ It's A Self-Playing Piano! (Pianola) ♪♫

ozu_Pianola.js 1.3
by ozubon

Introduction

This silly plugin attempts to create procedural music based on music theory.

The pianola creates a song for itself, with varying length, scale, key, chords and fullness. When it's done playing its song it will make a new one. And a new one. Forever.

Maybe use it for the piano player at the inn, for ambient adventure music or a haunted piano?

It's entirely a sound plugin but why not show it off with a piano dance:




How to use
To make a pianola you need a parallel event.

Step 1: Add a Wait to the event, this adjusts the tempo of the pianola.
The Wait defines how long a quarter note should be.
So Wait set to 30 roughly translates to 120 bpm (allegro moderato), a very popular tempo.

The longer the Wait the slower the music. If you're unsure, set Wait to 30.
Without a Wait it will be a confused, cloudy and loud ooze of sound.

Step 2: Use script call and enter pianola()
That's it! The event will now play the piano!

Bonus: You can define a max volume, for example 50, like this: pianola(50)

easy.PNG


How to install
Move the included audio files to your audio/se folder.
Put ozu_Pianola.js in your plugins folder and load it in the plugin manager as usual!


Terms of use
Credit me 👋
Free to use even commercially. If you want to publish an edit or include it in a plugin pack you must distribute it with the same terms of use.


Plugin

Credit
ozubon​
@ozubon Can you please add to the Terms of Use if it is available for commercial/non-commercial, etc?
@mlogan certainly, it is done.
This sounds sweet enough to just mess with. I followed your instructions and got a whole lot of missing file errors. The same when I tried with a completely blank project. Could just be a weird issue with Linux and filenames. But if it is, it means you'll see the same problem with Android exports.

error.jpg
@ImaginaryVillain could be due to the # in the filenames or them being in their own folder or both. I'll fix this, I don't think there should be any other reason that makes it not work on linux.
ya was gonna post same error, might as well since im here.


error.png
I've updated it and it uses other filenames now. Will you please see if it works now? If it doesn't I'll do a final fix which also removes the folder part. Thank you!
What an amazing plugin. This is going to be very useful if users are going to do projects based on horror or survival horror games.
I've updated it and it uses other filenames now. Will you please see if it works now? If it doesn't I'll do a final fix which also removes the folder part. Thank you!
ya try final fix please. i still get same error.
@Oscar92player
Thank you kindly, I've thought about adding the ability to mess with some settings for those kind of purposes. So you can make it only play the moody scales and minor chords if you want. On the other hand, happy music makes the best horror music. Maybe in a future version if it's something people want.

@Raggon Alright, download again. It should work now, no weird file names, no folder, put the new audio files straight to your se folder.

Version 1.2
  • Linux compability should be fixed now
  • Songs have the possibility to be slightly longer
This is a fun plugin. It adds a little variety to some background noise/music. Thank you for making this ^_^
Works perfectly! Nice plugin!
Thank you both! 🙏

Version 1.3
  • Fixed panning being unevenly distributed
  • Reworked panning to be slightly wider and different for each note. Unrealistic sure but sounds great!
I really like v1.3 with a 10 second wait. Better be careful, if you make it too good the musicians on the forum might come for you one night to silence you. :LZSwink:
Sticks and stones may break my bones but our robot overlords will prevail
Wow, that’s really cool! Thank you for this plugin.

I found out that when you put the game “out of focus” (or minimize its window etc) the tune stops and then resume whenever you bring the window back, the funny thing is it will keep playing the tune as long as there’s still some pixels of the window visible haha, for example if you slowly drag another window on top of it (like Chrome or whatever) it keeps playing until 100% covered, what a weird behavior. Nothing really problematic imo, and it probably has nothing to do with your plugin.


Do you think we could have an option to deactivate it on the fly, I found a way but it can be problematic depending on the situation: you simply add another (empty) page to the parallel event with a switch as a condition, and when you want the music to stop you turn that switch ON. Might do the trick for most situation. In case we need to play a different music and don’t want the piano to overlap.


Something more important to some people might be to have the piano keep playing when entering a fight, don’t know if it’s possible. When I try, the piano stops directly when the “encounter sfx” plays.

Again, good job and thank you! Great unusual plugin.
Oh hey thank you for your support @KaYsEr!

That's funny, the pianola is a true entertainer, will only play when you're paying attention :LZSlol:

Sure I could add a toggle function in the next version, but I'm not sure how much more functionality that servers than having the pianola() script call inside a conditional branch checking a game switch. I kind of want this to be a simple plugin and I'm split between keeping it that way or adding more settings to it.

Aditionally you could have the pianola in a parallel common event and just turn off its switch. That's probably the easiest way!

That brings me to your second question. Since it depends on the game's Wait mechanism making it battle compatible would require a lot of extra work.

There's this plugin I haven't tested but if it does what is says I think having the pianola in a parallel common event should work:
Additionally, you could have the pianola in a parallel common event and just turn off its switch. That's probably the easiest way!
This is what I have done with it. It's simple and easy to control that way.

I do not think you need to add much more functionality to it. As is, it's already unique amongst a sea of plugins and makes for nice variations for music in a procedural way ^_^.
Really good plugins. Maybe this is a small music game that teaches people to play the piano.
It's amazing. A magical thing happened with just 185 lines of code.

Original thread: https://forums.rpgmakerweb.com/threads/its-a-self-playing-piano-pianola.120116/