Page 1 of 1
How to make an interactive riddle from a piano melody
Posted: 21 May 2021, 13:16
by creal
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.
Re: How to make an interactive riddle from a piano melody
Posted: 21 May 2021, 21:54
by senso
It's a good idea, but maybe you could use an array-queue-data and compare output to the original array?
much more simple.
Re: How to make an interactive riddle from a piano melody
Posted: 22 May 2021, 08:54
by creal
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.
Re: How to make an interactive riddle from a piano melody
Posted: 22 May 2021, 13:59
by joffo78
Hi creal
You should try this

Re: How to make an interactive riddle from a piano melody
Posted: 22 May 2021, 18:13
by senso
the = module works also with arrays
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 15:17
by creal
senso wrote: ↑22 May 2021, 18:13
the = module works also with arrays
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.
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 15:20
by creal
joffo78 wrote: ↑22 May 2021, 13:59
Hi creal
You should try this test cadenas.rack
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.
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 16:46
by joffo78
I ll ve a look on it tonight
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 17:46
by joffo78
You should manage to do it with this way :
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 21:17
by creal
Hi Joffo,
Thank you very much. It now works as expected.
creal.
Re: How to make an interactive riddle from a piano melody
Posted: 24 May 2021, 22:17
by joffo78
Cool !