Rebetiko > The Roads > A digression into computer programming

How many roads must a man walk down? Bob Dylan.

 

I'm sorry. I should have been able to resist that, but I couldn't. As a computer nerd with a background in mathematics, I was interested by the assertion that some Rembetika players knew more than eighty roads. Could there be that many?

To frame the question differently: given that the scale is going to cover the 12 notes from D to Db/C#, always including the D, how many ways can the six notes between D#/Eb and Db/C# (inclusive) be arranged? That's six notes, in 11 spaces. Simple enough in combinatorial terms, there are 462 ways to do this. Rather a lot.

Too many in fact. There are a few more restrictions to be taken into account. The biggest interval that occurs anywhere in the roads illustrated on this site (which is all the ones I have been able to find published anywhere) is two semitones. No gaps of three, four or five notes can appear. I decided not to do the work myself, and wrote a quick little hack in C (the computer language, not the musical scale) to find out.

The result was a list of apparently valid scales, and the announcement that there were 266 of them. Here it is with the middle removed:-

1 0 0 1 0 0 1 0 1 1 1 1 1
1 0 0 1 0 0 1 1 0 1 1 1 1
1 0 0 1 0 0 1 1 1 0 1 1 1
1 0 0 1 0 0 1 1 1 1 0 1 1
1 0 0 1 0 0 1 1 1 1 1 0 1
.

.

1 1 1 1 0 1 0 1 0 1 0 0 1
1 1 1 1 0 1 1 0 0 1 0 0 1
1 1 1 1 1 0 0 1 0 0 1 0 1
1 1 1 1 1 0 0 1 0 1 0 0 1
1 1 1 1 1 0 1 0 0 1 0 0 1
Total = 266

Less than 462, but not as many less as I had expected. But look at the first line, or the last. Five notes in a row, when the largest group in the scales I had found was three. I amended the program to prevent larger groups than three notes. Here it is...

#include <stdio.h>
#define GOOD 66
#define BAD  99

int test (int i, int j, int k, int l, int m, int n, int o, int p, int q, int r, int s);

// Let's declare 11 spaces for notes...
int i, j, k, l, m, n, o, p, q, r, s, count;

void main ()
{
  count = 0;
  
  // Each note will be either a 1 or a zero...
  for (i=0; i<2; i++)
    for (j=0; j<2; j++)
      for (k=0; k<2; k++)
        for (l=0; l<2; l++)
          for (m=0; m<2; m++)
            for (n=0; n<2; n++)
              for (o=0; o<2; o++)
                for (p=0; p<2; p++)
                  for (q=0; q<2; q++)
                    for (r=0; r<2; r++)
                      for (s=0; s<2; s++)
                        // Let's see if our scale is permissible...
                       if (test(i, j, k, l, m, n, o, p, q, r, s) == GOOD)
                         printf("1 %d %d %d %d %d %d %d %d %d %d %d 1\n",
                                   i, j, k, l, m, n, o, p, q, r, s);
                       printf("Total = %d\n", count);
}

int test (int i, int j, int k, int l, int m, int n, int o, int p, int q, int r, int s)
{
  // There have to be exactly six notes...
  if (i+j+k+l+m+n+o+p+q+r+s != 6)
    return BAD;

  // No three note gaps. This test also prevents any larger gaps, as a four
  // note gap contains two three note gaps, and so on...
  if ((i+j+k == 0) || 
      (j+k+l == 0) || 
      (k+l+m == 0) || 
      (l+m+n == 0) || 
      (m+n+o == 0) || 
      (n+o+p == 0) || 
      (o+p+q == 0) || 
      (p+q+r == 0) ||
      (q+r+s == 0))
  return BAD;

  // No groups of notes longer than three. Again, this prevents any
  // longer groups...
  if ((1+i+j+k == 4) ||
      (i+j+k+l == 4) ||
      (j+k+l+m == 4) ||
      (k+l+m+n == 4) ||
      (l+m+n+o == 4) ||
      (m+n+o+p == 4) ||
      (n+o+p+q == 4) ||
      (o+p+q+r == 4) ||
      (p+q+r+s == 4) ||
      (q+r+s+1 == 4))
  return BAD;

  count++;
  return GOOD;
}

