Nice. Thanks. For some reason that only returns negative values (something wrong with the if structure maybe?). In any case, just putting the negatives in the pitchClass array works.groundhum wrote:
I think this will do it (unless I screwed up something).Code: Select all
int pitchClass[8] = {0, 2, 4, 5, 7, 9, 11, 12}; int sign; for ( int i = 0; i < 16; i++ ) { sign = rand(0,1); if (sign == 0) sign = -1; VoiceCircuit.Parameter[ 25 + i * 7 ] = pitchClass[rand(0,7)] * sign; }
Edit:
oops, just realized the negative values aren't symmetrical (duh!). Here's the right array:
Code: Select all
int pitchClass[ 15 ] = {-1, -3, -5, -7, -8, -10, -12, 0, 2, 4, 5, 7, 9, 11, 12};
for ( int i = 0; i < 16; i++ )
{
VoiceCircuit.Parameter[ 25 + i * 7 ] = pitchClass[rand(0, 15)];
}