corrected some warning messages

and read me...
pull/18/head
Gaudi 8 years ago
parent d1b5051f5e
commit 91ab9ad85b
  1. 4
      Open_Theremin_V3/EEPROM.h
  2. 4
      Open_Theremin_V3/application.cpp
  3. 4
      Open_Theremin_V3/application.h
  4. 2
      Open_Theremin_V3/timer.h
  5. 6
      README.md
  6. 24
      README.md~

@ -40,7 +40,7 @@ struct EERef{
//Access/read members. //Access/read members.
uint8_t operator*() const { return eeprom_read_byte( (uint8_t*) index ); } uint8_t operator*() const { return eeprom_read_byte( (uint8_t*) index ); }
operator const uint8_t() const { return **this; } operator uint8_t() const { return **this; }
//Assignment/write members. //Assignment/write members.
EERef &operator=( const EERef &ref ) { return *this = *ref; } EERef &operator=( const EERef &ref ) { return *this = *ref; }
@ -89,7 +89,7 @@ struct EEPtr{
EEPtr( const int index ) EEPtr( const int index )
: index( index ) {} : index( index ) {}
operator const int() const { return index; } operator int() const { return index; }
EEPtr &operator=( int in ) { return index = in, *this; } EEPtr &operator=( int in ) { return index = in, *this; }
//Iterator functionality. //Iterator functionality.

@ -159,7 +159,6 @@ AppMode Application::nextMode() {
void Application::loop() { void Application::loop() {
int32_t pitch_v = 0, pitch_l = 0; // Last value of pitch (for filtering) int32_t pitch_v = 0, pitch_l = 0; // Last value of pitch (for filtering)
int32_t vol_v = 0, vol_l = 0; // Last value of volume (for filtering) int32_t vol_v = 0, vol_l = 0; // Last value of volume (for filtering)
int32_t pitch_f = 0; // pitch in frequency (for filtering)
uint16_t volumePotValue = 0; uint16_t volumePotValue = 0;
uint16_t pitchPotValue = 0; uint16_t pitchPotValue = 0;
@ -231,7 +230,7 @@ void Application::loop() {
OCR0A = pitch & 0xff; OCR0A = pitch & 0xff;
#endif #endif
#if L_ENABLED #if SERIAL_ENABLED
if (timerExpired(TICKS_100_MILLIS)) { if (timerExpired(TICKS_100_MILLIS)) {
resetTimer(); resetTimer();
Serial.write(pitch & 0xff); // Send char on serial (if used) Serial.write(pitch & 0xff); // Send char on serial (if used)
@ -245,7 +244,6 @@ void Application::loop() {
pitch_v=pitch_l+((pitch_v-pitch_l)>>2); pitch_v=pitch_l+((pitch_v-pitch_l)>>2);
pitch_l=pitch_v; pitch_l=pitch_v;
pitch_f=FREQ_FACTOR/pitch_v;
//HW_LED2_ON; //HW_LED2_ON;

@ -55,8 +55,8 @@ class Application {
unsigned long GetQMeasurement(); unsigned long GetQMeasurement();
static const float HZ_ADDVAL_FACTOR = 2.09785; const float HZ_ADDVAL_FACTOR = 2.09785;
static const float MIDDLE_C = 261.6; const float MIDDLE_C = 261.6;
void playNote(float hz, uint16_t milliseconds, uint8_t volume); void playNote(float hz, uint16_t milliseconds, uint8_t volume);
void hzToAddVal(float hz); void hzToAddVal(float hz);

@ -34,6 +34,8 @@ inline bool timerUnexpiredMillis(uint16_t milliseconds) {
void ticktimer (uint16_t ticks); void ticktimer (uint16_t ticks);
void millitimer (uint16_t milliseconds); void millitimer (uint16_t milliseconds);
#if SERIAL_ENABLED
const uint16_t TICKS_100_MILLIS = millisToTicks(100); const uint16_t TICKS_100_MILLIS = millisToTicks(100);
#endif //SERIAL_ENABLED
#endif // _TIMER_H #endif // _TIMER_H

@ -20,3 +20,9 @@ http://www.gaudi.ch/OpenTheremin/
3. Selecting the correct usb port on Tools -> Serial Port 3. Selecting the correct usb port on Tools -> Serial Port
4. Select the correct arduino board from Tools -> Board 4. Select the correct arduino board from Tools -> Board
5. Upload the code by clicking on the upload button. 5. Upload the code by clicking on the upload button.
### LICENSE
Written by Urs Gaudenz, GaudiLabs, 2016
GNU license, check LICENSE file for more information
All text above must be included in any redistribution

@ -1,2 +1,22 @@
# OpenTheremin_V3 ## Open.Theremin V3 control software
Open Source Theremin Instrument, Arudino Codes
Arduino UNO Software for the Open.Theremin
### Don't click on the files!
Click on the "Download ZIP" Button to the right or [Click here](https://github.com/GaudiLabs/OpenTheremin_V3/archive/master.zip)
Then unpack the archive.
### Open Source Theremin based on the Arduino Platform
Open.Theremin is an arduino shield to build the legendary music instrument invented by Leon Theremin back in 1920. The theremin is played with two antennas, one to control the pitch and one for volume. The electronic shield with two ports to connect those antennas comprises two heterodyne oscillators to measure the distance of the hand to the antenna when playing the instrument. The resulting signal is fed into the arduino. After linearization and filtering the arduino generates the instruments sound that is then played through a high quality digital analog audio converter on the board. The characteristics of the sound can be determined by a wave table on the arduino.
For more info on the open source project and on availability of ready made shield see:
http://www.gaudi.ch/OpenTheremin/
### Installation
1. Open up the Arduino IDE
2. Open the File "Open_Theremin_V3.ino"
3. Selecting the correct usb port on Tools -> Serial Port
4. Select the correct arduino board from Tools -> Board
5. Upload the code by clicking on the upload button.

Loading…
Cancel
Save