What is the Classical Piano Soundpack?
The Classical Piano Soundpack is an script that lets instrument makers play any piano note sound through the use of linked messages. Use this script or API with any object to easily create piano instruments that can play all 88 keys.
Contents
Quick Start
Once you have the Classical Piano Soundpack, start by rezzing a new object on the ground, which will serve as the base for your piano instrument. Look at the notecard in the same folder as the Classical Piano Soundpack script for crucial setup instructions. After completing the steps in the notecard, create a new script in the object and name it "Piano Driver" or any other name you prefer.
Next, open the Piano Driver script and start adding LSL code that can interact with the Piano Soundpack API. Here's an example script that plays a C major chord when you click on the object.
Playing Different Notes
Great job! You've successfully set up your piano script. Now you can experiment with different notes and create various chords. To play a C minor chord instead of a C major chord, you’ll need to modify the script slightly. Simply change one of the note numbers to transform the sound.
Understanding API Calls
A piano has 88 keys, and each key corresponds to a unique Classical Piano note number. The Classical Piano specification allows for 128 different note numbers, ranging from 21 to 108. Here's how these numbers relate to the piano:
Classical Piano Note Range for a Standard Piano
- Lowest Note (A0): Classical Piano note number 21
- Highest Note (C8): Classical Piano note number 108
Breakdown of Classical Piano Note Numbers
Octave | Note Names | Classical Piano Numbers |
---|---|---|
Sub-Contra | A0, A♯0/B♭0, B0 | 21, 22, 23 |
Contra | C1, C♯1/D♭1, D1, D♯1/E♭1, E1, F1, F♯1/G♭1, G1, G♯1/A♭1, A1, A♯1/B♭1, B1 | 24-35 |
Great | C2, C♯2/D♭2, D2, D♯2/E♭2, E2, F2, F♯2/G♭2, G2, G♯2/A♭2, A2, A♯2/B♭2, B2 | 36-47 |
Small | C3, C♯3/D♭3, D3, D♯3/E♭3, E3, F3, F♯3/G♭3, G3, G♯3/A♭3, A3, A♯3/B♭3, B3 | 48-59 |
1-line | C4, C♯4/D♭4, D4, D♯4/E♭4, E4, F4, F♯4/G♭4, G4, G♯4/A♭4, A4, A♯4/B♭4, B4 | 60-71 |
2-line | C5, C♯5/D♭5, D5, D♯5/E♭5, E5, F5, F♯5/G♭5, G5, G♯5/A♭5, A5, A♯5/B♭5, B5 | 72-83 |
3-line | C6, C♯6/D♭6, D6, D♯6/E♭6, E6, F6, F♯6/G♭6, G6, G♯6/A♭6, A6, A♯6/B♭6, B6 | 84-95 |
4-line | C7, C♯7/D♭7, D7, D♯7/E♭7, E7, F7, F♯7/G♭7, G7, G♯7/A♭7, A7, A♯7/B♭7, B7 | 96-107 |
5-line | C8 | 108 |
Example of Classical Piano Note Numbers for Common Piano Notes
- Middle C (C4): Classical Piano note number 60
- A4 (440 Hz, concert pitch): Classical Piano note number 69
- Highest C (C8): Classical Piano note number 108
Using Classical Piano Note Numbers in a Script
When working with Classical Piano in scripts, these numbers are used to represent the notes that are played. For
example,
in the syntax
"60,1, 63,1, 67,1"
, the numbers 60, 63, and 67 correspond to specific notes:
- 60: C4 (Middle C)
- 63: E♭4
- 67: G4
Volume Levels
The second number in each pair represents the volume, ranging from 0 to 1:
- 0: Silent
- 0.5: Half Volume
- 1: Full Volume
How to Play Different Chords
To play different chords or notes, you adjust the Classical Piano note numbers in your script. Here are a few examples:
Conclusion
Understanding the full range of Classical Piano note numbers allows you to create a wide variety of musical compositions using the piano's 88 keys. Whether you're composing simple melodies or complex harmonies, the Classical Piano system provides precise control over pitch and volume, making it an essential tool for digital music production.
Getting Creative with Instruments
In this guide, we'll create a synth pad with four buttons in the Second Life virtual world, each playing a different chord using the Classical Piano soundpack. When you press a button, it sends a message to trigger the corresponding chord. Feel free to start this tutorial from scratch or get the finished product on the MP for free.
Step 1: Build the Synth Pad Interface
In Second Life, you can create a simple interface with four buttons arranged as a synth pad. Each button represents a different chord.
- Create four cube prims in your Second Life environment.
- Arrange them in a grid or row to form the synth pad interface.
- Name each button with the corresponding chord.
Step 2: Script the Buttons
Each button needs a script to send a message when clicked, triggering the corresponding chord. Below are the scripts for each button.
Step 3: Putting Everything Together
-
Link the Four Cubes:
Link the four cubes you created in Second Life into a single object.
- Select all four cubes by holding the
Shift
key and clicking each cube. - Once selected, right-click on one of the cubes and choose
Link
from the menu. This will combine them into a single object, with the last cube selected as the root prim.
- Select all four cubes by holding the
-
Navigate to Your Inventory:
Open your inventory and locate the folder containing the
Classical Piano Soundpack
. - Follow the Instructions: Inside the folder, look for the notecard that contains activation instructions. Follow these instructions carefully to ensure proper setup and activation of the soundpack.
-
Add the Classical Piano Soundpack Script:
Drag the
Classical Piano Soundpack
script from the inventory folder into the linked object's root prim.- Right-click the linked object and select
Edit
to open its contents tab. - Make sure the script is correctly placed in the contents of the root prim to enable the sound functionality.
- Right-click the linked object and select
You’re all set to test it out! Click on each button on your synth pad to hear the different chords being played. Try pressing the buttons below to play the Japanese school bell:
Conclusion
This setup provides a basic synth pad in Second Life, allowing you to explore creativity and musical expression. Feel free to expand on this concept by adding more buttons, experimenting with different chords, or integrating additional effects to create a more dynamic and interactive musical experience!