How to replace the windows `beep` sound
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How to replace the windows `beep` sound
Thanks Klaus,
I think what`s confusing me is that if I double click on the mid file in windows filexplorer, the mid file will open and play with the native windows medial player.
I`ve tried some midi opensource apps, eg fluidsynth but I can`t get these to work when I call them in LC - I think its because I`m not understanding the syntax to use for the opensource midi players...
Regards,
Glenn
I think what`s confusing me is that if I double click on the mid file in windows filexplorer, the mid file will open and play with the native windows medial player.
I`ve tried some midi opensource apps, eg fluidsynth but I can`t get these to work when I call them in LC - I think its because I`m not understanding the syntax to use for the opensource midi players...
Regards,
Glenn
Re: How to replace the windows `beep` sound
My work around so far is for LC to open fileexplorer so I can then double click on the mid file to play it...
Its all of one or two extra clicks but I thought it would be much neater if I could open the mid file using LC!
Regards,
Glenn
Code: Select all
launch url "File:C:\Users\Glenn\OneDrive\Documents\LiveCode\"
Regards,
Glenn
Re: How to replace the windows `beep` sound
Hi Glenn,
hm, then try either:
or
Best
Klaus
hm, then try either:
Code: Select all
launch document "path/to/your/midi.mid"
Code: Select all
launch "path/to/your/midi.mid" with "path/to/WMP.exe"
Klaus
Re: How to replace the windows `beep` sound
Thanks Klaus, sadly no luck with either of those... but thank you for the suggestions.
I guess I`ll just have to live with the few extra clicks to play the mid file from file explorer!
Regards,
Glenn
I guess I`ll just have to live with the few extra clicks to play the mid file from file explorer!
Regards,
Glenn
Re: How to replace the windows `beep` sound
What does "the result" tell you?
Re: How to replace the windows `beep` sound
LC just seems to ignore the commands, ie no error messages etc, it just continues with the rest of the code as if the calls to the mid files were not there...!
have tried the following permutations:
Regards,
Glenn
have tried the following permutations:
Code: Select all
launch document "File:C:\Users\Glenn\OneDrive\Documents\LiveCode\" & tName & "test.mid"
Code: Select all
launch document "C:\Users\Glenn\OneDrive\Documents\LiveCode\" & tName & "test.mid"
Code: Select all
launch "File:C:\Users\Glenn\OneDrive\Documents\LiveCode\" with "path/to/WMP.exe"
Code: Select all
launch "C:\Users\Glenn\OneDrive\Documents\LiveCode\" with "path/to/WMP.exe"
Glenn
Re: How to replace the windows `beep` sound
Hi Glenn,
please ALWAYS use parens when concatenating filenames (and names of LC objects) and check the result!
"the result" may show why this does not work.
And please try with the correct path and application name of the Windows Media Player, I'm on a Mac so I don't know the exact path.
"path/to/WMP.exe" was just an example.
Corrext syntax is: launch DOCUMENT xyz with app.exe (Sorry forgot DOCUMENT in my example.)
And of course you need to supply the FILENAME of your MIDI file:
Best
Klaus
please ALWAYS use parens when concatenating filenames (and names of LC objects) and check the result!
Code: Select all
...
## "launch document..." WITHOUT "file:..."!
launch document ("C:\Users\Glenn\OneDrive\Documents\LiveCode\" & tName & "test.mid")
if the result <> EMPTY then
answer the result
end if
...
And please try with the correct path and application name of the Windows Media Player, I'm on a Mac so I don't know the exact path.
"path/to/WMP.exe" was just an example.

Corrext syntax is: launch DOCUMENT xyz with app.exe (Sorry forgot DOCUMENT in my example.)
And of course you need to supply the FILENAME of your MIDI file:
Code: Select all
...
launch document "C:\Users\Glenn\OneDrive\Documents\LiveCode\name of your MIDI file.mid" with "CORRECT path/on your/machine to/WMP.exe"
if the result <> EMPTY then
answer the result
end if
...
Klaus
Re: How to replace the windows `beep` sound
Klaus,
Bingo! Your code has worked, LC now triggers the playing of the midi file! - thank you so much!
(I`d be embarrassed to disclose how many hours I`ve spent trying to get this to work previously!)
Best regards and Happy New Year.
Glenn
Bingo! Your code has worked, LC now triggers the playing of the midi file! - thank you so much!
(I`d be embarrassed to disclose how many hours I`ve spent trying to get this to work previously!)
Best regards and Happy New Year.
Glenn
Re: How to replace the windows `beep` sound
Hi Glenn,
which code did the trick?
The first one "launch document..." or the second one "launch document xyz WITH app.exe"?
Best
Klaus
which code did the trick?
The first one "launch document..." or the second one "launch document xyz WITH app.exe"?
Best
Klaus
Re: How to replace the windows `beep` sound
Hi Klaus,
it was the first one that did the trick.
Regards,
Glenn
it was the first one that did the trick.
Code: Select all
...
## "launch document..." WITHOUT "file:..."!
launch document ("C:\Users\Glenn\OneDrive\Documents\LiveCode\" & tName & "test.mid")
if the result <> EMPTY then
answer the result
end if
...
Glenn
Re: How to replace the windows `beep` sound
Thanks!
Your message contains 7 characters.
You need to enter at least 10 characters.
Your message contains 7 characters.
You need to enter at least 10 characters.
Re: How to replace the windows `beep` sound
Just in case its of interest to anyone this LC works for me in generating a Lilypond score
Regards,
Glenn
Code: Select all
on generateLilyPond
-- Lilypond is case sensitive
put toLower(gKey) into gKey
set the hideConsoleWindows to true
-- this is the basic syntax for Lilypond to generate a score
put "\version" && quote & "2.24.2" & quote & CR & CR into tLilyPondContent
put "\score {" & CR after tLilyPondContent
put "\relative {" & CR after tLilyPondContent
put "\time" && gTime after tLilyPondcontent
put "\key" && gKey && "\major" after tLilyPondcontent
put "\tempo 4 =" && tTempo after tLilyPondcontent
-- this enters the notes (as variables of course) that Lilypond should create a PDF score/midi from
put "" & tN1 & "'" && tN2 && tN3 && tN4 && tN5 && tN6 && tN7 && tN8 && tN9 && tN10 && tN11 && tN12 && "}" & CR after tLilyPondContent
-- pdf Lilypond code
if gPDf is "True" then
put " \layout { }" & CR after tLilyPondContent
end if
-- midi Lilypond code
put "\midi { }" & CR after tLilyPondContent
put "}" & CR after tLilyPondContent
end generateLilyPond
Glenn
Re: How to replace the windows `beep` sound
This doesn't replace the windows 'beep' sound, and I'm sure it isn't as spectacular as midi, but this YT playlist may be of interest to someone trying to create a similar app (musical).
https://www.youtube.com/watch?v=0xm6U96 ... GQyg_l3r3C
https://www.youtube.com/watch?v=0xm6U96 ... GQyg_l3r3C

Re: How to replace the windows `beep` sound
Thanks Bogs, I got some useful hints and tips from the 3 videos. Glenn