Author Topic: [XP] Berans' Interactive Piano Script v1.12  (Read 13407 times)

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
[XP] Berans' Interactive Piano Script v1.12
« on: August 23, 2008, 03:51:02 PM »
Berans' Interactive Piano Script
Authors: Berans, Blizzard
Version: 1.12
Type: Interactive Music Player
Key Term: Misc System

Introduction
This script creates a virtual piano keyboard to play some tunes on. It makes use of Custom Game Controls in "Tons of Add-ons" by Blizzard to allow full keyboard functionality.
Now included "code input" functionality

Features

  • 4-octave, 48 key, piano keyboard
  • Graphics and Sound samples supplied in the demo
  • Uses Custom Game Controls from "Tons of Add-ons" by Blizzard
  • Virtually lagfree
  • Hours of fun
  • NEW: Now features brand-new "Code Input" functionality

Screenshots

(click to show/hide)


Demo

Demo
New demo, version 1.12 ^_^

Script


(click to show/hide)
Insert the script above main and under the standard scripts.
NOTE: Graphics and audio files are needed for this script to work, get them from the demo.

Instructions

Instruction inside the script

Compatibility

This is NOT compatible with custom input modules other than Blizzard's Custom Game Controls in Tons of Add-ons.
Blizzard's Custom Game Controls is required to use this script.
Other than that, this script should have no compatibility issues and will function independantly.

Credits and Thanks

  • Berans - Creating the script, graphics and audio samples
  • Blizzard - Use of his Input module and inspiration

Author's Notes

Just have fun with this. Once again, I've more or less hidden access to the scene, just for laughs.
Please credit me if you use this in a project.
« Last Edit: July 26, 2009, 09:54:30 PM by Blizzard »

Offline Starrodkirby86

  • Kirby de Varita Estelar
  • Guardian of Chaos
  • ********
  • Posts: 3281
  • LV: 194
  • Gender: Male
  • ~!
    • View Profile
    • The Archive of Starrodkirby86
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #1 on: August 23, 2008, 04:31:06 PM »
This is a very great Piano Script. I still want rhythmical codes. It took a while for me to find out the Rock produced the piano. However, I think you should rename the download link so people won't be confused that it's the not fully the Drum Demo. My only issue with the Piano script is that some of the sounds...well, sound...electrical, like the unexpected zap sound.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).



Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #2 on: August 23, 2008, 04:49:46 PM »
Yeah, that's my crappy comp for ya....
To make the sounds I actually recorded a midi player making piano sounds and edited them to the right length. I basically had a jack running directly from my headphones port to my mic port. It was quite a lot of work, but the easiest way I could think of to get consistant sounds for the full 4-octav e range...
The buzzy noises are just my crappy laptop, you'll have to just ignore them :P
I might re-record some of the bad sounds. But the emphasis was more on creating the script, since it's fairly easy for the user to provide their own unique sounds.
I updated the download link as well, and I'm still working on the actual concept of the rythm codes (as well as album cover art/track info pop-up windows for my iPod script...loads to do)

Offline Starrodkirby86

  • Kirby de Varita Estelar
  • Guardian of Chaos
  • ********
  • Posts: 3281
  • LV: 194
  • Gender: Male
  • ~!
    • View Profile
    • The Archive of Starrodkirby86
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #3 on: August 23, 2008, 04:53:59 PM »
Sorry for all the work, but it's all for the better I suppose. You know, there's a recording method known as Stereo Mix which rips the sound being played. Some computers have them. I don't for sure if your computer does, but to get there, simply go to the Recording Volume Section and check Stereo Mix instead of Mic Volume. :)

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).



Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #4 on: August 23, 2008, 05:07:19 PM »
I'm gonna see if I can use Audacity to do it, I'll try to re-record all the sounds if things go well and update the demo
EDIT: I'm re-uploading the demo with slightly improved soundfiles. My internet's not liking me though, so please be patient while the demo's down.
The keys with the weird buzzing noise now no longer have it, though there is still a little bit of weird static that I couldn't really get rid of.
EDIT2: Updated the demo, going to sleep :P
Maybe I'll script something genuinely useful in the next couple of days rofl
« Last Edit: August 23, 2008, 06:11:58 PM by Berans »

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Male
  • Wants to write a compiler for fun
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #5 on: August 23, 2008, 08:13:36 PM »
windows Media encoder can do that. just play the sound and have it encode it into a windows Media format (that is the only down side)
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Shadonking

  • Astral Trancist
  • *****
  • Posts: 756
  • LV: 16
  • Gender: Male
  • Your Worse Nghtmare
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #6 on: August 23, 2008, 09:22:25 PM »
it keeps coming up with this error.

line 123 uninatialized constant input :: ONE

ps cant wait to try it





Creator Of Music And Games
(click to show/hide)
(click to show/hide)

come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #7 on: August 24, 2008, 03:09:40 AM »
My first, educated guess, you don't have the "Custom Game Controls" add-on in Tons of Add-ons set up the way it's in the demo. If you don't have it set up like that, it won't work, since the script heavily builds on the custom input module to allow for 48 different keys

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20005
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #8 on: August 24, 2008, 03:22:22 AM »
You should add this in your script, Berans:

Code: [Select]
if $tons_version == nil || $tons_version < 6.56
  raise 'This script requires Custom Game Controls from Tons of add-ons. Please get Tons of Add-ons 6.56 or higher.'
end

