04-30-2009 12:08 PM
I am working on something just for fun.
Assuming you have a text file to start with (easier said than done),
that is formatted in the following manner:
Note Time held
Note Time held
Note Time held
.... etc
If I modified one of these programs, I would like to accomplish the following.
Read the text file.
Automatically play the song from the file.
But show which keys are being pressed while the piano is playing, so it could act as a tutorial.
I think the easiest way to do this would be to assign values to each key:
0 - 87 (including black and white keys)
Then I would read the file, which would say:
Note (0-87) Time held (ms)
Would I need to find a .wav file of each note on a piano?
Then put a 'play sound file' in a loop. But how would I specify how long the note held for?
I figure I could show which key is being pressed by changing the color of the control via property node or something.
Any advice while I'm coming up with something?
Solved! Go to Solution.
04-30-2009 12:27 PM
Instead of a .wav file that plays each note,
since each note already has an absolute pitch
I could use the 'beep.vi' function. I could convert pitch to frequency,
then input frequency and duration.
04-30-2009 12:48 PM
Cory,
That sounds like a fun project!
I have a couple additional thoughts that you might consider so that a true tutorial can be realized.
you may need class.fingers method.down(key, duration, force) method.slide(array of keys, array of increments, force) allow 5 for Zichy composition, 20 for a duet
You might consider class.pianotype(grand, upright, electric, ect...) have fun! detune a few keys on a bad piano!
Incorporate footwork
your file then will contain a list of methods, start times and params for each finger and the foot.
You could show force as color for the display
04-30-2009 12:50 PM
Jeff,
Those all sound like great ideas. Thanks for the input.
The project is actually coming along pretty well.
04-30-2009 12:58 PM
I'd love to see it when its complete! and your quite welcome.
04-30-2009 01:43 PM
You could get fancy, and instead of using beep, you could create waveforms on the fly and feed it to a stream (buffer for audio output). The waveforms would be made from the note frequency and various harmonics with defined decays. There is probably some doccumentation of piano waveforms somewhere.
04-30-2009 04:53 PM
What about double notes (when you hit two notes at the same time). Come to think of it, you have two hands on the piano...
04-30-2009 04:55 PM - edited 04-30-2009 05:02 PM
http://en.wikibooks.org/wiki/File:Piano_waveform_reconstructed.svg,,, <<< that's a":" "P" (how to unsmiley?)
http://www.sharewareconnection.com/pianos.htm
And thats a 5min search
04-30-2009 05:00 PM
You are right-
Class fingers needs an owning class hands to control the max span between fingers.
Or, depend on the composer handleing that for you (and allow yourself to compose some quite unusual projects )
04-30-2009 10:08 PM
I have already thought of how I am going to implement single notes.
Chords will take some thinking, but I'll see what I can come up with.