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…
Show HN Pianoboi – displays sheet music as you play your piano
11–20 of 26 posts
Re: Show HN Pianoboi – displays sheet music as you play your piano
#12Not 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.
Re: Show HN Pianoboi – displays sheet music as you play your piano
#13Re: Show HN Pianoboi – displays sheet music as you play your piano
#14Re: Show HN Pianoboi – displays sheet music as you play your piano
#15A 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#.
Re: Show HN Pianoboi – displays sheet music as you play your piano
#16Not 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.
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.
Re: Show HN Pianoboi – displays sheet music as you play your piano
#17Not 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.
Re: Show HN Pianoboi – displays sheet music as you play your piano
#18Could not enable WebMidi: navigator.requestMIDIAccess is not a function. (In 'navigator.requestMIDIAccess({sysex:t.sysex,software:t.software})', 'navigator.requestMIDIAccess' is undefined)
Re: Show HN Pianoboi – displays sheet music as you play your piano
#19Safari 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)
Re: Show HN Pianoboi – displays sheet music as you play your piano
#20Not 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.
Can you edit the sound files with ffmpeg to get rid of any empty space before the sound effect?