Compiling Error with "Playtune" Code

Hello,

I will try to be as concise as possible when explaining the errors I am receiving. Basically, I am simply trying to compile "Playtunes", which is a piece of code that turns an Arduino into a very simple synthesizer. You can read a brief overview of what this code does here:

http://code.google.com/p/arduino-playtune/

When I try to compile it, I receive the following error messages:

In file included from sketch_apr14a.cpp:11:
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:37:22: error: WProgram.h: No such file or directory
In file included from sketch_apr14a.cpp:11:
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:42: error: 'byte' has not been declared
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:43: error: 'byte' has not been declared
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:44: error: 'boolean' does not name a type
sketch_apr14a.cpp: In function 'void loop()':
sketch_apr14a:188: error: no matching function for call to 'Playtune::tune_playscore(byte [3204])'
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:43: note: candidates are: void Playtune::tune_playscore(int*)
sketch_apr14a:189: error: 'class Playtune' has no member named 'tune_playing'

That's about it. Here is more information that may be helpful:

  • Running Windows Vista 64 bit
  • Directory: C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune
  • Files in Playtune library: Playtune.cpp, Playtune.h
  • UNO
//**************************************************
//
// Test of playtune library for Arduino NANO
//
// L. Shustek, 31 Jan 2011, initial release.
// L. Shustek, 27 Feb 2011, new score data
//
//**************************************************


#include <Playtune.h>

//------------------------------------------------
//   scores are put in program space memory
//------------------------------------------------

// Playtune bytestream for file "bach_bwv798.mid" created by MIDITONES V1.1 on Sun Feb 27 12:45:00 2011
byte PROGMEM score [] = {
  // Sinfonia No.12 in A major BWV.798 J.S.Bach
  // Conductor Track
  7,208, 0x90,0x45, 0x91,0x39, 1,77, 0x80, 0x81, 0x90,0x44, 0,166, 0x80, 0x90,0x45, 0,166, 0x80, 0x90,0x47, 
  0x91,0x38, 1,77, 0x80, 0x81, 0x90,0x45, 0,166, 0x80, 0x90,0x44, 0,166, 0x80, 0x90,0x45, 0x91,0x36, 1,77, 
  0x81, 1,77, 0x91,0x31, 0,166, 0x80, 0x90,0x47, 0,166, 0x80, 0x81, 0x90,0x44, 0,166, 0x80, 0x90,0x45, 
  0,166, 0x80, 0x90,0x47, 0x91,0x32, 0,166, 0x80, 0x90,0x40, 0,166, 0x80, 0x81, 0x90,0x49, 0,166, 0x80, 
  0x90,0x40, 0,166, 0x80, 0x90,0x4A, 0x91,0x34, 0,166, 0x80, 0x90,0x40, 0,166, 0x80, 0x81, 0x90,0x4C, 1,77, 
  0x80, 0x90,0x49, 0x91,0x2D, 0,166, 0x80, 0x90,0x47, 0,166, 0x80, 0x81, 0x90,0x45, 0x91,0x39, 0,166, 0x80, 
  0x90,0x47, 0,166, 0x80, 0x81, 0x90,0x49, 0x91,0x38, 0,166, 0x80, 0x90,0x4B, 0,166, 0x80, 0x81, 0x90,0x4C, 
  0x91,0x36, 0,166, 0x80, 0x90,0x4E, 0,166, 0x80, 0x81, 0x90,0x50, 0x91,0x34, 0x92,0x40, 0,166, 0x80, 0x90,0x51, 
  0,166, 0x80, 0x81, 0x82, 0x90,0x53, 0x91,0x3F, 0,166, 0x81, 0x91,0x40, 0,166, 0x81, 0x91,0x3F, 0x92,0x42, 
  0,166, 0x80, 0x90,0x51, 0,166, 0x80, 0x81, 0x82, 0x90,0x50, 0x91,0x40, 0,166, 0x80, 0x81, 0x90,0x4E, 0x91,0x3F, 
  0,166, 0x80, 0x81, 0x90,0x4C, 0x91,0x3D, 0x92,0x40, 0,166, 0x80, 0x90,0x4B, 0,166, 0x80, 0x81, 0x90,0x49, 
  0,166, 0x80, 0x90,0x47, 0,166, 0x80, 0x90,0x4C, 0x91,0x38, 0,166, 0x82, 0x92,0x42, 0,166, 0x81, 0x82, 
  0x91,0x3F, 0,166, 0x81, 0x91,0x40, 0,166, 0x81, 0x91,0x42, 0x92,0x39, 0,166, 0x81, 0x91,0x3B, 0,166, 
  0x81, 0x82, 0x91,0x44, 0,166, 0x81, 0x91,0x3B, 0,166, 0x80, 0x81, 0x90,0x45, 0x91,0x4B, 0x92,0x3B, 0,166, 
  0x80, 0x82, 0x90,0x3B, 0,166, 0x80, 0x90,0x47, 1,77, 0x80, 0x81, 0x90,0x4C, 0x91,0x44, 0x92,0x40, 0,166, 
  0x81, 0x91,0x45, 0,166, 0x80, 0x81, 0x82, 0x90,0x4A, 0x91,0x47, 0,166, 0x80, 0x81, 0x90,0x49, 0x91,0x45, 0,166, 
  0x80, 0x81, 0x90,0x4A, 0x91,0x44, 0,166, 0x80, 0x81, 0x90,0x4C, 0x91,0x42, 0,166, 0x80, 0x81, 0x90,0x4E, 0x91,0x40, 
  0,166, 0x80, 0x81, 0x90,0x50, 0x91,0x3E, 0,166, 0x80, 0x81, 0x90,0x51, 0x91,0x3D, 0x92,0x39, 0,166, 0x81, 
  0x91,0x49, 0,166, 0x81, 0x82, 0x91,0x4E, 0x92,0x38, 0,166, 0x80, 0x82, 0x90,0x51, 0x92,0x39, 0,166, 0x80, 
  0x82, 0x90,0x50, 0x92,0x3B, 0,166, 0x81, 0x91,0x4B, 0,166, 0x81, 0x82, 0x91,0x4C, 0x92,0x39, 0,166, 0x80, 
  0x82, 0x90,0x50, 0x92,0x38, 0,166, 0x80, 0x82, 0x90,0x4E, 0x92,0x39, 0,166, 0x81, 0x91,0x49, 0,166, 0x81, };
// This score contains 3203 bytes, and 3 tone generators are used.


Playtune pt;

void setup() {

  // Enable all 3 NANO timers for notes that are output on digital pins 10, 11, and 12.
  // Those pins should be wired to 500-ohm resistors, the other ends of which should be connected together
  // to one terminal of an 8-ohm speaker.  The other terminal of the speaker should be connected to ground.  
  // No other hardware is needed!

  pt.tune_initchan (10); 
  pt.tune_initchan (11);
  pt.tune_initchan (12);
}

void loop () {
  pt.tune_playscore (score);  /* start playing */
  while (pt.tune_playing) ;   /* wait here until playing stops */
}

boingaon:
C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune/Playtune.h:37:22: error: WProgram.h: No such file or directory

http://arduino.cc/forum/index.php/topic,97455.0.html

Paragraph 2.

Thank you, that helped reduce the amount of errors. I am now receiving this:

C:\Users\Preston\Desktop\arduino-1.0\libraries\Playtune\Playtune.cpp:190:20: error: wiring.h: No such file or directory

I am confused since the author does not provide this file.

(deleted)

It didn't work- I still the same error about wiring.h

Do the same thing. Replace wiring.h by Arduino.h.

Perfect thank you