And here is the output, with all the scales I recognise marked...

1 0 0 1 0 0 1 1 1 0 1 1 1
1 0 0 1 0 1 0 1 1 0 1 1 1
1 0 0 1 0 1 0 1 1 1 0 1 1
1 0 0 1 0 1 1 0 1 0 1 1 1
1 0 0 1 0 1 1 0 1 1 0 1 1
1 0 0 1 0 1 1 0 1 1 1 0 1
1 0 0 1 0 1 1 1 0 0 1 1 1
1 0 0 1 0 1 1 1 0 1 0 1 1
1 0 0 1 0 1 1 1 0 1 1 0 1
1 0 0 1 1 0 0 1 1 0 1 1 1
1 0 0 1 1 0 0 1 1 1 0 1 1
1 0 0 1 1 0 1 0 1 0 1 1 1
1 0 0 1 1 0 1 0 1 1 0 1 1
1 0 0 1 1 0 1 0 1 1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0 1 <- Descending part of Rast. Ascending part of Houseini.
1 0 1 0 1 1 0 1 1 0 0 1 1 <- Tabahaniotiko.
1 0 1 0 1 1 0 1 1 0 1 0 1 <- Descending part of Tsinganikos.
1 0 1 0 1 1 0 1 1 1 0 0 1
1 0 1 0 1 1 1 0 0 1 0 1 1
1 0 1 0 1 1 1 0 0 1 1 0 1
1 0 1 0 1 1 1 0 1 0 0 1 1
1 0 1 0 1 1 1 0 1 0 1 0 1
1 0 1 0 1 1 1 0 1 1 0 0 1
1 0 1 1 0 0 1 0 1 0 1 1 1
1 0 1 1 0 0 1 0 1 1 0 1 1
1 0 1 1 0 0 1 0 1 1 1 0 1
1 0 1 1 0 0 1 1 0 0 1 1 1
1 0 1 1 0 0 1 1 0 1 0 1 1
1 0 1 1 0 0 1 1 0 1 1 0 1 <- Susinak.
1 0 1 1 0 0 1 1 1 0 0 1 1 <- Nihavent.
1 0 1 1 0 0 1 1 1 0 1 0 1
1 0 1 1 0 1 0 0 1 0 1 1 1
1 0 1 1 0 1 0 0 1 1 0 1 1
1 0 1 1 0 1 0 0 1 1 1 0 1
1 0 1 1 0 1 0 1 0 0 1 1 1
1 0 1 1 0 1 0 1 0 1 0 1 1 <- Ascending part of Melodic Minor.
1 0 1 1 0 1 0 1 0 1 1 0 1 <- Pagiatis' version of Kurdi.
1 0 1 1 0 1 0 1 1 0 0 1 1 <- Harmonic Minor.
1 0 1 1 0 1 0 1 1 0 1 0 1 <- Diatonic Minor. Descending part of Houseini, Kurdi and Melodic Minor.
1 0 1 1 0 1 0 1 1 1 0 0 1
1 0 1 1 0 1 1 0 0 1 0 1 1
1 0 1 1 0 1 1 0 0 1 1 0 1 <- Kartzihiar. Ascending part of Kurdi.
1 0 1 1 0 1 1 0 1 0 0 1 1
1 0 1 1 0 1 1 0 1 0 1 0 1
1 0 1 1 0 1 1 0 1 1 0 0 1
1 0 1 1 0 1 1 1 0 0 1 0 1
1 0 1 1 0 1 1 1 0 1 0 0 1
1 0 1 1 1 0 0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 0 1 0 1
1 1 0 1 1 1 0 1 0 1 0 0 1
1 1 1 0 0 1 0 0 1 0 1 1 1
1 1 1 0 0 1 0 0 1 1 0 1 1
1 1 1 0 0 1 0 0 1 1 1 0 1
1 1 1 0 0 1 0 1 0 0 1 1 1
1 1 1 0 0 1 0 1 0 1 0 1 1
1 1 1 0 0 1 0 1 0 1 1 0 1
1 1 1 0 0 1 0 1 1 0 0 1 1
1 1 1 0 0 1 0 1 1 0 1 0 1
1 1 1 0 0 1 0 1 1 1 0 0 1
1 1 1 0 0 1 1 0 0 1 0 1 1
1 1 1 0 0 1 1 0 0 1 1 0 1
1 1 1 0 0 1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0 1 0 1 0 1
1 1 1 0 0 1 1 0 1 1 0 0 1
1 1 1 0 0 1 1 1 0 0 1 0 1
1 1 1 0 0 1 1 1 0 1 0 0 1
1 1 1 0 1 0 0 1 0 0 1 1 1
1 1 1 0 1 0 0 1 0 1 0 1 1
1 1 1 0 1 0 0 1 0 1 1 0 1
1 1 1 0 1 0 0 1 1 0 0 1 1
1 1 1 0 1 0 0 1 1 0 1 0 1
1 1 1 0 1 0 0 1 1 1 0 0 1
1 1 1 0 1 0 1 0 0 1 0 1 1
1 1 1 0 1 0 1 0 0 1 1 0 1
1 1 1 0 1 0 1 0 1 0 0 1 1
1 1 1 0 1 0 1 0 1 0 1 0 1
1 1 1 0 1 0 1 0 1 1 0 0 1
1 1 1 0 1 0 1 1 0 0 1 0 1
1 1 1 0 1 0 1 1 0 1 0 0 1
1 1 1 0 1 1 0 0 1 0 0 1 1
1 1 1 0 1 1 0 0 1 0 1 0 1
1 1 1 0 1 1 0 0 1 1 0 0 1
1 1 1 0 1 1 0 1 0 0 1 0 1
1 1 1 0 1 1 0 1 0 1 0 0 1
1 1 1 0 1 1 1 0 0 1 0 0 1
Total = 198

