Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ArduinoSynth
============

This is a fork of Illutron's ArduinoSynth repo.

__Arduino MEGA__ boards: Pin __10__
__Arduino ATmega328/168 based__ boards (Duemilanove, Uno, etc.): Pin __6__

__Implemented features:__
-Compatibility with Arduino MEGA(2560) boards


__What's to be added is:__
-Basic documentation
-Choosing output pin manually, although only PWM (originally fixed to pin 6)
13 changes: 12 additions & 1 deletion synthOriginal/the_synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ SIGNAL(TIMER1_COMPA_vect)
//-------------------------------
// Synthesizer/audio mixer
//-------------------------------


#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) //Arduino MEGA(2560) boards
OCR2A=127+
#else //Arduino ATmega168/328 based boards
OCR0A=127+
#endif
((
(((signed char)pgm_read_byte(wavs[0]+((PCW[0]+=FTW[0])>>8))*AMP[0])>>8)+
(((signed char)pgm_read_byte(wavs[1]+((PCW[1]+=FTW[1])>>8))*AMP[1])>>8)+
Expand Down Expand Up @@ -282,10 +286,17 @@ void initSynth()
SET(TIMSK1,OCIE1A); // |
sei(); //-+

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) //Arduino MEGA(2560) boards
TCCR2A=0x83; //-8 bit audio PWM
TCCR2B=0x01; // |
OCR2A=127; //-+
SET(DDRB,4); //-PWM pin
#else //Arduino ATmega328/168 based boards
TCCR0A=0x83; //-8 bit audio PWM
TCCR0B=0x01; // |
OCR0A=127; //-+
SET(DDRD,6); //-PWM pin
#endif
/*
UCSR0A=0x02; //-Set up serial port 31250
UCSR0B=0x18; // |
Expand Down