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#.
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,software:t.software})', 'navigator.requestMIDIAccess' is undefined)
WebMIDI isn’t implemented in Safari (supposedly for [security concerns](https://news.ycombinator.com/item?id=23676109)). Only options I know of for iOS are Scrub Web Browser and WebMIDI from the App Store
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.
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.
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.
> 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.
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.
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?
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...
Could not enable WebMidi: navigator.requestMIDIAccess is not a function. (In 'navigator.requestMIDIAccess({sysex:t.sysex,software:t.software})', 'navigator.requestMIDIAccess' is undefined)
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.
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#.
Could not enable WebMidi: navigator.requestMIDIAccess is not a function. (In 'navigator.requestMIDIAccess({sysex:t.sysex,software:t.software})', 'navigator.requestMIDIAccess' is undefined)
https://pianojacq.com/
This is the website I like to use. Will give pianoboi a try though.
> 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...
Yes it's because you're on mobile Firefox
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.
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.
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.
> 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
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?
I'm working on some browser based piano learning software. Is this open source?
I work on a parallel project (tarab.ai).
will be happy to talk. ping me at zuri at tarab do ai