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

Method DoWrite

Source/Producer.cpp:197–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void Producer::DoWrite()
198{
199 if (mSample)
200 {
201 ChannelBuffer sample(mSample->LengthInSamples());
202 sample.CopyFrom(mSample->Data());
203 for (int i = 0; i < PRODUCER_NUM_BIQUADS; ++i)
204 mBiquad[i].ProcessAudio(gTime, &sample);
205
206 float* toWrite = new float[mSample->LengthInSamples()];
207 int pos = 0;
208 for (int i = 0; i < mSample->LengthInSamples(); ++i)
209 {
210 if (IsSkipMeasure(GetMeasureForSample(i)) == false)
211 {
212 toWrite[pos] = sample.GetChannel(0)[i];
213 ++pos;
214 }
215 }
216
217 Sample::WriteDataToFile(ofGetTimestampString("producer/producer_%Y-%m-%d_%H-%M.wav").c_str(), &toWrite, pos);
218 mClipStart = 0;
219 mClipEnd = mSample->LengthInSamples();
220 mOffset = 0;
221
222 mZoomStart = 0;
223 mZoomEnd = mClipEnd;
224 mZoomStartSlider->SetExtents(0, mClipEnd);
225 mZoomEndSlider->SetExtents(0, mClipEnd);
226 UpdateZoomExtents();
227 }
228}
229
230void Producer::UpdateZoomExtents()
231{

Callers

nothing calls this directly

Calls 7

ofGetTimestampStringFunction · 0.85
LengthInSamplesMethod · 0.80
DataMethod · 0.80
GetChannelMethod · 0.80
CopyFromMethod · 0.45
ProcessAudioMethod · 0.45
SetExtentsMethod · 0.45

Tested by

no test coverage detected