[HN Gopher] Show HN Pianoboi - displays sheet music as you play ...
       ___________________________________________________________________
        
       Show HN Pianoboi - displays sheet music as you play your piano
        
       I made a software library for displaying piano music 7 years back,
       and recently ported it to the web (which is now easier than even
       ever).  It displays sheet music as you play, and let's you take
       snapshots of specific chords, then keeps a running list of chords
       as keyboard visuals (instead of just displaying sheet music).  Just
       a simple tool for songwriting/ figuring out songs by ear, or just
       understanding music key theory (which I'm admittedly a still a
       beginner at).
        
       Author : bcowde
       Score  : 97 points
       Date   : 2025-03-28 15:55 UTC (1 days ago)
        
 (HTM) web link (pianoboi.site)
 (TXT) w3m dump (pianoboi.site)
        
       | tzury wrote:
       | this is lovely.
       | 
       | I work on a parallel project (tarab.ai).
       | 
       | will be happy to talk. ping me at zuri at tarab do ai
        
       | eimrine wrote:
       | It requires some MIDI plugins, I was guessed it can convert from
       | audio.
        
       | moi2388 wrote:
       | Could not enable WebMidi: navigator.requestMIDIAccess is not a
       | function. (In 'navigator.requestMIDIAccess({sysex:t.sysex,softwar
       | e:t.software})', 'navigator.requestMIDIAccess' is undefined)
        
         | swiftcoder wrote:
         | WebMidi was never ratified as a standard, and Safari declined
         | to implement on security and privacy grounds
        
       | NiloCK wrote:
       | Looks really neat on first glance, thanks for sharing.
       | 
       | I'm working on some browser based piano learning software. Is
       | this open source?
        
       | earlyriser wrote:
       | Not sure if you can help me here or someone reading this.
       | 
       | I'm trying to find something to programatically make piano sounds
       | (and record an mp3) based on 2 params midi note and velocity. I'm
       | making a videogame and I need the mp3 piano notes.
       | 
       | I got a free piano sample library, but the sounds start not
       | always at the same microsecond, so I think I need to produce the
       | samples by myself.
        
         | jstrom wrote:
         | This paper produces a good result:
         | http://large.stanford.edu/courses/2007/ph210/otey2/. If you
         | game is OK sounding synthetic, I've had good results simulating
         | a string plucked off center, decay each harmonic proportional
         | to the frequency, then adding reverb.
         | 
         | A sound font or VST plug-in with appropriate licenses may be
         | another route, but I can't speak to how difficult that would be
         | to work with. It's on my to-do list.
        
           | earlyriser wrote:
           | Yes this looks perfect for what I'm trying to do. Thanks!
        
         | darepublic wrote:
         | Can you edit the sound files with ffmpeg to get rid of any
         | empty space before the sound effect?
        
           | earlyriser wrote:
           | Yes, I could do that, but I'm not happy also with the quality
           | of the samples and I need to produce more velocities.
        
         | bartread wrote:
         | Your computer's sound card probably has a built-in MIDI library
         | (like general MIDI) that will include a piano as an instrument.
         | 
         | You could use a sequencer (like the one built in to Reaper,
         | which is free) to sequence the notes you need using your sound
         | card as the MIDI device.
         | 
         | You can then export your track as a WAV file and chop it up
         | into individual notes using Audacity. You can then export each
         | individual note as a separate MP3, and load them into your
         | game.
         | 
         | Note that I'm using the word "soundcard" very loosely here: in
         | many cases sound hardware is onboard nowadays. The point is
         | your computer will have sounds you need built in.
         | 
         | You could also take one piano note sample and simply play it at
         | different pitches, but the issue here is it will only sound
         | good within a smallish range of notes - maybe an octave
         | maximum.
         | 
         | Whereas your computer's sound hardware is likely to have a
         | piano as a wave table instrument that uses multiple or many
         | samples or fragments of samples for each note and will sound
         | better, though possibly still a bit synthetic.
        
           | epcoa wrote:
           | > Your computer's sound card probably has a built-in MIDI
           | library (like general MIDI) that will include a piano as an
           | instrument.
           | 
           | > Note that I'm using the word "soundcard" very loosely here:
           | in many cases sound hardware is onboard nowadays.
           | 
           | Mainstream computers haven't included "soundcards"
           | (integrated onboard or otherwise) with any kind of built-in
           | hardware synthesis (wavetable or FM) for nearly 30 years.
           | What you have for hardware is mostly just a dumb digital to
           | analog converter with some mixing features and possibly some
           | basic canned DSP/codec functions.
           | 
           | > The point is your computer will have sounds you need built
           | in.
           | 
           | > Whereas your computer's sound hardware is likely to have a
           | piano as a wave table instrument
           | 
           | They're going to be on the hard drive as files and synthesis
           | is entirely in software, from which you have numerous
           | options, including what comes with the OS. MacOS and Windows
           | come with basic MIDI soundfont synthesizers, and on Linux you
           | typically end up using something like fluidsynth or timidity
           | tied to JACK/ALSA.
           | 
           | Hardware wave table synthesis as a usual thing is _long_ gone
           | (AC '97 is nearly 30 years old).
           | 
           | I don't think there is a straightforward way to portably
           | configure and sequence MIDI and loopback the OS builtin
           | synths if for some reason you don't want the audio going out
           | the default sound device (yes, it is possible, key here is
           | _straightforward_ to configure programatically). What is
           | relatively straightforward is using fluidsynth with a
           | suitable soundfont though. Depending on what you 're trying
           | to accomplish you run a soft-synth entirely in the browser.
           | 
           | > You can then export your track as a WAV file and chop it up
           | into individual notes using Audacity.
           | 
           | There are tons of freely available SF2 soundfonts, some with
           | wide instrument coverage, some dedicated to single
           | instruments with multiple layers, some very high quality
           | (just google soundfonts). Poorly redigitizing and recreating
           | one from the OS builtin soft-synth sounds like a waste of
           | time.
           | 
           | https://thedailywtf.com/articles/web_0_0x2e_1
        
         | squircle wrote:
         | If your game is web based, toneJS may work for developing a
         | prototype. Using basic wave forms and messing with various
         | filters can produce piano like tones.
        
       | bambax wrote:
       | Interesting!
       | 
       | However, while MIDI is 'working' (notes are highlighted when
       | played), it doesn't produce any sound? But sound is produced when
       | when clicking on the keyboard with the mouse...? Is there a
       | setting somewhere to fix this?
        
       | mentos wrote:
       | Using my mouse I was attempting to hold space bar and click 3
       | notes and then release and hit P to play the chord back but was
       | not able to
        
       | Jeff_Brown wrote:
       | Do you mean it shows something you've already chosen, or it
       | interprets and plots what you're making up in the moment?
        
       | georgestrakhov wrote:
       | Exactly what I always wanted. I can play naturally but don't know
       | sheet music. Sometimes capturing what I play in notation helps to
       | communicate it to other musicians I am hanging our with...
        
       | moefh wrote:
       | This is really cool!
       | 
       | A small suggestion for improvement: the labels of the black keys
       | currently don't match their function according to the key
       | signature. For example, in F major the black key between A and B
       | should be called Bb, not A#.
        
       | cvick wrote:
       | Safari on iphone I get this error when I load the page:
       | 
       | Could not enable WebMidi: navigator.requestMIDIAccess is not a
       | function. (In 'navigator.requestMIDIAccess({sysex:t.sysex,softwar
       | e:t.software})', 'navigator.requestMIDIAccess' is undefined)
        
         | tecleandor wrote:
         | I think webmidi is only implemented in Chrome :(
        
           | cassepipe wrote:
           | I don't think this is true anymore. This website used to give
           | a disclaimer to firefox users and does not anymore :
           | 
           | https://pianojacq.com/
           | 
           | This is the website I like to use. Will give pianoboi a try
           | though.
        
             | solardev wrote:
             | That site says it's still Chrome only. On Firefox I get
             | this: (maybe it's mobile Firefox)
             | 
             | > If you are reading this it means that your browser does
             | not support the WebMIDI extension.
             | 
             | > This is a real pity, but with some luck Google Chrome
             | will work on your system.
             | 
             | > If you already have chrome please start up chrome and
             | revisit the website using that browser, otherwise you will
             | have to install it.
             | 
             | > For FireFox this has been an open issue for Eight Years.
             | See: this bugzilla entry.
             | 
             | > That's annoying because FireFox is normally my daily
             | driver but eight years is enough to have to wait for a
             | feature like that.
             | 
             | > So, I'm really sorry, but please switch to Chrome for
             | this project, until Mozilla gets its act together, assuming
             | it ever will.
             | 
             | -----
             | 
             | There's really no such thing as web standards anymore.
             | Google just does whatever it wants and sometimes the other
             | browsers work, and sometimes not...
        
       | Ylpertnodi wrote:
       | Great stuff, thanks. Very revealing, and the fact it recognises
       | all of my midi devices (including the oxi one sequencer) means I
       | can watch my arpeggios.
        
       ___________________________________________________________________
       (page generated 2025-03-29 23:01 UTC)