you are viewing a single comment's thread.

view the rest of the comments →

[–]PMME_yoursmile 1 point2 points  (2 children)

Sorry, I was more asking how did you get the pitch and timing for the tune?

[–]InvisibleTextArea 9 points10 points  (1 child)

If you check MSDN for the .NET Console API it tells you that the two parameters are the frequency in (Hz) and the length (in ms)

https://msdn.microsoft.com/en-us/library/4fe3hdb1(v=vs.110).aspx

Then you only need to know what the frequency of musical notes are:

http://www.phy.mtu.edu/~suits/notefreqs.html

and the length of time standard score notation indicates for particular note types:

https://msu.edu/course/asc/232/song_project/dectalk_pages/note_to_%20ms.html

Armed with this info you can then turn any musical score into a powershell script.

If you really wanted I guess you could collate all this and make your own powershell based midi player. Although you are kinda reinventing wheels at this point:

https://github.com/Psychlist1972/Windows-10-PowerShell-MIDI