MCPcopy Create free account
hub / github.com/FastLED/FastLED / makeSine

Function makeSine

tests/misc/fft_sweep.hpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using namespace ::fl;
30
31::fl::vector<::fl::i16> makeSine(float freq, int count = 512,
32 float sampleRate = 44100.0f,
33 float amplitude = 16000.0f) {
34 ::fl::vector<::fl::i16> samples;
35 samples.reserve(count);
36 for (int i = 0; i < count; ++i) {
37 float phase = 2.0f * FL_M_PI * freq * i / sampleRate;
38 samples.push_back(static_cast<::fl::i16>(amplitude * ::fl::sinf(phase)));
39 }
40 return samples;
41}
42
43// --- Continuous sweep infrastructure for issue #2193 ---
44

Callers 2

runContinuousSweepFunction · 0.85
fft_sweep.hppFile · 0.85

Calls 3

sinfFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected