## Piano Trainer

Apr 26, 2010 at 6:48am

# Piano Trainer

I'm building a max app to help improve my piano skills on reading, i'm using a nslider and a random to generate random values

-How to generate random values inside given values? I want to get random values only inside 60, 62, 64 and 65. This will help me to generate random values inside specific scales.

[attachment=130931,445]

###### Attachments:
#50003
Apr 26, 2010 at 7:03am

This random value could be combination of a value being a member of a certain scale, an offset in terms of key and an offset in terms of octaves. A major scale could be defined and stored as [zl lookup 0 2 4 5 7 9 11]. A [random 7] can generate an index producing a stored value. Add to this a fixed valeu (eg 2 to make it D major). Finally add a random value (eg [random 3] for random three octaves) plus an octave offset (eg 3) multiplied with 12 (add: 12 x (3 + random(3)).

The makenote in your patch between the random and nslider is not really required. Also the second inlet of makenote does not need a trigger from the metro.

#179499
Apr 26, 2010 at 7:06am

But how to make the random use only the values of that index?

#179500
Apr 26, 2010 at 7:09am

On my site is ScaleMaster, a quantitization patch that allows for arbitrary input to be constrained to specific scales. It can be found at http://www.xfade.com/max

#179501
Apr 26, 2010 at 8:53am

And also look at:
D:Cycling74examplesmax-tricksnotes-and-pitch
for a quick and simple demonstration of user-constrained pitch collections

#179502
Apr 26, 2010 at 4:29pm

> But how to make the random use only the values of that index?

The output of random can go to the zl directly. Like this:

[attachment=130948,447]

###### Attachments:
#179503
Apr 26, 2010 at 5:07pm

@Jvkr:
Thanks for helping, i added a metro between the bang and the t b b, so it can trigger notes from specific scales regularly. The next step will be to build other scales and the interface, when i finish, i plan to build some recorder for the sequence generated in max and the sequence i play based on de generated sequence, so it can calculate my precision at the piano. Any tips?

@Chris:
Thanks for the tools.

@Brendan:
Thanks for the tip.

=)

#179504

You must be logged in to reply to this topic.