The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this
quiz until 48 hours have elapsed from the time this message was
Support Ruby Q. by submitting ideas and responses
as often as you can! Visit: http://rubyquiz.strd6.com
Suggestion: A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby T. follow the discussion. Please reply to
the original quiz message, if you can.
Polyrhythm Trainer (#194)
Greetings fellow Rubyists,
This week’s quiz is to create a polyrhythm training program. The user
will be prompted to tap out a rhythm with two keys: left and right.
Each time the user presses a key the program will display how close to
the correct timing the key press occurred. The program will be
configurable to train the user in any polyrhythm 2:3, 5:4, 11:17, and
so on. The program will also have a configurable tempo. After a number
of complete rhythms the program will display the ratio of how many
notes were successfully struck, success determined by being within a
threshold around the perfect timing.
The display can be as simple as a console application or use a full
graphical interface. Ruby Inside recently had an article about
graphical toolkits if you are interested.
Polyrhythm is the simultaneous sounding of two or more independent