Well, there you go. There could in theory be as many as 198 roads, if the assumptions embodied by my program are correct. But this is music we are talking about, not programming. It is possible that quite a lot of the lines above would sound horrible when played, and I don't have the knowledge of music theory necessary to amend the program so they would not be generated. Can anyone help here?


Some time after I did this work, I began to wonder if any rows in the results were rotations of other rows. I wrote a better progam to check for this. It also rejected lines such as

1 1 1 0 0 1 1 0 1 0 0 1 1

which has actually got four notes in a row, due to "wrap round". The final total was 175 roads. There were no rotations found. When I thought about it, this made sense, as a pattern of seven notes is bound to contain a group with an odd number of notes, which cannot appear elsewhere in a rotation. The program as amended is reproduced below, on the off chance that somebody might be interested...


#include 

// Scales always start with a 1, have 12 characters, and contain 7 1s and
// five 0s.

// Let's find out how many scales we can make with the following rules:-
// - no more than three notes together
// - no gaps of more than two notes
// - no duplicate scales caused by shifts


// Declare store as an array of scales and validations.
const SIZE = 2048; // Must be tower of poo.
struct scale {
    int     index;
    char    notes [13]; // [0]..[11] data, [12] for the terminator
    bool    valid;
};
static scale store [SIZE];

// Number of items currently in store
int stored=0;

// Rejection reasons
int reject_not7=0, reject_4inarow=0, reject_gap3=0, reject_rotate=0;

int count, subcount, temp, limit, off;
//char i, j, k, l, m, n, o, p, q, r, s;

