Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

79 linhas
3.1KB

  1. /* Audio Library for Teensy 3.X
  2. * Copyright (c) 2014, Paul Stoffregen, paul@pjrc.com
  3. *
  4. * Development of this audio library was funded by PJRC.COM, LLC by sales of
  5. * Teensy and Audio Adaptor boards. Please support PJRC's efforts to develop
  6. * open source software by purchasing Teensy or other PJRC products.
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice, development funding notice, and this permission
  16. * notice shall be included in all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. #ifndef Audio_h_
  27. #define Audio_h_
  28. // When changing multiple audio object settings that must update at
  29. // the same time, these functions allow the audio library interrupt
  30. // to be disabled. For example, you may wish to begin playing a note
  31. // in response to reading an analog sensor. If you have "velocity"
  32. // information, you might start the sample playing and also adjust
  33. // the gain of a mixer channel. Use AudioNoInterrupts() first, then
  34. // make both changes to the 2 separate objects. Then allow the audio
  35. // library to update with AudioInterrupts(). Both changes will happen
  36. // at the same time, because AudioNoInterrupts() prevents any updates
  37. // while you make changes.
  38. //
  39. #define AudioNoInterrupts() (NVIC_DISABLE_IRQ(IRQ_SOFTWARE))
  40. #define AudioInterrupts() (NVIC_ENABLE_IRQ(IRQ_SOFTWARE))
  41. // include all the library headers, so a sketch can use a single
  42. // #include <Audio.h> to get the whole library
  43. //
  44. #include "analyze_fft256.h"
  45. #include "analyze_print.h"
  46. #include "analyze_tonedetect.h"
  47. #include "analyze_peakdetect.h"
  48. #include "control_sgtl5000.h"
  49. #include "control_wm8731.h"
  50. #include "effect_chorus.h"
  51. #include "effect_fade.h"
  52. #include "effect_flange.h"
  53. #include "filter_biquad.h"
  54. #include "filter_fir.h"
  55. #include "input_adc.h"
  56. #include "input_i2s.h"
  57. #include "mixer.h"
  58. #include "output_dac.h"
  59. #include "output_i2s.h"
  60. #include "output_pwm.h"
  61. #include "play_memory.h"
  62. #include "play_sd_raw.h"
  63. #include "play_sd_wav.h"
  64. #include "synth_tonesweep.h"
  65. #include "synth_sine.h"
  66. #include "synth_waveform.h"
  67. // TODO: more audio processing objects....
  68. // sine wave with frequency modulation (phase)
  69. // waveforms with bandwidth limited tables for synth
  70. // envelope: attack-decay-sustain-release, maybe other more complex?
  71. #endif