by crc

Simple Electronic Piano Web Page

Test this app for free
44
import logging
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app

# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()

# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class StandaloneApplication(BaseApplication):
    def __init__(self, app, options=None):
        self.application = app
        self.options = options or {}
        super().__init__()

    def load_config(self):
        # Apply configuration to Gunicorn
        for key, value in self.options.items():
            if key in self.cfg.settings and value is not None:
                self.cfg.set(key.lower(), value)

    def load(self):
Get full code

Simple Electronic Piano Web Page

Created: | Last Updated:

Web page hosting a simple electronic piano that plays sounds when keys are tapped or clicked, with automatic rotation for mobile devices.

Here's a step-by-step guide for using the Simple Electronic Piano Web Page template:

Introduction

This template creates a web-based electronic piano that users can play by clicking or tapping keys. The piano is responsive and automatically rotates for optimal use on mobile devices.

Getting Started

  1. Click "Start with this Template" to begin using this template in the Lazy Builder interface.

Test the Application

  1. Press the "Test" button in the Lazy Builder interface to deploy the application.

  2. Once deployment is complete, Lazy will provide you with a dedicated server link to access the electronic piano web page.

Using the Electronic Piano

  1. Open the provided link in your web browser to access the electronic piano interface.

  2. You'll see a piano keyboard displayed on the screen.

  3. To play the piano:

  4. On desktop: Click and hold the mouse button on a key to play a note. Release to stop the sound.
  5. On mobile: Tap and hold a key to play a note. Release to stop the sound.

  6. The piano supports multi-touch, allowing you to play multiple notes simultaneously.

  7. For mobile devices:

  8. In portrait mode, the piano will automatically rotate 90 degrees for easier playing.
  9. In landscape mode, the piano will display normally.

Features

  • The piano spans two octaves, starting from middle C (C4).
  • White and black keys are visually represented.
  • Keys highlight when pressed to provide visual feedback.
  • The piano uses the Web Audio API to generate realistic piano sounds.

This simple electronic piano web page is now ready for use. Users can enjoy playing music directly in their web browsers without the need for any additional setup or installation.

Technologies

CSS CSS
Flask Flask
HTML HTML
Javascript Javascript
Python Python