void main ()
{
    // Initialisation of the array - not really needed.
    for (count = 0; count < SIZE; count++)
    {
        store[count].index = count;
        store[count].notes[0] = '1';
        for (subcount = 1; subcount < 11; subcount++)
            store[count].notes[subcount] = '0';
        store[count].notes[12] = '\0';
        store[count].valid = true;
    }

    // Fill the array with scales
    for (count = 0; count < SIZE; count++)
    {
        temp = count;
        limit = SIZE/2;

        for (subcount = 11; subcount > 0; subcount--)
        {
            if (temp >= limit)
            {
                store[count].notes[subcount] = '1';
                temp -= limit;
            }
            else
            {
                store[count].notes[subcount] = '0';
            }
            limit /= 2;
        }
    }

    // Reject everything with more or less than seven notes
    for (count = 0; count < SIZE; count++)
    {
        temp = 0;
        for (subcount = 0; subcount <= 11; subcount++)
        {
            if (store[count].notes[subcount] == '1')
                temp++;
        }
        if (temp != 7) 
        {
            store[count].valid = false;
            reject_not7++;
        }
    }

    // Reject four ones in a row. Expanded to cope with wrap
    // round at the end of the scale...
    for (count = 0; count < SIZE; count++)
    {
        if (store[count].valid == true)
        {
            if (((store[count].notes[ 0] == '1') && (store[count].notes[ 1] == '1') && 
                 (store[count].notes[ 2] == '1') && (store[count].notes[ 3] == '1')) 
                ||
                ((store[count].notes[ 1] == '1') && (store[count].notes[ 2] == '1') && 
                 (store[count].notes[ 3] == '1') && (store[count].notes[ 4] == '1'))
                ||
                ((store[count].notes[ 2] == '1') && (store[count].notes[ 3] == '1') && 
                 (store[count].notes[ 4] == '1') && (store[count].notes[ 5] == '1')) 
                ||
                ((store[count].notes[ 3] == '1') && (store[count].notes[ 4] == '1') && 
                 (store[count].notes[ 5] == '1') && (store[count].notes[ 6] == '1')) 
                ||
                ((store[count].notes[ 4] == '1') && (store[count].notes[ 5] == '1') && 
                 (store[count].notes[ 6] == '1') && (store[count].notes[ 7] == '1')) 
                ||
                ((store[count].notes[ 5] == '1') && (store[count].notes[ 6] == '1') && 
                 (store[count].notes[ 7] == '1') && (store[count].notes[ 8] == '1')) 
                ||
                ((store[count].notes[ 6] == '1') && (store[count].notes[ 7] == '1') && 
                 (store[count].notes[ 8] == '1') && (store[count].notes[ 9] == '1'))
                ||
                ((store[count].notes[ 7] == '1') && (store[count].notes[ 8] == '1') && 
                 (store[count].notes[ 9] == '1') && (store[count].notes[10] == '1'))
                ||
                ((store[count].notes[ 8] == '1') && (store[count].notes[ 9] == '1') && 
                 (store[count].notes[10] == '1') && (store[count].notes[11] == '1'))
                ||
                ((store[count].notes[ 9] == '1') && (store[count].notes[10] == '1') && 
                 (store[count].notes[11] == '1') && (store[count].notes[ 0] == '1'))
                ||
                ((store[count].notes[10] == '1') && (store[count].notes[11] == '1') && 
                 (store[count].notes[ 0] == '1') && (store[count].notes[ 1] == '1')) 
                ||
                ((store[count].notes[11] == '1') && (store[count].notes[ 0] == '1') && 
                 (store[count].notes[ 1] == '1') && (store[count].notes[ 2] == '1')))
            {
                store[count].valid = false;
                reject_4inarow++;
            }
        }
    }

    // Reject three zeros in a row
    for (count = 0; count < SIZE; count++)
    {
        if (store[count].valid == true)
        {
            if (((store[count].notes[ 0] == '0') && (store[count].notes[ 1] == '0') && 
                 (store[count].notes[ 2] == '0')) ||
                ((store[count].notes[ 1] == '0') && (store[count].notes[ 2] == '0') && 
                 (store[count].notes[ 3] == '0')) ||
                ((store[count].notes[ 2] == '0') && (store[count].notes[ 3] == '0') && 
                 (store[count].notes[ 4] == '0')) ||
                ((store[count].notes[ 3] == '0') && (store[count].notes[ 4] == '0') && 
                 (store[count].notes[ 5] == '0')) ||
                ((store[count].notes[ 4] == '0') && (store[count].notes[ 5] == '0') && 
                 (store[count].notes[ 6] == '0')) ||
                ((store[count].notes[ 5] == '0') && (store[count].notes[ 6] == '0') && 
                 (store[count].notes[ 7] == '0')) ||
                ((store[count].notes[ 6] == '0') && (store[count].notes[ 7] == '0') && 
                 (store[count].notes[ 8] == '0')) ||
                ((store[count].notes[ 7] == '0') && (store[count].notes[ 8] == '0') && 
                 (store[count].notes[ 9] == '0')) ||
                ((store[count].notes[ 8] == '0') && (store[count].notes[ 9] == '0') && 
                 (store[count].notes[10] == '0')) ||
                ((store[count].notes[ 9] == '0') && (store[count].notes[10] == '0') && 
                 (store[count].notes[11] == '0')) ||
                ((store[count].notes[10] == '0') && (store[count].notes[11] == '0') && 
                 (store[count].notes[ 0] == '0')))
            {
                store[count].valid = false;
                reject_gap3++;
            }
        }
    }

    // Now the hard part. Remove rotated equivalents. Actually, there are none, because
    // of the fact there are seven notes.
    for (count = 0; count < SIZE; count++)
    {
        if (store[count].valid == true)
        {
            for (subcount = count+1; subcount < SIZE; subcount++)
            {
                if (store[subcount].valid == true)
                {
                    // Test this pair
                    for (off = 1; off < 12; off++)
                    {
                        if ((store[count].notes[ 0] == store[subcount].notes[ 0+off | 12]) &&
                            (store[count].notes[ 1] == store[subcount].notes[ 1+off | 12]) &&
                            (store[count].notes[ 2] == store[subcount].notes[ 2+off | 12]) &&
                            (store[count].notes[ 3] == store[subcount].notes[ 3+off | 12]) &&
                            (store[count].notes[ 4] == store[subcount].notes[ 4+off | 12]) &&
                            (store[count].notes[ 5] == store[subcount].notes[ 5+off | 12]) &&
                            (store[count].notes[ 6] == store[subcount].notes[ 6+off | 12]) &&
                            (store[count].notes[ 7] == store[subcount].notes[ 7+off | 12]) &&
                            (store[count].notes[ 8] == store[subcount].notes[ 8+off | 12]) &&
                            (store[count].notes[ 9] == store[subcount].notes[ 9+off | 12]) &&
                            (store[count].notes[10] == store[subcount].notes[10+off | 12]) &&
                            (store[count].notes[11] == store[subcount].notes[11+off | 12]))
                        {
                            store[subcount].valid = false;
                            reject_rotate++;
                        }
                    }
                }
            }
        }
    }

    // See what's left...
    subcount = 0;
    for (count = 0; count < SIZE; count++)
    {
        if (store[count].valid == true)
        {
            printf("%4d - %4d - %12s - %c\n",
                subcount,
                store[count].index,
                store[count].notes, 
                (store[count].valid == false ? 'F' : 'T'));
            subcount++;
        }
    }
    printf("Total was %d.\n", subcount);
    printf("Rejected not 7 notes %5d\n",reject_not7);
    printf("Rejected 4 in a row  %5d\n",reject_4inarow);
    printf("Rejected 3 note gap  %5d\n",reject_gap3);
    printf("Rejected rotations   %5d\n",reject_rotate);

}