^_^
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.00
« Reply #9 on: August 24, 2008, 04:20:24 AM »
Will do. Also I'll be updating the script in a second with a brand-new, well-anticipated feature....CODE  INPUTS!!!
Yes people, he's done it again. Read the new script's instructions for notes on how to use this feature.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20005
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Berans' Interactive Piano Script v1.11
« Reply #10 on: August 24, 2008, 04:28:14 AM »
Lol, you remind me of me when I had only a couple of scripts released. I also had a couple of updates on some scripts within a few days. :xD: Nice work, keep it up. :)
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.11
« Reply #11 on: August 24, 2008, 04:32:59 AM »
I'm thinking of an actual useful script to write though :P
The code input functionality at least gives the piano some use, apart from just beeing fun.
I'm putting it in the drum script as well for the sake of things...
UPDATED to v1.12. Improved the parsing so that input codes that take up more than a line now get properly processed
« Last Edit: August 24, 2008, 01:05:35 PM by Berans »

Offline Shadonking

  • Astral Trancist
  • *****
  • Posts: 756
  • LV: 16
  • Gender: Male
  • Your Worse Nghtmare
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #12 on: August 24, 2008, 06:31:58 PM »
iv got it working now, its cool and i have to have it in my game.

POWERSUP





Creator Of Music And Games
(click to show/hide)
(click to show/hide)

come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #13 on: August 25, 2008, 12:35:36 AM »
For those of you who want to base parallel process/autorun events off a switch turned on in the script, there's a line I forgot to add that you'll need.
All the way at the bottom of the main method under the line
Code: [Select]
$game_system.bgs_restore
add the line
Code: [Select]
$game_map.refresh
that'll make sure that the switches are updated

Offline Shining Riku

  • Ethereal Devastator
  • ****
  • Posts: 266
  • LV: 7
  • Gender: Male
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #14 on: August 27, 2008, 11:06:13 PM »
Hello! This is just a question, but could this be used to play a specific tune?

Let me elaborate a teensy bit. In a game i'm working on, I was going to have it that the
heroes had to find an ancient song to unlock the power of one of their legendary weapons. Then, they'd have to play the song...

I'd love to use this script as a part of that event. Now, to clarify my question, could the player play a tune with this and trigger an event? If it works like that, AWESOME! If not, this is still an incredible script. I was just wondering if it'd work like how I mentioned. :haha:

Thanks for listening! And good luck on any future scripts!

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #15 on: August 27, 2008, 11:23:46 PM »
Actuallly, yes. The latest version of the script contains a functionality that allows you to create "unlockable codes"
I'll give you a quick rundown of how it works.
When you call the scene, rather than just calling it using $scene = Scene_Piano.new
you now call it like so
$scene = Scene_Piano.new(switch,code,mode)
replace switch with the switch number you want to affect, replace code with an "input code" and mode with the mode you want to open the scene in (see more info in the script.)
Your code should look something like
'C1B2As3....'
Make sure you include the quotation marks (and don't include the dots)
Basically, each of the bits before a number represents a note
For simplicity's sake (though I obviously know it's incorrect) I've called all the black keys "sharps"
Here's what you can choose from for the code
C1, Cs1, D1, Ds1, E1, F1, Fs1, G1, Gs1, A1, As1, B1

The 1 can also be a 2, 3 or 4 depending on which octave you want it played.
When you call the script like that, if you get the code right, the switch number you've put in will be set to true (ON)
otherwise, it'll be set to false (OFF). Feel free to ask anymore questions ;)

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #16 on: August 28, 2008, 12:45:12 AM »
Whoa! That's awesome dude :o You made me consider using this in my game, and for that a well-deserved powerup :D *powers up Berans and Shining Riku*
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Shadonking

  • Astral Trancist
  • *****
  • Posts: 756
  • LV: 16
  • Gender: Male
  • Your Worse Nghtmare
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #17 on: August 28, 2008, 01:31:34 PM »
cool i like the update with the code input, i can make zelda like codes now to use for my game for doors and other stuff.

i could even make it play a song to unlock certian skills or to get over optsicals in the game, hell the posibiltyies are endless.

speaking of zelda you should make the music system on the N64 version (e.g. the stave with the music notes) for the people that want to make a zelda game. there are alot of people makeing zelda games and it would be really useful. just thought it was a good idea
« Last Edit: August 28, 2008, 01:32:38 PM by shadonking »





Creator Of Music And Games
(click to show/hide)
(click to show/hide)

come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Offline Berans

  • Awakened Visionist
  • **
  • Posts: 75
  • LV: 10
  • Gender: Male
  • Corn = win...it's yellow
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #18 on: August 28, 2008, 01:44:38 PM »
I suppose I could consider it at some time, but once I get some of my bigger script requests done I'm gonna move on to my own customization of the battle system lol...so that'll keep me busy for a while.

Offline Boba Fett Link

  • Enterbrain Spy
  • Ethereal Devastator
  • ****
  • Posts: 298
  • LV: 4
  • Gender: Male
  • DANGER ZONE!
    • View Profile
Re: [XP] Berans' Interactive Piano Script v1.12
« Reply #19 on: October 31, 2011, 12:56:57 AM »
I'm getting an error after I call the script. The keyboard appears for a second before I get the error.


Script 'Piano' line 179: NameError occurred.

uninitialized constant Input::ONE

EDIT: *Rereads script instructions* Oops. Forgot to change Tons of Addons.  :facepalm: I was wondering why I didn't have to mess around with it.

EDIT2: Okay, I copied your Tons script into my game, and the piano scene comes up now, but only some of the keys work. Is there a possibility that my custom controls for BABS is messing it up?

EDIT3: Okay, fixed the above problem. I had TONS 7.50B but your demo had TONS 6.56b. I had just copied your entire TONS script 2 because I wasn't currently using anything from it. All I had to do to fix it was get the TONS script 2 from version 7.50B again and then put your custom buttons in.
« Last Edit: November 01, 2011, 01:22:25 AM by Boba Fett Link »
This post will self-destruct in 30 seconds.