Browse Source

Add AudioSynthWaveformDc read()

dds
PaulStoffregen 7 years ago
parent
commit
15e2c363b3
2 changed files with 8 additions and 0 deletions
  1. +4
    -0
      gui/index.html
  2. +4
    -0
      synth_dc.h

+ 4
- 0
gui/index.html View File

@@ -2071,6 +2071,10 @@ The actual packets are taken
be specified, but periods longer than 1 second may be automatically
shortened for small level changes, due to numerical precision limits.
</p>
<p class=func><span class=keyword>read</span>();</p>
<p class=desc>Read the current level. Returns -1.0 to 1.0. This can be
useful for monitoring the amplitude after configuring a slow change.
</p>
<!--
<h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt;

+ 4
- 0
synth_dc.h View File

@@ -127,6 +127,10 @@ public:
state = 1;
__enable_irq();
}
float read(void) {
int32_t m = magnitude;
return (float)m * (1.0 / 2147418112.0);
}
virtual void update(void);
private:
uint8_t state; // 0=steady output, 1=transitioning

Loading…
Cancel
Save