Live data from Hacker News

Show HN Pianoboi – displays sheet music as you play your piano

pianoboi.site

11–20 of 26 posts

Re: Show HN Pianoboi – displays sheet music as you play your piano

#11
post #9

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…

Yes this looks perfect for what I'm trying to do. Thanks!

Re: Show HN Pianoboi – displays sheet music as you play your piano

#12

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.

Can you edit the sound files with ffmpeg to get rid of any empty space before the sound effect?

Re: Show HN Pianoboi – displays sheet music as you play your piano

#16

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.

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.

Re: Show HN Pianoboi – displays sheet music as you play your piano

#17

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.

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.

Re: Show HN Pianoboi – displays sheet music as you play your piano

#19
post #18

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)

I think webmidi is only implemented in Chrome :(

Re: Show HN Pianoboi – displays sheet music as you play your piano

#20

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.

Can you edit the sound files with ffmpeg to get rid of any empty space before the sound effect?

Yes, I could do that, but I'm not happy also with the quality of the samples and I need to produce more velocities.
Post reply on HN