How to make an interactive riddle from a piano melody
How to make an interactive riddle from a piano melody
Hello,
In the scope of an Escape Game, I need to program a riddle which involves a MIDI keyboard.
The concept is simple: the gamers have to play a specific melody. If they make a mistake at any moment, they need to start again.
I made a patch to show you what I've done. An array contains all the notes of the melody, in MIDI format (for the enclosed patch I just tried a diatonic octave C -C). I use a selector and a counter. If it is the right note, the counter increments as well as the array index thanks to the selector, otherwise the counter resets to its min value as well as the array.
Could you tell me what's wrong with my patch, please? It seems like there is a loop.
Thanks,
creal.
In the scope of an Escape Game, I need to program a riddle which involves a MIDI keyboard.
The concept is simple: the gamers have to play a specific melody. If they make a mistake at any moment, they need to start again.
I made a patch to show you what I've done. An array contains all the notes of the melody, in MIDI format (for the enclosed patch I just tried a diatonic octave C -C). I use a selector and a counter. If it is the right note, the counter increments as well as the array index thanks to the selector, otherwise the counter resets to its min value as well as the array.
Could you tell me what's wrong with my patch, please? It seems like there is a loop.
Thanks,
creal.
- Attachments
-
- énigme piano.pat
- (34.65 KiB) Downloaded 227 times
It's a good idea, but maybe you could use an array-queue-data and compare output to the original array?
much more simple.
much more simple.
Olivier Sens
www.brainmodular.com
www.brainmodular.com
hi Olivier,
thanks for your reply. I didn't know this module. It sounds perfect for what I'm looking for! However, I can't compare arrays with the "=" logical module. Is there a specific module to compare all values of an array to another one?
I attached the new patch.
Thanks,
creal.
thanks for your reply. I didn't know this module. It sounds perfect for what I'm looking for! However, I can't compare arrays with the "=" logical module. Is there a specific module to compare all values of an array to another one?
I attached the new patch.
Thanks,
creal.
- Attachments
-
- test cadenas.pat
- (22.41 KiB) Downloaded 226 times
the = module works also with arrays
Olivier Sens
www.brainmodular.com
www.brainmodular.com
Thanks for your message.
Yes, you are right. I noticed that thanks to Joffo patch. I should have put an array sum at the outlet of the "=" module and compute how many "1" appear. I thought the "=" would send 1 if and only if ALL the values of an array were equal to the other one, but it is not the case.
Hi Joffo. It's goot to hear news from you
I just tried the rack. It works (the array sum next to the "=" module was the key!) but not with repetition of notes. For example, if in my melody I want "do, ré, ré, mi, fa fa", it does not take into account the repetition of ré and fa. I tested with a "math var" module between the MIDI input and the "array queue" but it does not work (modified rack is enclosed).
Do you have an idea to store repetitions as well in the array queue, please?
Thanks,
creal.
- Attachments
-
- test cadenas.rack
- (92.52 KiB) Downloaded 208 times
Hi Joffo,
Thank you very much. It now works as expected.
creal.
Thank you very much. It now works as expected.
creal.
Who is online
Users browsing this forum: damstraversaz and 33 guests
