/*  This is a test 
for every token in 
Tondef */

/*  This is a comment */
/*  This is a multi-
    line comment */

void function main ( phrase ph , int num) {
  /* Identifier test */
  int _test123;
  
  /* Data Type Test */
  int i = 0;
  bool t = true;
  bool f = false;
  string s = "String";
  
  beat a = 1 ; /* a is a whole-note beat */
  beat b = 1//4 ; /* b is a quarter-note beat */
  beat c = b + 1//2; /* c is a dotted half-note beat */
  beat d = 3 ; /* d is a 3 tied whole-notes beat */
  
  pitch pX = $C0; /* pX is the C of octave 0 */
  pitch pY = $F#5; /* pY is the F sharp of octave 5 */
  pitch pZ = $_; /* pZ is a null pitch */
  
  note a = $C0; /* a has a pitch of $C0 and a duration of zero */
  note b = $D1 : 1/4; /* b is a quarter-note at pitch $D1 */
  note c = pX : bY; /* Notes can be constructed from variables */
  
  sequence a = [ 0, 2, 4, 5, 7, 9, 11, 12 ];
  sequence b = [ 0, 4, 7 ] ;
  chord majorC = ($C4:1) :: b ; /* a whole-note C-major chord 
  spefically, the notes $C4, $E4, $G4 */
  phrase majorscaleF = ($F3:1//4) << a; /* an ascending F-major scale*/
  
  chord a; /* empty chord - no notes */
  chord b = $G5:1 ; /* chord containing a single note */
  chord c = note_x + note_y + note_z ; /* chord containing 3 notes */
  chord d = note_x :: [ 0, 7, 12 ] ; /* chord containing 3 notes 			relative to note_x */
  
  phrase a; /* empty phrase */
  chord x = ($D3:1) :: [ 0, 4, 7 ];
  phrase b = x; /* phrase that contains just chord x */
  phrase c = b @@ b ; /* c is chord x played twice */
  
  /* Block Tesst */
  while (y>20)
  {  /* start of a block for this function */
	int x = 0;
	while ( x < 10 ) 
	{ /* start of a sub-block */

	} /* end of the sub-block */
  } /* end of the block for function f */  

  /* System Functions Test */
  play (a_phrase);
  print (a_phrase);
  
  /* Punctuators tests */
  [1, 2];  
  
  /* Operators Tests */
  int y = (2);
  1 == 2;
  1 != 2;
  1 < 2;
  1 <= 2;
  1 > 2;
  1 >= 2;
  1+2;
  1-2;
  1*2;
  1/2;
  1%2;
  b1 // b2;
  !true;
  true && false;
  false || true;
  
  /* Musical Operators Tests */
  pA ^ 2;
  pB ^^ -3;
  pA - pB;
  pC : b1;
  chord a = ($C4:1) :: [ 0, 4, 7 ] ;  /* a has the notes $C4, $E4, and $G4 with whole-note duration */
  chord b = ($E5:1) :: [ 1, -2, 7 ] ; /* b has notes $F5, $D5, $B5 */
  phrase a = ($C4:1//4) << [ 0 , 4, 7, 12 ]; /* a has the notes $C4, $E4, $G4, $C5 played as quarter-notes in succession */
  phrase d = c >> 1//2 ; /* d is the chromatic scale from the above example with a half note of rest at the begging */
  p1 @@ p2;
  p1 ** p2;
  pitch a = $C4;  /* a is $C4 */
  pitch b = a;	/* b is $C4 as well */
  a = b ^ 4 ;	/* a is now $E4, and b remains $C4 */
  pitch c = b = a;  /* a,b, c are all now $E4 */

  /* Expression Tests */  
  if (x>10) { x = 11; } else { x=9; }
  
  while ( x < $C5 ) {
	x = x^1;
  }
  
  beat b = 0;
  for ( int i = 1 ; i < 10 ; i = i + 1) {
		b = b + i // 4 ;
  }
    	
  phrase z;
  foreach ( chord c in p ) {
		z = c @@ z ;
  }
  return z;
  

  
}

void function second(){
	int x;
}

/*Test */
