Gary's tool would be okay for you. It measures female threads too. So anyway you don' t have one so let's do it another way. Assuming metric rather than imperial which makes sense for Japanese. Being Yamaha I would reckon they use metric threads. So just take a ruler (unless better still you own a vernier) and measure the diameter of the hole. It will be 5mm 6, 7, or 8. . Metric threads are plain an simple. Imperial threads are complicated, BSF, BSW Whitworth, UNC etc .
So if you measure 6mm (for example) then it will probably be 6mm rather than 1/4 inch. We can eliminate imperial. You need bolt size M6.
Next thing decide if you need a capped knurled head for allen key or phillips head. It makes no difference but what is most suited to the housing.
Next determine what length you need.
You can figure that easily but go shorter rather than longer.
So if the thread depth is 12mm then all you need is 10mm.
Next go down to the bolt shop and buy them. Just ask for M6x10 . . Thar's all there is to it. They will be cheap! Seriously 10 cents each.
Next try one with a gentle turn or two and if the feel is good . . Go all the way and tighten it up.
Warning: Don't force it if it feels tight. If you have the wrong thread type then you will strip the thread in your casing. Just be gentle. If the first one works ok then you are sweet for the rest.
If you are not sure or the screw thread is wrong then its no big deal .. just a couple of bucks.
I hope that is helpful. If you live in a capital city then there will be bolt shops around. Another thing you can do is take the keyboard to the bolt shop and get the salesman to match up your thread type. Trial and error at no cost.
Cheers
Best of luck. Ray