API_piano


Description

This is a simple web-based piano player built using the Web Audio API. It allows users to input a sequence of musical notes, specify their octaves and durations, and play them back using various waveforms like sine, square, triangle, or sawtooth. It also features adjustable volume controls.

Features

  • Note Input: Enter musical notes in a specified format.
  • Octaves & Durations: Define the octave and duration for each note.
  • Simultaneous Notes: Play multiple notes at the same time.
  • Waveform Selection: Choose between different sound waveforms (Sine, Square, Triangle, Sawtooth).
  • Volume Control: Adjust the output volume.

Usage

Enter a sequence of notes in the text area in the following format:

  • Notes: C, C#, D, D#, E, F, F#, G, G#, A, A#, B
  • Octave: Add a number after the note for octave (e.g., C4)
  • Duration: Add a duration in seconds (e.g., C#4(0.5))
  • Simultaneous Notes: Write notes together before the duration (e.g., C3E3A3(0.5))
  • Separate Notes: Use commas to separate different notes (e.g., C4(1),D4(0.5),E4)

    HTML WebAudioAPI_piano.html


    Leave a Reply

    Your email address will not be published. Required fields are marked *