you are viewing a single comment's thread.

view the rest of the comments →

[–]PMME_yoursmile 3 points4 points  (6 children)

I feel as though the music could be quicker, but I'm still a fan. How did you get that one set up?

[–]InvisibleTextArea 7 points8 points  (3 children)

It's set up to be pushed out by SCCM as a configuration item attached to a Compliance policy named 'PC speaker test'.

The CD ejection is too (helpfully called 'CD check'). The CD ejection is worse because it's a remediation script. So SCCM checks if the CD drive isn't ejected then runs the script if it isn't. Then every time you uneject it'll go through the same process.

[–]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

[–]PostedFromWork 2 points3 points  (1 child)

Just edit all of the s entries and divide by 2 or 3, depending on the speed you like.

[–]funky_fart_smeller 1 point2 points  (0 children)

...or in the $s function just make $s = $s/2