Synth with C64 like sounds. Played on two piezo buzzers with a PS/2 keyboard. Implemented on FRDM-KL46Z
Dependencies: PS2 TSI beep2 mbed
Diff: C64Synth.cpp
- Revision:
- 1:9cc595290b2f
- Parent:
- 0:00eec4d97228
- Child:
- 2:a8ec77eed4cc
diff -r 00eec4d97228 -r 9cc595290b2f C64Synth.cpp --- a/C64Synth.cpp Fri Jan 24 09:50:24 2014 +0000 +++ b/C64Synth.cpp Fri Jan 24 09:58:51 2014 +0000 @@ -286,11 +286,10 @@ /* -- PlayArp -- * -* @description: Plays an arpeggio of the provided chord. Arp speed can be controlled by touch slider or pgup/pgdown setting. PWM duty cycle is sweeped automatically +* Plays an arpeggio of the provided chord. Arp speed can be controlled by touch slider or pgup/pgdown setting. PWM duty cycle is sweeped automatically * -* @param: the chord as a character. UPPER CASE is major chords, lower case is minor chords. +* @param chord the chord to be played UPPER CASE is major chords, lower case is minor chords. * -* @result: none */ void playArp(char chord) { @@ -320,9 +319,11 @@ * * @description: Plays a note on the provided buzzer * -* @param: the buzzer to play the note on, the note as a character, the duty cycle value, the length of the note. +* @param buz the buzzer to play the note on, +* @param note the note to be played +* @param dc the duty cycle value +* @param the length of the note * -* @result: none */ void playNote(Beep buz, char note,float dc,float len) { @@ -338,11 +339,11 @@ /* -- PlayContNote -- * -* @description: Plays a continuous note on the second buzzer +* Plays a continuous note on the second buzzer * -* @param: the note as a character, the octave as int, the duty cycle value as float -* -* @result: none +* @param note the note to be played +* @param oct the octave + @param dc the duty cycle of the note */ void playContNote(char note,int oct,float dc) { @@ -361,13 +362,13 @@ lastNote = note; } -/* -- getNotes -- +/* * -* @description: Gets the notes in a chord +* Gets the notes in a chord * -* @param: the chord as a character and a pointer to the array to save to notes in. +* @param chord the chord +* @param notes the array to save the notes in * -* @result: none */ void getNotes(char chord, char* notes) @@ -405,13 +406,13 @@ } -/* -- getFq -- +/* * -* @description: gets the frequency of the note +* Gets the frequency of the note * -* @param: the note as a character and a boolean telling if the note is a # +* @param note the note * -* @result: the frequency as flot +* @return the frequency as float */ float getFq(char note, bool sharp) {