Welcome to %s forums

BrainModular Users Forum

Login Register

How to make an interactive riddle from a piano melody

I need help on a Patch
creal
Member
Posts: 96

How to make an interactive riddle from a piano melody

Unread post by creal » 21 May 2021, 13:16

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.
You do not have the required permissions to view the files attached to this post.

User avatar
senso
Site Admin
Posts: 4427
Location: France
Contact:

Unread post by senso » 21 May 2021, 21:54

It's a good idea, but maybe you could use an array-queue-data and compare output to the original array?
much more simple.

creal
Member
Posts: 96

Unread post by creal » 22 May 2021, 08:54

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.
You do not have the required permissions to view the files attached to this post.

joffo78
Member
Posts: 1033

Unread post by joffo78 » 22 May 2021, 13:59

Hi creal
You should try this
test cadenas.rack
;-)
You do not have the required permissions to view the files attached to this post.

User avatar
senso
Site Admin
Posts: 4427
Location: France
Contact:

Unread post by senso » 22 May 2021, 18:13

the = module works also with arrays

creal
Member
Posts: 96

Unread post by creal » 24 May 2021, 15:17

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.

creal
Member
Posts: 96

Unread post by creal » 24 May 2021, 15:20

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.
You do not have the required permissions to view the files attached to this post.

joffo78
Member
Posts: 1033

Unread post by joffo78 » 24 May 2021, 16:46

I ll ve a look on it tonight

joffo78
Member
Posts: 1033

Unread post by joffo78 » 24 May 2021, 17:46

You should manage to do it with this way :
test cadenas V2 works with double notes.rack
You do not have the required permissions to view the files attached to this post.

creal
Member
Posts: 96

Unread post by creal » 24 May 2021, 21:17

Hi Joffo,
Thank you very much. It now works as expected.
creal.

joffo78
Member
Posts: 1033

Unread post by joffo78 » 24 May 2021, 22:17

Cool !

Post Reply