Myriad Forum (http://myriad-online.com/cgi-bin/bbs/YaBB.pl)
General >> [english]MyrScript Language[/english][français]Langage MyrScript[/français] >> Piano Pedaling
(Message started by: theclarkster on Aug 18th, 2018, 9:31pm)

Title: Piano Pedaling
Post by theclarkster on Aug 18th, 2018, 9:31pm
Hi all!

Does anyone want to tackle writing a script that would automatically add pedal marks to a score?  What I'm thinking is that the user would select a staff or staves and start the score playback.  While the score is playing, have the script check to see if the user is holding a key down (i.e. spacebar).  While the key is pressed, then the score would set pedaling to on.  Once released, pedaling is set to off.  I'm not much for programming, so I'm not sure hiw easy something like this would be or if it's even possible.  Just one of those crazy ideas I had last night while I was working on a piano score.

Title: Re: Piano Pedaling
Post by bubu42 on Aug 18th, 2018, 10:35pm
Interesting question...
I wonder whether Myrscript is able to handle the keyboard while a score is playing. Anyway, if it is the case, a script could actually add the pedal marks which are objects like the others.
I'll try to investigate.

Title: Re: Piano Pedaling
Post by theclarkster on Aug 19th, 2018, 5:05am
Thanks bubu!  I'll be curious to know what your investigations reveal!

Title: Re: Piano Pedaling
Post by bubu42 on Aug 21st, 2018, 11:22am
Good news.
So far, I've managed to run a very simple script.
It can play the music, scan the keyboard, react to a key stroke while the music is playing and perform a basic operation (change the note color that's been selected).
Now I have to determine which keys should be used to set the pedal effects (in and out). I think I'll go this way : one key will be used. The first time it will set the "ped" effect and keep the state in memory. Then, on the second key stroke, it will set the "*" effect.
Since all this requires a lot of attention while the music is playing, I'll probably run the thing in a user dialog, so that we can manage other things (like the general tempo, the choice of the staff, etc.)
I keep working on that.

Title: Re: Piano Pedaling
Post by theclarkster on Aug 23rd, 2018, 11:40am
Thanks for the update and your work on the script!  Sounds like you're making pretty good progress.  Thanks again!

Title: Re: Piano Pedaling
Post by PaulL on Sep 5th, 2018, 10:04pm
Bubu, if Myrscript can distinguish between key down and key up events. you would only need one key.  Key down would add the "Ped." and key up would add the "*".

On the other hand, I suppose a script using two keys could easily be generalizable to adding any effect, dynamic, etc. while playing.

Title: Re: Piano Pedaling
Post by bubu42 on Sep 5th, 2018, 10:50pm

on 09/05/18 at 22:04:16, PaulL wrote:
Bubu, if Myrscript can distinguish between key down and key up events. you would only need one key.  Key down would add the "Ped." and key up would add the "*".

That's what I thought first, but I found it easier to use two different keys while building and testing the script. Now, I'm trying to transpose the whole thing into a floating window so that I can use a few other commands. However, since I'm currently working around the house, I have little spare time to complete the script. It's probably a matter of a few days, hopefully.
Quote:
On the other hand, I suppose a script using two keys could easily be generalizable to adding any effect, dynamic, etc. while playing.

If the script is run in a floating window, such an option could probably be implemented.

Title: Re: Piano Pedaling
Post by theclarkster on Oct 19th, 2018, 9:29am
Been awhile since I checked in here, but I wanted to see if there has been any more progress on this?  I'm not in a bit rush.  Take your time.  Just curious on where things are at.  Thanks again!

Title: Re: Piano Pedaling
Post by bubu42 on Oct 20th, 2018, 12:08pm
Ooops... I forgot to post the first version of the script.  :-[
Here is the archive (should place the script in Scripts>Miscellaneous)
I've chosen to handle the whole thing through a dialog window.
You load the score and launch the script. In the window, there's the list of all the staves. Choose one. Then you start the music and click on the On/Off button to place a pedal mark under the note (red by default) that's being played . For speed sake, I do not refresh the score and the marks do not appear instantly. The button automatically toggles between on and off (push/release).
I've also added a few features. You can :
1- choose to erase all the existing pedal marks that are after the play mark
2- choose to apply the pedal effect (audio) to the whole group or only to the staff
3- slow down the original tempo (it'seasier to follow the notes while playing) and retrieve it at the end of the work.
5- manage a vertical and horizontal offset for the piano marks so that they don't clash with the notes.
4- pause the music and restart at the last played note.
A "?" button will sum up the process
Of course, all this can be improved if necessary.

Title: Re: Piano Pedaling
Post by theclarkster on Oct 23rd, 2018, 6:13am
Thanks bubu!  I'll check it out tomorrow when I have a some free time.  Looking forward to playing around with it!



Myriad Forum » Powered by YaBB 1 Gold - SP 1.1!
YaBB © 2000-2002,
Xnull. All Rights Reserved.