=== PTPiano ===
Contributors: santechidea,plugintutor
Donate link: https://paypal.me/SANTECHIDEA
Tags: piano, interactive piano, browser piano, music learning, piano learning
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.3.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

PT Piano is an interactive, browser-based virtual piano plugin — the ultimate tool for online piano learning, playing, and musical practice.

== Description ==

PT Piano is a responsive, feature-rich **virtual piano plugin** designed specifically for **online piano learning, playing, and practice** directly inside the browser. It integrates a premium, interactive virtual keyboard to play notes, view chord structures, explore scales, and study music theory without installing any external software.

Whether you are hosting an online music academy, writing interactive blog tutorials, or creating a digital workspace for composers, PT Piano delivers a professional-grade learning tool. It supports real-time Web MIDI input, built-in recording options, and custom settings, making it the ultimate tool to **learn and play piano online**.

Key features:

- Fully interactive piano keyboard with 41-key range (notes C4 to E7)
- 80+ high-quality MIDI instrument sounds (Grand Pianos, Organs, Strings, Brass, woodwinds, synths, and SFX presets)
- Indian Raag visual scale mapping visualizer (10 Thaats, 10 popular Raags)
- Custom note and chord highlighting overlay
- Browser-based MIDI recording and export features
- Integrated customizable Reverb (Hall, Room, Plate convolver settings)
- Ideal for music education websites or online lessons
- Fully responsive across desktop, retina, tablet, and mobile screens

This plugin is designed with simplicity and education in mind, making piano accessible to everyone.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/PTPiano` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Use the `[PT-Piano]` shortcode to embed the piano anywhere on your site (posts, pages, etc.).

== Frequently Asked Questions ==

= Can I use this plugin on mobile devices? =
Yes! PT Piano is fully responsive and works on all major mobile browsers.

= Does this plugin require JavaScript? =
Yes, the interactive features are powered by lightweight JavaScript for smooth performance.

= Can I customize the keyboard colors or layout? =
Customizations can be made via PTPiano Plugin Setting Dashboard, a visual customizer.

== Screenshots ==

1. Embedded interactive piano keyboard on a post.
2. Settings Control Option in the admin dashboard.
3. Settings Piano Option in the admin dashboard.
4. Record and Play Piano session in real time.

== Changelog ==

= 1.3.7 =
* Added: Keyboard expanded to 41 keys mapping notes C7 to E7 (totaling 3 full octaves + 5 notes)
* Added: Instrument selection containing 80+ high-quality MIDI sound presets (Grand Pianos, Organs, Orchestral Strings, woodwinds, synths, and SFX)
* Added: Responsive key sizing using viewport width (vw) for high-resolution retina & 4K display monitors (e.g. 2880x1800)
* Added: Custom warning modal popup overlay (`#saveWarningPopup`) replacing browser alert when saving a blank recording
* Added: Cyber-cyan LCD hardware synthesizer aesthetic for tempo dial screen with glowing hover circles
* Fixed: Sustain pedal (paddleBtn) chord-triggering limit - now plays up to 6 highlighted notes instead of aborting
* Fixed: Reverb initialization and selection bugs – saves selected IR to database and loads it on startup
* Fixed: Resized Settings and Sound Library buttons to identical 28px circles with inline horizontal center alignment
* Fixed: Sustain pedal cover and button sizes in media queries – replaced scaling zoom with absolute layout dimensions
* Improved: Consolidated scale/chord markup JS code by creating `piano.chords-scales.js` and removing duplicate files

