Browse Source

Add isActive() and isSustain() to envelope

dds
PaulStoffregen 6 years ago
parent
commit
4d98116e6f
4 changed files with 26 additions and 0 deletions
  1. +14
    -0
      effect_envelope.cpp
  2. +2
    -0
      effect_envelope.h
  3. +8
    -0
      gui/index.html
  4. +2
    -0
      keywords.txt

+ 14
- 0
effect_envelope.cpp View File

release(block); release(block);
} }


bool AudioEffectEnvelope::isActive()
{
uint8_t current_state = *(volatile uint8_t *)&state;
if (current_state == STATE_IDLE) return false;
return true;
}

bool AudioEffectEnvelope::isSustain()
{
uint8_t current_state = *(volatile uint8_t *)&state;
if (current_state == STATE_SUSTAIN) return true;
return false;
}


+ 2
- 0
effect_envelope.h View File

release_forced_count = milliseconds2count(milliseconds); release_forced_count = milliseconds2count(milliseconds);
if (release_count == 0) release_count = 1; if (release_count == 0) release_count = 1;
} }
bool isActive();
bool isSustain();
using AudioStream::release; using AudioStream::release;
virtual void update(void); virtual void update(void);
private: private:

+ 8
- 0
gui/index.html View File

disable this feature (never extra latency). Longer times help disable this feature (never extra latency). Longer times help
reduce clicks or pops. The default is 5 millisecond. reduce clicks or pops. The default is 5 millisecond.
</p> </p>
<p class=func><span class=keyword>isActive</span>();</p>
<p class=desc>Returns true when the envelope is currently in any of
its 6 phases.
</p>
<p class=func><span class=keyword>isSustain</span>();</p>
<p class=desc>Returns true when the envelope is currently in the
sustain phase.
</p>
<h3>Examples</h3> <h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
</p> </p>

+ 2
- 0
keywords.txt View File

sustain KEYWORD2 sustain KEYWORD2
release KEYWORD2 release KEYWORD2
releaseNoteOn KEYWORD2 releaseNoteOn KEYWORD2
isActive KEYWORD2
isSustain KEYWORD2
inputLevel KEYWORD2 inputLevel KEYWORD2
inputSelect KEYWORD2 inputSelect KEYWORD2
muteHeadphone KEYWORD2 muteHeadphone KEYWORD2

Loading…
Cancel
Save