LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

piano

Solved!
Go to solution

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?

Cory K
0 Kudos
Message 1 of 39
(5,984 Views)

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.

Cory K
0 Kudos
Message 2 of 39
(5,965 Views)

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  

  • Right pedal - The loud one. Also known as the "forte" or sustain pedal, it prevents dampers from descending on the piano strings, resulting in a rich, sustained chord peal.

     

  • Left pedal - The soft one or "una corda." A single piano note is normally created from two or three piano strings tuned in unison. This pedal shifts the hammer so that it hits only one or two strings, resulting in a more muted sound. Hence, "una corda" or "one string."

     

  • Middle pedal - The "sostenuto." This pedal selectively sustains notes, so that certain notes can ring out while others fade normally. It is usually found only on grand pianos.

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

 

 


"Should be" isn't "Is" -Jay
Message 3 of 39
(5,959 Views)

Jeff,

Those all sound like great ideas. Thanks for the input.

The project is actually coming along pretty well.

 

Cory K
0 Kudos
Message 4 of 39
(5,956 Views)

I'd love to see it when its complete! and your quite welcome.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 39
(5,950 Views)

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.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 6 of 39
(5,926 Views)

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...

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 7 of 39
(5,906 Views)

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

Message Edited by Jeff Bohrer on 04-30-2009 05:02 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 39
(5,902 Views)

You are right-

Class fingers needs an owning class hands to control the max span between fingers. Smiley Surprised 

 

Or, depend on the composer handleing that for you (and allow yourself to compose some quite unusual projects Smiley Very Happy )


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 39
(5,900 Views)

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.

Cory K
0 Kudos
Message 10 of 39
(5,878 Views)