= 1.3.6 =
* Added: RGB dancing glow ring on speaker icons – activates when Play button is pressed, stops on Stop
* Added: Speaker glow uses smooth RGB color cycling animation with breathing pulse effect
* Added: Indian Raag selector in control bar – choose from 10 Thaat parent scales and 10 popular Raags
* Added: Selecting a Raag auto-maps the correct scale numbers so the movable scale updates instantly
* Added: "Select Raag" default option resets scale to Bilawal-based (1, 3, 5, 6, 8, 10, 12)
* Improved: Fully responsive layout redesign across 4 breakpoints (1280px, 992px, 768px, 480px)
* Improved: Header grid stacks to single column on mobile with centered controls
* Improved: Piano keys scale proportionally using viewport units with proper min-width values
* Improved: Mobile phones (≤768px) show only 1 octave (12 keys) to fit screen without overflow
* Improved: Controls (volume, buttons, tempo, equalizer, chord selects) wrap and resize for mobile
* Improved: Scale track and cells shrink progressively at each breakpoint
* Improved: Right column (settings, song library, pedal) displays horizontally on tablets
* Improved: Pedal hidden on mobile devices (≤768px) for cleaner touch experience
* Fixed: Piano keys not producing sound on mobile – added touchstart event alongside click
* Fixed: CSS file corruption from previous edits – fully rebuilt from SVN base with all additions
* Fixed: Speaker glow ring positioning – now perfectly centered on speaker image using transform
* Fixed: Scale cell vertical alignment – cells centered within dashed track rail

= 1.3.5 =
* Tested: Verified compatibility with WordPress 7.0
* Improved: Scale indicator above piano keys – now shows 7 buttons (sa, re, ga, ma, pa, dha, ni) with premium design
* Improved: Scale buttons feature bottom arrow pointers toward piano keys with glowing text effects
* Improved: Draggable scale now snaps to nearest piano key and recalculates positions using major scale intervals
* Improved: Scale correctly aligns to both white and black keys when dragged to any root position
* Improved: Tempo control redesigned with musical BPM range (60–180) in 10 BPM steps
* Improved: Tempo ranges follow musical standards – Slow 60-90, Medium 90-120, Dance 120-140, Fast 140-180
* Improved: Tempo buttons accelerate on long press (10 → 20 → 30 BPM steps)
* Improved: Default tempo changed to 120 BPM (Medium / Pop groove)
* Fixed: Tempo changes now correctly affect playback speed after recording
* Fixed: Recording tempo stored separately so playback scaling works relative to original recording speed
* Fixed: Duplicate PianoRecorder instance that caused tempo sync failure between controls and playback
* Fixed: MIDI permission popup no longer appears on pages without the piano
* Fixed: Web MIDI alert replaced with console warning for unsupported browsers
* Updated: All register_setting() calls modernized to use $args array format for WordPress 7.0 compatibility
* Updated: wp_localize_script() on non-existent handle replaced with wp_add_inline_script()
* Updated: Removed duplicate constant definitions and duplicate admin menu hook
* Updated: Scale CSS overflow changed from auto to visible to prevent button clipping
* Updated: MutationObserver added to re-render scale when piano content becomes visible after loader

= 1.3.4 =
* Improved: Song Manager UI with enhanced table layout and styling
* Improved: Input fields for better usability (multiline notes support)
* Improved: Button alignment and overall admin interface design
* Fixed: Escaping and sanitization issues coding standards compliance
* Fixed: Minor UI inconsistencies in settings panel
* Fixed: Plugin Check warnings and code quality improvements
* Fixed: MIDI alert unwanted warning removed

= 1.3.3 =

* Added Song Library system for admin to save songs with name, scale, and notes

* Introduced Learning Mode with step-by-step key highlighting

* Added Auto Play Mode to automatically play and highlight piano notes

* Implemented real-time key detection to move to next note when correct key is pressed

* Added popup interface for song selection and controls

* Improved UI feedback with key glow and guide highlight effects

* Minor UI and performance improvements

* Added popup interface for settings and controls

= 1.3.2 =

* Bug Fixed

* Introduced Tempo setting to allow users to control their recording tempo.

* Added a button to play multiple piano button simultaneously for major, minor, diminished, and augmented chords.

* Enhance the user interface of plugin piano.

= 1.3.1 =

* Minor Modification on Piano Keyboard

= 1.3.0 =

* Bug Fixed

= 1.2.9 =

* Added complete note mappings for major, minor, diminished, and augmented chords.

* Introduced a new setting to allow users to control their recording duration from the Settings page.

