voices.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright 2016 Jack Humbert
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <stdint.h>
  17. #include <stdbool.h>
  18. #if defined(__AVR__)
  19. #include <avr/io.h>
  20. #endif
  21. #include "wait.h"
  22. #include "luts.h"
  23. #ifndef VOICES_H
  24. #define VOICES_H
  25. float voice_envelope(float frequency, uint8_t timer_index);
  26. typedef enum {
  27. default_voice,
  28. #ifdef AUDIO_VOICES
  29. something,
  30. drums,
  31. butts_fader,
  32. octave_crunch,
  33. duty_osc,
  34. duty_octave_down,
  35. delayed_vibrato,
  36. // delayed_vibrato_octave,
  37. // duty_fifth_down,
  38. // duty_fourth_down,
  39. // duty_third_down,
  40. // duty_fifth_third_down,
  41. #endif
  42. number_of_voices // important that this is last
  43. } voice_type;
  44. void set_all_voices(voice_type v);
  45. void all_voices_iterate(void);
  46. void all_voices_deiterate(void);
  47. void set_voice(voice_type v, uint8_t timer_index);
  48. void voice_iterate(uint8_t timer_index);
  49. void voice_deiterate(uint8_t timer_index);
  50. #endif