No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

voice.h 591B

1234567891011121314151617181920212223242526272829
  1. #ifndef VOICE_H_
  2. #define VOICE_H_
  3. #include "types.h"
  4. #include "envelope.h"
  5. #include "oscillator.h"
  6. #include "filter.h"
  7. struct Synth;
  8. struct Voice {
  9. struct Synth *synth;
  10. uint8_t note;
  11. float detune;
  12. float volume;
  13. float pan;
  14. uint32_t time;
  15. struct Envelope osc_env, filter_env;
  16. struct Oscillator osc;
  17. struct Filter filter;
  18. };
  19. void voice_init(struct Voice *voice, struct Synth *synth);
  20. void voice_note_start(struct Voice *voice, uint8_t note, uint8_t velocity);
  21. void voice_stop(struct Voice *voice);
  22. void voice_render_sample(struct Voice *voice, float *out);
  23. #endif /* VOICE_H_ */