* Enhanced the visual design of piano keys, including full key highlights when a chord or scale is selected.

* Optimized script loading so that it only runs on the plugin page, preventing unnecessary execution on other pages.

* Fixed various internal bugs to improve overall performance and stability.

= 1.2.8 =

* New Features:

- MIDI Connector Added: Connect your MIDI piano keyboard directly to the plugin.

- Live Playback: Play your MIDI keyboard using your physical piano in real time.

- MIDI Recording & Download: Record your sessions and download them as MIDI files.

* User Interface Enhancements:

- Updated the Play, Record, and Clear buttons with a more professional and modern look.

* Security & Bug Fixes:

- Implemented security enhancements.

- Fixed various bugs and improved overall performance.

= 1.2.7 =

* UI Enhancements :
- Improved the user interface of the PTPiano plugin for better usability and appearance.

* New Feature : 
- Record Button : Added a Record button to allow users to record their piano sessions in real-time.

- Play Button :Introduced a Play button to instantly listen to your recording after capturing it.

* Security Updates :
- Implemented security improvements to make the PTPiano plugin more secure and stable.

= 1.2.6 =

* Bug Fix

= 1.2.5 =
*New Feature: 
- Added a Note Display Box : As you play the piano, the corresponding notes are displayed in a scrollable area.

- Introduced a Clear Button to easily clear the note display box.

- UI Enhancements: Improved responsiveness and layout for a better mobile experience.

= 1.2.4 =
✨ New Features:

Computer Keyboard Names Added: Users can now play the piano easily using their computer keyboard. Key mappings are displayed for better accessibility.

Separate Toggles for Notes & Key Labels: Introduced independent toggle options to show/hide musical notes and keyboard labels for more customizable learning and playing experience.

🎨 UI/UX Enhancements:

Improved User Interface: Refreshed design for a more modern and intuitive experience.

Mobile Responsiveness: Enhanced layout and controls to ensure seamless usability across all screen sizes and mobile devices.

Settings Page Redesign: Cleaner and more user-friendly interface on the settings page for easier configuration.
= 1.2.3 =
* New Features:
- 🎹 Augmented Chord Support: Now includes augmented chords for richer harmonic options.
- 🎹 On-Screen Keyboard Expanded: Added a 2-octave virtual keyboard for easier playing and composition.
- 🎛️ Reverb Effect: Introduced built-in reverb to enhance the piano sound with more depth and ambiance.

*Improvements:
🧩 UI Enhancements: Updated interface with better layout, improved responsiveness, and a more intuitive user experience.

*Security:
🔒 Security Update: Patched vulnerabilities and improved overall application security.

= 1.2.2 =
* Settings Page Updates:
- Added confirmation message, after saving options in settings page.
- Added multiple note display options in settings page:
  C, D, E... (letters)
  Do, Re, Mi... (solfège) 
      सा, रे, गा... (Indian / Hindi)
* Major, Minor, and Diminished chord highlighting updated to support all note display modes.
* Improved overall UI separation with loader overlay and smooth content reveal.
* Enhanced volume control slider style for better usability and modern look.


= 1.2.1 =
* Added new functionality:
  - Major Scale and Minor Scale selection with note highlighting on the piano.
* Improved mobile responsiveness:
  - Piano logo and title now display inline on smaller screens.
  - Chord input section (toggle + text input) aligns horizontally on mobile view.
  - Volume control now spans 100% width for better usability on mobile devices.


= 1.2.0 =
* Added theme selector for piano background styles
* Introduced customizable colors for controls and marks
* Enhanced shortcode support with dynamic styling
* Added toggle switches for chord visibility (major, minor, dim)
* Improved frontend CSS variable injection
* Security improvements: escaped URLs, `ABSPATH` checks

= 1.1.0 =
* Support for note and chord highlighting
* Shortcode support

== Upgrade Notice ==

= 1.2.0 =
Improved visual customization and security. New theme and color options added in plugin settings. Update recommended.

= 1.1.0 =
First stable release of PT Piano.
* Initial release with full keyboard functionality