  * Load the given RAD file from SD card.
  */
 void loadRadFile(char* fileName) {
-  radFile.open(fileName);
-
-  radFile.seekSet(0x11);
-  byte songProps = radFile.read();
-  hasSlowTimer = (songProps & 0x40) != 0x00;
-  initialSpeed = songProps & 0x1F;
-
-  // Skip song description block if available.
-  if ((songProps & 0x80) != 0x00) {
-    while (radFile.read() != 0x00);
-  }
-
-  // Read instruments.
-  byte instrumentNum = 0;
-  while ((instrumentNum = radFile.read()) != 0x00) {
-    instrumentNum --;
-    for (byte i = 0; i < 9; i ++) {
-      instruments[instrumentNum][i] = radFile.read();
-    }
-    instruments[instrumentNum][9]  =  radFile.read() & 0x07;
-    instruments[instrumentNum][9] += (radFile.read() & 0x07) << 4;
-  }
-
-  // Read song length, order list offset and skip order list.
-  songLength = radFile.read();
-  orderListOffset = radFile.curPosition();
-  radFile.seekSet(orderListOffset + songLength);
-
-  // Read pattern offsets.
-  for (byte i = 0; i < 32; i++) {
-    patternOffsets[i] = radFile.read() + (radFile.read() << 8);
-  }
-}
+	radFile.open(fileName);
+
+	radFile.seekSet(0x11);
+	byte songProps = radFile.read();
+	hasSlowTimer = (songProps & 0x40) != 0x00;
+	initialSpeed = songProps & 0x1F;
+
+	// Skip song description block if available.
+	if ((songProps & 0x80) != 0x00) {
+		while (radFile.read() != 0x00);
+	}
+
+	// Read instruments.
+	byte instrumentNum = 0;
+	while ((instrumentNum = radFile.read()) != 0x00) {
+		instrumentNum --;
+		for (byte i = 0; i < 9; i ++) {
+			instruments[instrumentNum][i] = radFile.read();
+		}
+		instruments[instrumentNum][9]  =  radFile.read() & 0x07;
+		instruments[instrumentNum][9] += (radFile.read() & 0x07) << 4;
+	}
+
+	// Read song length, order list offset and skip order list.
+	songLength = radFile.read();
+	orderListOffset = radFile.curPosition();
+	radFile.seekSet(orderListOffset + songLength);
+
+	// Read pattern offsets.
+	for (byte i = 0; i < 32; i++) {
+		patternOffsets[i] = radFile.read() + (radFile.read() << 8);
+	}
+}
 * destination pitch is reached.
 */
void pitchAdjustToNote(byte channel) {
  if (pitchSlideDest[channel] == 0x0000) return;

  unsigned int slidePos = opl2.getBlock(channel) << 12;
  slidePos += opl2.getFNumber(channel);

  // Slide pitch up and compensate any overshoot.
  if (slidePos < pitchSlideDest[channel]) {
    slidePos = pitchAdjust(channel, pitchSlideSpeed[channel]);
    if (slidePos >= pitchSlideDest[channel]) {
      opl2.setBlock  (channel, (pitchSlideDest[channel] & 0xF000) >> 12);
      opl2.setFNumber(channel,  pitchSlideDest[channel] & 0x0FFF);
      pitchSlideDest[channel] = 0x0000;
    }

  // Slide pitch down and compensate for any undershoot.
  } else if (slidePos > pitchSlideDest[channel]) {
    slidePos = pitchAdjust(channel, -pitchSlideSpeed[channel]);
    if (slidePos <= pitchSlideDest[channel]) {
      opl2.setBlock  (channel, (pitchSlideDest[channel] & 0xF000) >> 12);
      opl2.setFNumber(channel,  pitchSlideDest[channel] & 0x0FFF);
      pitchSlideDest[channel] = 0x0000;
    }
  }
}



 * reached we may loop back to the beginning if loopSong is true.
 */
void nextOrder(byte startLine = 0) {
	// Increment order and read patternIndex, may loop song when we've reached the end.
	order ++;
	if (order >= songLength && loopSong) {
		order = 0;
	}
	radFile.seekSet(orderListOffset + order);
	byte patternIndex = radFile.read();

	// If bit 7 is set then we're looking at an order jump.
	if (patternIndex & 0x80) {
		order = patternIndex & 0x7F;
		radFile.seekSet(orderListOffset + order);
		patternIndex = radFile.read();
	}

	// Set file offset to the start of the next order and skip lines until we're
	// at the requested startLine.
	radFile.seekSet(patternOffsets[patternIndex]);
	endOfPattern = false;
	for (line = 0; line < startLine; line ++) {
		readLine();
	}
}