And here is the output, for masochists...


   0 -  315 - 111011100100 - T
   1 -  347 - 111011010100 - T
   2 -  349 - 110111010100 - T
   3 -  363 - 111010110100 - T
   4 -  365 - 110110110100 - T
   5 -  366 - 101110110100 - T
   6 -  371 - 111001110100 - T
   7 -  373 - 110101110100 - T
   8 -  374 - 101101110100 - T
   9 -  411 - 111011001100 - T
  10 -  413 - 110111001100 - T
  11 -  427 - 111010101100 - T
  12 -  429 - 110110101100 - T
  13 -  430 - 101110101100 - T
  14 -  435 - 111001101100 - T
  15 -  437 - 110101101100 - T
  16 -  438 - 101101101100 - T
  17 -  441 - 110011101100 - T
  18 -  442 - 101011101100 - T
  19 -  459 - 111010011100 - T
  20 -  461 - 110110011100 - T
  21 -  462 - 101110011100 - T
  22 -  467 - 111001011100 - T
  23 -  469 - 110101011100 - T
  24 -  470 - 101101011100 - T
  25 -  473 - 110011011100 - T
  26 -  474 - 101011011100 - T
  27 -  476 - 100111011100 - T
  28 -  603 - 111011010010 - T
  29 -  605 - 110111010010 - T
  30 -  619 - 111010110010 - T
  31 -  621 - 110110110010 - T
  32 -  622 - 101110110010 - T
  33 -  627 - 111001110010 - T
  34 -  629 - 110101110010 - T
  35 -  630 - 101101110010 - T
  36 -  667 - 111011001010 - T
  37 -  669 - 110111001010 - T
  38 -  683 - 111010101010 - T
  39 -  685 - 110110101010 - T
  40 -  686 - 101110101010 - T
  41 -  691 - 111001101010 - T
  42 -  693 - 110101101010 - T
  43 -  694 - 101101101010 - T
  44 -  697 - 110011101010 - T
  45 -  698 - 101011101010 - T
  46 -  715 - 111010011010 - T
  47 -  717 - 110110011010 - T
  48 -  718 - 101110011010 - T
  49 -  723 - 111001011010 - T
  50 -  725 - 110101011010 - T
  51 -  726 - 101101011010 - T
  52 -  729 - 110011011010 - T
  53 -  730 - 101011011010 - T
  54 -  732 - 100111011010 - T
  55 -  741 - 110100111010 - T
  56 -  742 - 101100111010 - T
  57 -  745 - 110010111010 - T
  58 -  746 - 101010111010 - T
  59 -  748 - 100110111010 - T
  60 -  811 - 111010100110 - T
  61 -  813 - 110110100110 - T
  62 -  814 - 101110100110 - T
  63 -  819 - 111001100110 - T
  64 -  821 - 110101100110 - T
  65 -  822 - 101101100110 - T
  66 -  825 - 110011100110 - T
  67 -  826 - 101011100110 - T
  68 -  843 - 111010010110 - T
  69 -  845 - 110110010110 - T
  70 -  846 - 101110010110 - T
  71 -  851 - 111001010110 - T
  72 -  853 - 110101010110 - T
  73 -  854 - 101101010110 - T
  74 -  857 - 110011010110 - T
  75 -  858 - 101011010110 - T
  76 -  860 - 100111010110 - T
  77 -  869 - 110100110110 - T
  78 -  870 - 101100110110 - T
  79 -  873 - 110010110110 - T
  80 -  874 - 101010110110 - T
  81 -  876 - 100110110110 - T
  82 -  882 - 101001110110 - T
  83 -  884 - 100101110110 - T
  84 -  915 - 111001001110 - T
  85 -  917 - 110101001110 - T
  86 -  918 - 101101001110 - T
  87 -  921 - 110011001110 - T
  88 -  922 - 101011001110 - T
  89 -  924 - 100111001110 - T
  90 -  933 - 110100101110 - T
  91 -  934 - 101100101110 - T
  92 -  937 - 110010101110 - T
  93 -  938 - 101010101110 - T
  94 -  940 - 100110101110 - T
  95 -  946 - 101001101110 - T
  96 -  948 - 100101101110 - T
  97 - 1181 - 110111001001 - T
  98 - 1197 - 110110101001 - T
  99 - 1198 - 101110101001 - T
 100 - 1205 - 110101101001 - T
 101 - 1206 - 101101101001 - T
 102 - 1209 - 110011101001 - T
 103 - 1210 - 101011101001 - T
 104 - 1229 - 110110011001 - T
 105 - 1230 - 101110011001 - T
 106 - 1237 - 110101011001 - T
 107 - 1238 - 101101011001 - T
 108 - 1241 - 110011011001 - T
 109 - 1242 - 101011011001 - T
 110 - 1244 - 100111011001 - T
 111 - 1253 - 110100111001 - T
 112 - 1254 - 101100111001 - T
 113 - 1257 - 110010111001 - T
 114 - 1258 - 101010111001 - T
 115 - 1260 - 100110111001 - T
 116 - 1325 - 110110100101 - T
 117 - 1326 - 101110100101 - T
 118 - 1333 - 110101100101 - T
 119 - 1334 - 101101100101 - T
 120 - 1337 - 110011100101 - T
 121 - 1338 - 101011100101 - T
 122 - 1357 - 110110010101 - T
 123 - 1358 - 101110010101 - T
 124 - 1365 - 110101010101 - T
 125 - 1366 - 101101010101 - T
 126 - 1369 - 110011010101 - T
 127 - 1370 - 101011010101 - T
 128 - 1372 - 100111010101 - T
 129 - 1381 - 110100110101 - T
 130 - 1382 - 101100110101 - T
 131 - 1385 - 110010110101 - T
 132 - 1386 - 101010110101 - T
 133 - 1388 - 100110110101 - T
 134 - 1394 - 101001110101 - T
 135 - 1396 - 100101110101 - T
 136 - 1429 - 110101001101 - T
 137 - 1430 - 101101001101 - T
 138 - 1433 - 110011001101 - T
 139 - 1434 - 101011001101 - T
 140 - 1436 - 100111001101 - T
 141 - 1445 - 110100101101 - T
 142 - 1446 - 101100101101 - T
 143 - 1449 - 110010101101 - T
 144 - 1450 - 101010101101 - T
 145 - 1452 - 100110101101 - T
 146 - 1458 - 101001101101 - T
 147 - 1460 - 100101101101 - T
 148 - 1481 - 110010011101 - T
 149 - 1482 - 101010011101 - T
 150 - 1484 - 100110011101 - T
 151 - 1490 - 101001011101 - T
 152 - 1492 - 100101011101 - T
 153 - 1614 - 101110010011 - T
 154 - 1622 - 101101010011 - T
 155 - 1626 - 101011010011 - T
 156 - 1628 - 100111010011 - T
 157 - 1638 - 101100110011 - T
 158 - 1642 - 101010110011 - T
 159 - 1644 - 100110110011 - T
 160 - 1650 - 101001110011 - T
 161 - 1652 - 100101110011 - T
 162 - 1686 - 101101001011 - T
 163 - 1690 - 101011001011 - T
 164 - 1692 - 100111001011 - T
 165 - 1702 - 101100101011 - T
 166 - 1706 - 101010101011 - T
 167 - 1708 - 100110101011 - T
 168 - 1714 - 101001101011 - T
 169 - 1716 - 100101101011 - T
 170 - 1738 - 101010011011 - T
 171 - 1740 - 100110011011 - T
 172 - 1746 - 101001011011 - T
 173 - 1748 - 100101011011 - T
 174 - 1764 - 100100111011 - T
Total was 175.
Rejected not 7 notes  1586
Rejected 4 in a row    245
Rejected 3 note gap     42
Rejected rotations       0
Press any key to continue

I consider this to settle the matter. There are 175 sensible looking "scales" each of which can presumably be moved up the bouzouki neck into several other positions. Multiply 175 by that number, and you'll probably see why Ousak and Hijaz are so popular...