Board Logo
« Of the combination »

Welcome Guest. Please Login or Register.
Jan 21st, 2018, 12:53am


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Of the combination  (Read 107 times)
Valentin
Full Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 130
xx Of the combination
« Thread started on: Nov 7th, 2017, 06:08am »

Hello everyone, the concern:
a array of values between 28 and 95 (array: z ()
the values do not follow each other (musik note parameters)
a device in extract 6 random
which are put in a array: t ()
And there are, 7 combinations: (1; 2; 3; 4; 5; 6; 7) of values of z ()
named: a; b; c; d; e; f for the explanation below
such as
a2 = a1 + 7; a3 = a2 + 7; a4 = a3 + 7; a5 + a4 = 7; = a6 = a5 + 7
b2 = b1 + 7; b3 = b2 + 7; b4 = b3 + 7; b5 = b4 + 7; b6 = b5 + 7
c2 = ..... ext ..
..... g6 = g5 + 7
I would like to test if one of the values of t () is equal to one of the values of the 7 combinations
If equality then put the name (1; 2; 3; 4; 5; 6; 7) of the combination in the variable: r
To make it work I made with "if then" by boots of 7; but I sense that there must be a way to do that in a loop; for the moment nothing works I lose myself in the reasoning, not to mention the worries of overtaking.
To help the bigs brains please thank you.
« Last Edit: Nov 7th, 2017, 06:08am by Valentin » User IP Logged

tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3636
xx Re: Of the combination
« Reply #1 on: Nov 7th, 2017, 07:24am »

Cannot understand a thing.
Is 28..95 related to MIDI notes?
What
Code:
a2 = a1 + 7; a3 = a2 + 7; a4 = a3 + 7; a5 + a4 = 7; = a6 = a5 + 7
b2 = b1 + 7; b3 = b2 + 7; b4 = b3 + 7; b5 = b4 + 7; b6 = b5 + 7
c2 = ..... ext ..
..... g6 = g5 + 7
 

supposed to do?
Putting (...) means I should have an idea what goes in there. I have no slightest idea.
EDIT: I have no slightest idea WHY.


Could some picture help to explain what's going on?

If you have some code it might help as well.
« Last Edit: Nov 7th, 2017, 07:29am by tsh73 » User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
Valentin
Full Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 130
xx Re: Of the combination
« Reply #2 on: Nov 7th, 2017, 11:00am »

It's résolved
I put the combinations in strings, after in arrays and I treated from the generation of the note by note whith that
Code:
        for a=1 to 7
          for b=1 to 6
            if note=comb(a,b) then rm=a
          next b
        next a
 

I saved myself a cart of "If then" and "select case" that broke my head
Yes it's midi notes; if you want to see the massacre, follow the link
But help is in French
The Google translator is our friend
http://libertybasic.fr/forum/topic-491+l-oreille-absolue.php
« Last Edit: Nov 7th, 2017, 11:24am by Valentin » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls