MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Sampler

Method Sampler

Source/Sampler.cpp:36–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include "Scale.h"
35
36Sampler::Sampler()
37: IAudioProcessor(gBufferSize)
38, mPolyMgr(this)
39, mNoteInputBuffer(this)
40, mWriteBuffer(gBufferSize)
41{
42 mSampleData = new float[MAX_SAMPLER_LENGTH]; //store up to 2 seconds
43 Clear(mSampleData, MAX_SAMPLER_LENGTH);
44
45 mVoiceParams.mVol = .5f;
46 mVoiceParams.mAdsr.Set(10, 0, 1, 10);
47 mVoiceParams.mSampleData = mSampleData;
48 mVoiceParams.mSampleLength = 0;
49 mVoiceParams.mDetectedFreq = -1;
50 mVoiceParams.mLoop = false;
51
52 mPolyMgr.Init(kVoiceType_Sampler, &mVoiceParams);
53
54 //mWriteBuffer.SetNumActiveChannels(2);
55}
56
57void Sampler::CreateUIControls()
58{

Callers

nothing calls this directly

Calls 3

ClearFunction · 0.85
SetMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected