Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
resources:tools-software:sharc-audio-module:baremetal:tremelo-effect-tutorial [14 Nov 2018 22:23] – [Tutorial: Implementing a Tremolo Effect] Chad Wentworthresources:tools-software:sharc-audio-module:baremetal:tremelo-effect-tutorial [31 Jan 2019 19:40] – [Using SW2 on the Audio Project Fin to Set the Tremolo Rate] Chad Wentworth
Line 81: Line 81:
 ==== Enabling / Disabling the Tremolo with SW1 on the Audio Project Fin ==== ==== Enabling / Disabling the Tremolo with SW1 on the Audio Project Fin ====
  
-We may not want the tremolo enabled all the time so let's use one of the buttons on the Audio Project Fin to enable / disable the tremolo effect.  Each of the buttons on the Audio Project Fin is mapped to a default callback that can be found in ''Callback_Pushbuttons.cpp'' in the ARM core (''sam_baremetal_framework_core0'').  In these callbacks, the LED below each button is toggled by default and a field in the multicore memory structure is written to indicate that a button event has happened.  The nice thing is that we don't need to change any of this default pushbutton callback behavior to use SW1 to enable / disable our effect.+We may not want the tremolo enabled all the time so let's use one of the buttons on the Audio Project Fin to enable / disable the tremolo effect.  Each of the buttons on the Audio Project Fin is mapped to a default callback that can be found in ''Callback_Pushbuttons.cpp'' in the ARM core (''<PROJECT_NAME>_core0'').  In these callbacks, the LED below each button is toggled by default and a field in the multicore memory structure is written to indicate that a button event has happened.  The nice thing is that we don't need to change any of this default pushbutton callback behavior to use SW1 to enable / disable our effect.
  
 In our audio callback, we'll add a new variable called ''tremolo_enabled'' which will be set to false initially.  At the bottom of this callback, we'll check to see if SW1/PB_1 has been pressed and if so, we'll toggle the ''tremolo_enabled'' When it comes time to process the input buffers, we'll check to see if tremolo_enabled is true.  If so, we'll apply the effect and if not, we'll just pass the audio through. In our audio callback, we'll add a new variable called ''tremolo_enabled'' which will be set to false initially.  At the bottom of this callback, we'll check to see if SW1/PB_1 has been pressed and if so, we'll toggle the ''tremolo_enabled'' When it comes time to process the input buffers, we'll check to see if tremolo_enabled is true.  If so, we'll apply the effect and if not, we'll just pass the audio through.
Line 210: Line 210:
  
 ---- ----
-{{navigation SHARC Audio Module#volume-control-tutorial|Implementing a Basic Volume Control#.|Bare Metal Framework#ring-modulator-effect-tutorial|Implementing a Ring Modulator Effect}}+{{navigation SHARC Audio Module#using-both-cores|Audio Processing Basics#.|Bare Metal Framework#ring-modulator-effect-tutorial|Implementing a Ring Modulator Effect}}
  
resources/tools-software/sharc-audio-module/baremetal/tremelo-effect-tutorial.txt · Last modified: 26 Feb 2019 20:17 by Chad Wentworth