mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a mistake in the SurroundProcessor demo
This commit is contained in:
parent
28730a28c8
commit
dc7853d342
1 changed files with 8 additions and 12 deletions
|
|
@ -28,15 +28,11 @@
|
|||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class SurroundProcessor : public AudioProcessor, public ChannelClickListener
|
||||
class SurroundProcessor : public AudioProcessor,
|
||||
public ChannelClickListener
|
||||
{
|
||||
public:
|
||||
|
||||
//==============================================================================
|
||||
SurroundProcessor()
|
||||
{
|
||||
}
|
||||
|
||||
SurroundProcessor() {}
|
||||
~SurroundProcessor() {}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -54,14 +50,14 @@ public:
|
|||
{
|
||||
buffer.clear();
|
||||
|
||||
const int fillSamples
|
||||
= jmin (static_cast<int> (std::ceil (getSampleRate())) - sampleOffset, buffer.getNumSamples());
|
||||
const int fillSamples = jmin (static_cast<int> (std::ceil (getSampleRate())) - sampleOffset,
|
||||
buffer.getNumSamples());
|
||||
|
||||
float* channelBuffer = buffer.getWritePointer (channelClicked);
|
||||
const float freq = 440.f / static_cast<float> (getSampleRate());
|
||||
float* const channelBuffer = buffer.getWritePointer (channelClicked);
|
||||
const float freq = (float) (440.0 / getSampleRate());
|
||||
|
||||
for (int i = 0; i < fillSamples; ++i)
|
||||
channelBuffer[i] = std::sin (2.0f * static_cast<float> (M_PI) * freq * static_cast<float> (sampleOffset++));
|
||||
channelBuffer[i] = std::sin (2.0f * float_Pi * freq * static_cast<float> (sampleOffset++));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue