Krotos Modules 3
Loading...
Searching...
No Matches
Kwidget_Reformer.cpp
Go to the documentation of this file.
1namespace krotos
2{
3 const String Kwidget_Reformer::Version = "1";
4
5 const String Kwidget_Reformer::Parameters::Start = "Start";
6 const String Kwidget_Reformer::Parameters::PuckX = "PuckX";
7 const String Kwidget_Reformer::Parameters::PuckY = "PuckY";
8 const String Kwidget_Reformer::Parameters::Nearest = "Nearest";
9 const String Kwidget_Reformer::Parameters::Size = "Size";
10 const String Kwidget_Reformer::Parameters::Rate = "Rate";
11 const String Kwidget_Reformer::Parameters::Pitch = "Pitch";
12 const String Kwidget_Reformer::Parameters::PitchMod = "PitchMod";
13 const String Kwidget_Reformer::Parameters::Width = "Width";
14 const String Kwidget_Reformer::Parameters::Pan = "Pan";
15 const String Kwidget_Reformer::Parameters::Level = "Level";
16 const String Kwidget_Reformer::Parameters::GranularLevel = "GranularLevel";
17 const String Kwidget_Reformer::Parameters::LevelMod = "LevelMod";
18 const String Kwidget_Reformer::Parameters::StartRand = "StartRand";
19 const String Kwidget_Reformer::Parameters::SizeRand = "SizeRand";
20 const String Kwidget_Reformer::Parameters::RateRand = "RateRand";
21 const String Kwidget_Reformer::Parameters::PitchRand = "PitchRand";
22 const String Kwidget_Reformer::Parameters::WidthRand = "WidthRand";
23 const String Kwidget_Reformer::Parameters::PanRand = "PanRand";
24 const String Kwidget_Reformer::Parameters::LevelRand = "LevelRand";
25 const String Kwidget_Reformer::Parameters::Popcorn = "Popcorn";
26 const String Kwidget_Reformer::Parameters::Proximity = "Proximity";
27 const String Kwidget_Reformer::Parameters::Radius = "Radius";
28 const String Kwidget_Reformer::Parameters::Quench = "Quench";
29 const String Kwidget_Reformer::Parameters::Robin = "Robin";
30 const String Kwidget_Reformer::Parameters::SALoop = "SALoop";
31 const String Kwidget_Reformer::Parameters::Normalise = "Normalise";
32 const String Kwidget_Reformer::Parameters::Autoplay = "Autoplay";
33 const String Kwidget_Reformer::Parameters::Shape = "Shape";
34 const String Kwidget_Reformer::Parameters::GrainMax = "GrainMax";
35 const String Kwidget_Reformer::Parameters::Segmentation = "Segmentation";
36 const String Kwidget_Reformer::Parameters::FeatureExtr = "FeatureExtr";
37 const String Kwidget_Reformer::Parameters::SamplePaths = "SamplePaths";
38 const String Kwidget_Reformer::Parameters::TabIndex = "TabIndex";
39 const String Kwidget_Reformer::Parameters::SlotIndex = "SlotIndex";
40 const String Kwidget_Reformer::Parameters::Mute = "Mute";
41 const String Kwidget_Reformer::Parameters::Solo = "Solo";
42 const String Kwidget_Reformer::Parameters::MIDIMode = "MIDIMode";
43 const String Kwidget_Reformer::Parameters::Tracking = "Tracking";
44 const String Kwidget_Reformer::Parameters::Coeff0 = "Coeff0";
45 const String Kwidget_Reformer::Parameters::Coeff1 = "Coeff1";
46 const String Kwidget_Reformer::Parameters::Coeff2 = "Coeff2";
47 const String Kwidget_Reformer::Parameters::Coeff3 = "Coeff3";
48 const String Kwidget_Reformer::Parameters::Coeff4 = "Coeff4";
49 const String Kwidget_Reformer::Parameters::Coeff5 = "Coeff5";
50 const String Kwidget_Reformer::Parameters::Coeff6 = "Coeff6";
51 const String Kwidget_Reformer::Parameters::Coeff7 = "Coeff7";
52 const String Kwidget_Reformer::Parameters::SelectX = "SelectX";
53 const String Kwidget_Reformer::Parameters::SelectY = "SelectY";
54 const String Kwidget_Reformer::Parameters::SelectZ = "SelectZ";
55
56 const String Kwidget_Reformer::Parameters::AAlpha = "AAlpha";
57 const String Kwidget_Reformer::Parameters::AH = "AH";
58 const String Kwidget_Reformer::Parameters::AA = "AA";
59
60 // These strings will be used to populate the oscillator mode combobox
61 const StringArray Kwidget_Reformer::ModeNames = {"Sampler", "Granular", "Vehicle"};
62
63 // Note: changing the value of MaxSegmentationMethods breaks backwards compatibility
65 const std::map<int, String> Kwidget_Reformer::SegmentationMethods = {
66 {0, "No Segmentation"},
67 //{1, "New Segmentation Method"}, // add new method in a free slot
68 {32, "Texture Mode | Complex Audio Textures [Beta]"},
69 {64, "Beats Mode | Percussive Sounds [Beta]"},
70 {96, "Texture Mode | Complex Audio Textures"},
71 {128, "Chords Mode | Delicate Nuanced Sounds [Beta]"}};
72
73 // Note: changing the value of MaxFeatureExtrMethods breaks backwards compatibility
75 const std::map<int, String> Kwidget_Reformer::FeatureExtrMethods = {
76 {0, "No Analysis"},
77 {1, "HarmonicPitchEstimation"}, // add new method in a free slot
78 {32, "MFCC/PCA [Beta]"},
79 {64, "Centroid/Level"},
80 {96, "SpectralCentroid/RMS [Beta]"},
81 {128, "SpectralFlatness/RMS [Beta]"},
82 {160, "erbCentroid/RMS [Beta]"},
83 {192, "erbCentroid/erbFlatness [Beta]"}};
84
85 // These strings will be used to populate the MIDI trigger combobox
86 const StringArray Kwidget_Reformer::MIDIModeNames = {"All Notes", "C3", "C#3", "D3", "D#3", "E3"};
87
88 Kwidget_Reformer::Kwidget_Reformer(const String& id) : Kwidget("Reformer", id)
89 {
91
92 // ** Deprecated - SamplePaths are now stored in the SamplesTree. This is retained for backwards compatibility.
94
95 // Samples Tree
97
98 // Called after a user file load action (drag and drop, file browser etc) has finished
99 // Initialises the SampleEngine with the loaded files and deals with any state that needs attached.
101
102 // Assign mute parameter to sample engine
103 m_samplesTree->sampleAdded = [this](SamplesTree::Sample& newSample) {
104 newSample.muteChanged = [this, &newSample]() {
105 m_soSound.getSampleEngine()->setSegmentMuted(newSample.getIndex(), newSample.muteValue);
106 };
107 };
108
109 param.valueChanged = [this](const var& value) {
110 auto files = StringArray::fromLines(value.toString());
111
113
114 // SamplesTree backwards compatibility
115 // Parse file paths from parameter and insert into SamplesTree
116 AudioFormatManager formatManager;
117 formatManager.registerBasicFormats();
118 for (auto file : files)
119 {
120 auto convertedFile = AssetManager::convertFilePath(file);
121
122 File directoryPath(convertedFile);
123
124 if (directoryPath.isDirectory())
125 {
126 // Recursively add files from directories
127 auto foundFiles = directoryPath.findChildFiles(
128 File::findFiles, true, formatManager.getWildcardForAllFormats() + ";*" + ".kaf");
129 for (auto f : foundFiles)
130 {
131 samplesTree->updateSample(f.getFileNameWithoutExtension(), f.getFullPathName());
132 }
133 }
134 else
135 {
136 samplesTree->updateSample(convertedFile.getFileNameWithoutExtension(), file);
137 }
138 }
139
140 // Notify that the drop has completed, this will load the samples into the SampleEngine
141 samplesTree->dropCompleted();
142 };
143
146
147 init();
148
149 addParameterCallback(Parameters::Tracking, [this](float newValue) {
154 });
155
156 addParameterCallback(Parameters::Coeff0, [this](float newValue) {
159 });
160
161 addParameterCallback(Parameters::Coeff1, [this](float newValue) {
164 });
165
166 addParameterCallback(Parameters::Coeff2, [this](float newValue) {
169 });
170
171 addParameterCallback(Parameters::Coeff3, [this](float newValue) {
174 });
175
176 addParameterCallback(Parameters::Coeff4, [this](float newValue) {
179 });
180
181 addParameterCallback(Parameters::Coeff5, [this](float newValue) {
184 });
185
186 addParameterCallback(Parameters::Coeff6, [this](float newValue) {
189 });
190
191 addParameterCallback(Parameters::Coeff7, [this](float newValue) {
194 });
195
196 addParameterCallback(Parameters::SelectX, [this](float newValue) {
199 });
200
201 addParameterCallback(Parameters::SelectY, [this](float newValue) {
204 });
205
206 addParameterCallback(Parameters::SelectZ, [this](float newValue) {
209 });
210
211 addParameterCallback(Parameters::AAlpha, [this](float newValue) {
215 });
216
217 addParameterCallback(Parameters::AH, [this](float newValue) {
221 });
222
223 addParameterCallback(Parameters::AA, [this](float newValue) {
227 });
228
229 addParameterCallback(Parameters::Segmentation, [this](float newValue) {
232 newValue *
233 static_cast<float>(
238 });
239
240 addParameterCallback(Parameters::FeatureExtr, [this](float newValue) {
243 newValue *
244 static_cast<float>(
246
247 m_soSound.getSampleEngine()->setFeatureExtrMethod(featureExtraction);
250 });
251
252 addParameterCallback(Parameters::MIDIMode, [this](float newValue) {
253 MIDIMode activeMode =
254 static_cast<MIDIMode>(newValue * static_cast<float>(static_cast<int>(MIDIMode::NUM_MODES) - 1));
256 m_activeMIDIMode = activeMode;
257 });
258
259 addParameterCallback(Parameters::Solo, [this](float newValue) {
260 float muteVal = getParameter(Parameters::Mute)->get();
261
263 {
264 soloActivate();
265 }
266 else if (muteVal <= ParameterManager::OnOffThreshold && newValue <= ParameterManager::OnOffThreshold &&
268 {
270 }
271
272 m_soloValue = newValue;
273 });
274
275 addParameterCallback(Parameters::Mute, [this](float newValue) {
276 float soloVal = getParameter("Solo")->get();
277 if (newValue == 1.0f && soloVal == 1.0f)
278 {
279 getParameter("Solo")->set(0.0f);
280 }
281 });
282
283 addParameterCallback(Parameters::Autoplay, [this](float newValue) {
284 m_listeners.call(&Listener::autoPlayChanged, this, newValue);
285 m_autoplayEnabled = bool(newValue > 0.5f);
286 });
287
288 addParameterCallback(Parameters::SALoop, [this](float newValue) {
289 m_listeners.call(&Listener::loopEnableChanged, this, newValue);
290 });
291 }
292
293 void Kwidget_Reformer::loadFiles(const StringArray& files)
294 {
296 bool tweakRequested = false;
297
298 Array<File> filesToLoad;
299
300 try
301 {
302 filesToLoad = AssetManager::loadFiles(files, true, m_readSpecificFiles); // Converts into array of full
303 // paths appropriate to platform
304 }
305 catch (EncryptedAssetException& ex)
306 {
307 // TODO: This causes multiple popups, should be elevated to state loading
309 }
310
311 if (!filesToLoad.isEmpty())
312 {
313 m_soSound.loadSounds(filesToLoad, tweakRequested);
314 }
315
316 // By the time we get here, the KrotosAudioBufferDSP contained deep with m_soSound will have lost any
317 // state which was set via parameter listener callbacks, so we call notifyAllParametersListeners() to
318 // make all of our parameters re-send their values
320
322
323 if (files.isEmpty()) // no need to analyse when there are no samples
324 {
327 }
328 }
329
331 {
332 jassert(m_samplesTree);
333
334 // Todo - Refactor sample engine to populate from tree so this isn't necessary.
335 // Having to set the data from state after load since the samples don't exist before loadSounds is called.
336 for (int i = 0; i < m_samplesTree->getParameterTree().getNumChildren(); i++)
337 {
339 i, static_cast<bool>(m_samplesTree->getChild(i)[SamplesTree::Property::Mute]));
340 }
341
342 // This is a bit of a ~hack~ 'quick fix' to get the selection ranges to be set correctly.
343 // Empty ranges passed into setSelectionRanges are replaced with a default range calculated from 0 to
344 // segmentLength. Todo - Populate the sample engine directly from the SamplesTree
346 // The following get ensures that the default selections are saved.
348 }
349
355 {
356 String thisID = getKwidgetID();
357
358 bool stateChanging = isStateChanging();
359
360 if (getChildKwidgets().size() == 0)
361 {
362 // Add an ADSR for gain
364 processor.addChildKwidget(KwidgetFactory::KwidgetType::Adsr, thisID, "Adsr", stateChanging));
365 // Connect the modulation output of ADSR1 to the gain parameter of the new
366 // Reformer kwidget
367 processor.parameterManager.addModulation(m_childKwidgets.back()->getKwidgetID(), 0, this->getKwidgetID(),
370 }
371 else
372 {
373 // there should only be 1 kwidgets in here.
374 jassert(m_childKwidgets.size() == 1);
375 for (auto k : m_childKwidgets)
376 {
377 if (k->getKwidgetType() == KwidgetFactory::KwidgetType::Adsr)
378 {
379 processor.parameterManager.addModulation(k->getKwidgetID(), 0, this->getKwidgetID(),
382 }
383 }
384 }
385 }
386
388
389 inline bool Kwidget_Reformer::isDroneVoice(int voiceIdx)
390 {
391 return (voiceIdx >= NUM_VOICES_POLY) && (voiceIdx < (NUM_VOICES_POLY + NUM_VOICES_DRONE));
392 }
393
394 bool Kwidget_Reformer::isActive(int voiceIdx)
395 {
396 bool activeChild = false;
397 for (auto& child : this->getChildKwidgets())
398 {
399 if (child->isActive(voiceIdx))
400 {
401 activeChild = true;
402 break;
403 }
404 }
405
406 // We are only considered active if a child is active, and we are active
407 return activeChild && getVoice(voiceIdx)->isActive();
408 }
409
410 void Kwidget_Reformer::noteOnInternal(int voiceIdx, int midiNote, float velocity)
411 {
412 midiNote &= MIDI_NOTE_MASK; // Mask out any flags - keep only the MIDI note number
413 Kwidget::noteOn(voiceIdx, midiNote, velocity);
414
415 for (auto& child : this->getChildKwidgets())
416 {
417 child->noteOn(voiceIdx, midiNote, velocity);
418 }
419 }
420
421 void Kwidget_Reformer::noteOn(int voiceIdx, int midiNote, float velocity)
422 {
423 if (isDroneVoice(voiceIdx)) // If this is a drone voice
424 {
425 if (midiNote & MIDI_NOTE_FLAG_FLUSH) // and it is a 'flush' event
426 {
427 noteClearedInternal(voiceIdx);
428 }
429 else if (midiNote & MIDI_NOTE_FLAG_DRONE_NOTEUP) // and it is a 'note up' event
430 {
431 if (!m_autoplayEnabled) // and autoplay has been switched off
432 {
433 noteOffInternal(voiceIdx, velocity);
434 }
435 }
436 else // else this is a drone channel 'note down' event
437 {
439 {
440 noteOnInternal(voiceIdx, midiNote, velocity);
441 }
442 }
443 }
444 else // This is a normal polyphonic note down event
445 {
446 if (!m_autoplayEnabled) // Only respond to notes if autoplay is off
447 {
448 bool noteNORFlag = static_cast<bool>(midiNote & MIDI_NOTE_FLAG_NOR);
449 bool noteNORFlagMatchesMode = noteNORFlag == m_enableNOR;
450 if ((m_activeMIDIMode == MIDIMode::All) && noteNORFlagMatchesMode)
451 {
452 noteOnInternal(voiceIdx, midiNote, velocity);
453 }
454 else
455 {
456 auto triggerNote = MIDI_NOTE_NUMBER_C3 + static_cast<int>(m_activeMIDIMode) - 1;
457
458 if (((midiNote & MIDI_NOTE_MASK) == triggerNote) && noteNORFlagMatchesMode)
459 {
460 noteOnInternal(voiceIdx, MIDI_NOTE_NUMBER_C3, velocity);
461 }
462 }
463 }
464 }
465 }
466
467 void Kwidget_Reformer::noteOffInternal(int voiceIdx, float velocity)
468 {
469 Kwidget::noteOff(voiceIdx, velocity);
470
471 for (auto& child : this->getChildKwidgets())
472 {
473 child->noteOff(voiceIdx, velocity);
474 }
475 }
476
477 void Kwidget_Reformer::noteOff(int voiceIdx, float velocity)
478 {
479 if (!isDroneVoice(voiceIdx)) // If we are a drone voice, stop note can never
480 // switch us off, only startNote with stop flag
481 {
482 noteOffInternal(voiceIdx, velocity);
483 }
484 }
485
487 {
488 Kwidget::noteCleared(voiceIdx);
489
490 for (auto& child : this->getChildKwidgets())
491 {
492 child->noteCleared(voiceIdx);
493 }
494 }
495
497 {
498 if (!isDroneVoice(voiceIdx)) // If we are a drone voice, stop note can never
499 // switch us off, only startNote with stop flag
500 {
501 noteClearedInternal(voiceIdx);
502 }
503 }
504
518 std::vector<Kwidget::ParameterInfo> Kwidget_Reformer::createParameters()
519 {
520 return {
521 // NormalisableRange( rangeStart, rangeEnd, intervalValue, skewFactor,
522 // useSymmetricSkew ) // For reference
523 // paramID, paramName, NormalisableRange<float> range,
524 // defaultValue
525 {Parameters::Start, Parameters::Start, {0.0f, 100.0f, 0.1f}, 2.8f},
526 {Parameters::PuckX, Parameters::PuckX, {0.0f, 1.0f, 0.001f}, 0.5f},
527 {Parameters::PuckY, Parameters::PuckY, {0.0f, 1.0f, 0.001f}, 0.5f},
528 {Parameters::Nearest, Parameters::Nearest, {1.f, 1000.f, 1.f, 1.0f}, 9.0f},
529 {Parameters::Size, Parameters::Size, {0.0f, 1600.0f, 0.1f}, 50.0f},
530 {Parameters::Rate, Parameters::Rate, {0.0f, 1000.0f, 0.001f, 0.3f}, 21.0f},
531 {Parameters::Pitch, Parameters::Pitch, {-48.0f, 48.0f, 0.01f, 0.5f, true}, 0.0f},
532 {Parameters::PitchMod, Parameters::PitchMod, {-48.0f, 48.0f}, 0.0f},
533 {Parameters::Width, Parameters::Width, {0.0f, 1.0f, 0.001f, 0.5f}, 1.0f},
534 {Parameters::Pan, Parameters::Pan, {-1.0f, 1.0f}, 0.0f},
538 {-96.0f, 12.0f, 1e-2f, DSPConstants::defaultSliderSkew},
539 0.0f},
540 {Parameters::LevelMod, Parameters::LevelMod, {0.0f, 1.0f}, 0.0f},
541 {Parameters::StartRand, Parameters::StartRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.11f},
542 {Parameters::SizeRand, Parameters::SizeRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.14f},
543 {Parameters::RateRand, Parameters::RateRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.4f},
544 {Parameters::PitchRand, Parameters::PitchRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.0f},
545 {Parameters::WidthRand, Parameters::WidthRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.0f},
546 {Parameters::PanRand, Parameters::PanRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.0f},
547 {Parameters::LevelRand, Parameters::LevelRand, {0.0f, 1.0f, 0.000001f, 1.0f}, 0.0f},
548 {Parameters::Popcorn, Parameters::Popcorn, {0.0f, 1.0f}, 1.0f},
549 {Parameters::Proximity, Parameters::Proximity, {0.0f, 1.0f}, 0.0f},
550 {Parameters::Radius, Parameters::Radius, {0.0f, 0.5f, 0.001f, 1.0f}, 0.1f},
551 {Parameters::Quench, Parameters::Quench, {0.0f, 1.0f}, 0.0f},
552 {Parameters::Robin, Parameters::Robin, {0.0f, 1.0f}, 0.0f},
553 {Parameters::SALoop, Parameters::SALoop, {0.0f, 1.0f}, 0.0f},
554 {Parameters::Normalise, Parameters::Normalise, {0.0f, 1.0f}, 0.0f},
555 {Parameters::Autoplay, Parameters::Autoplay, {0.0f, 1.0f}, 0.0f},
556 {Parameters::Shape, Parameters::Shape, {0.0f, 1.0f, 0.000001f, 1.0f}, 1.0f},
557 {Parameters::GrainMax, Parameters::GrainMax, {1.f, 400.f, 1.f, 1.0f}, 25.0f},
558 {Parameters::Mute, Parameters::Mute, {0.0f, 1.0f}, 0.0f},
559 {Parameters::Solo, Parameters::Solo, {0.0f, 1.0f}, 0.0f},
560 {Parameters::MIDIMode, Parameters::MIDIMode, {0.0f, 1.0f}, 0.0f},
561 {Parameters::Segmentation, Parameters::Segmentation, {0.0f, 1.0f}, 0.75f},
562 {Parameters::FeatureExtr, Parameters::FeatureExtr, {0.0f, 1.0f}, 0.333333333333333f},
563 {Parameters::Tracking, Parameters::Tracking, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
564 {Parameters::Coeff0, Parameters::Coeff0, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
565 {Parameters::Coeff1, Parameters::Coeff1, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
566 {Parameters::Coeff2, Parameters::Coeff2, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
567 {Parameters::Coeff3, Parameters::Coeff3, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
568 {Parameters::Coeff4, Parameters::Coeff4, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
569 {Parameters::Coeff5, Parameters::Coeff5, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
570 {Parameters::Coeff6, Parameters::Coeff6, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
571 {Parameters::Coeff7, Parameters::Coeff7, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
572 {Parameters::SelectX, Parameters::SelectX, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
573 {Parameters::SelectY, Parameters::SelectY, {0.0f, 1.0f, 0.001f, 1.0f}, 0.5f},
574 {Parameters::SelectZ, Parameters::SelectZ, {0.0f, 1.0f, 0.001f, 1.0f}, 1.f},
575
576 {Parameters::AAlpha, Parameters::AAlpha, {0.0f, 255.0f, 1.0f, 1.0f}, 0.f},
577 {Parameters::AH, Parameters::AH, {0.0f, 255.0f, 1.0f, 1.0f}, 0.f},
578 {Parameters::AA, Parameters::AA, {0.0f, 255.0f, 1.0f, 1.0f}, 0.f},
579 };
580 }
581
582 std::unique_ptr<KwidgetProcessor> Kwidget_Reformer::createProcessor()
583 {
584 return std::make_unique<KwidgetProcessor_Reformer>(*this, m_soSound);
585 }
586
587 std::unique_ptr<KwidgetGUI> Kwidget_Reformer::createGUI()
588 {
589 return std::make_unique<KwidgetGUI_Reformer>(*this, m_soSound);
590 }
591
592 String Kwidget_Reformer::getGuiName(int id) { return m_reformerGuiTypes.at(id).first; }
593
594 void Kwidget_Reformer::addListener(Listener* listenerToAdd) { m_listeners.add(listenerToAdd); }
595
597 {
598 jassert(m_listeners.contains(listenerToRemove));
599 m_listeners.remove(listenerToRemove);
600 }
601
603 {
604 m_listeners.call([this](Listener& l) { l.soloActivated(this); });
605 }
606
608 {
609 m_listeners.call([this](Listener& l) { l.soloDeActivated(this); });
610 }
611} // namespace krotos
static Array< File > loadFiles(const StringArray &, const bool, const bool willLoadSpecificFiles)
Definition AssetManager.cpp:475
static File convertFilePath(const String &)
Definition AssetManager.cpp:604
static void alertNonSubscriber()
Definition AssetManagerUI.cpp:17
const ValueTree & getParameterTree() const
Definition CustomParameterTree.h:55
ValueTree getChild(int index) const
Definition CustomParameterTree.cpp:54
static const float defaultSliderSkew
Definition constants.h:26
An exception for asset manager, specifc to encrypted assets.
Definition AssetManager.h:167
@ Unipolar
Definition KAttachment.h:122
float get() const
Definition KParameter.cpp:126
void set(float newValue)
Definition KParameter.cpp:128
SegmentationMethod
Definition KrotosAudioBufferDSP.h:292
void setFeatureExtrMethod(FeatureExtrMethod featureExtraction)
Definition KrotosAudioBufferDSP.h:504
AnalysisCoefficients & getAnalysisCoefficients()
Definition KrotosAudioBufferDSP.cpp:979
void triggerDisplayCacheRegeneration()
Definition KrotosAudioBufferDSP.h:424
void setTrackingCycles(float newValue)
Definition KrotosAudioBufferDSP.h:482
void analyse()
analyse Analyses the audio waveform stored in the buffer according to the selected scheme This method...
Definition KrotosAudioBufferDSP.cpp:35
void setTrackingValue(float newValue)
Definition KrotosAudioBufferDSP.h:480
void setAnalysisScheme(AnalysisScheme scheme)
Definition KrotosAudioBufferDSP.h:506
FeatureExtrMethod
Definition KrotosAudioBufferDSP.h:303
void setSegmentationMethod(SegmentationMethod segmentation)
Definition KrotosAudioBufferDSP.h:502
void canReadSpecificFiles(bool canRead)
Definition KrotosSynthesiserSound.h:46
SampleEngine * getSampleEngine() override
Definition KrotosSynthesiserSound.h:44
int loadSounds(juce::Array< File > audioSampleFiles, bool getNearest)
Definition KrotosSynthesiserSound.cpp:139
Definition Kwidget_Reformer.h:7
virtual void soloActivated(Kwidget_Reformer *engine)=0
virtual void autoPlayChanged(Kwidget_Reformer *engine, float newValue)=0
virtual void loopEnableChanged(Kwidget_Reformer *engine, float newValue)=0
virtual void soloDeActivated(Kwidget_Reformer *engine)=0
String getGuiName(int id) override
Definition Kwidget_Reformer.cpp:592
static const StringArray MIDIModeNames
Definition Kwidget_Reformer.h:84
void soloActivate()
Called When the state of our solo button is selected true [SOLO].
Definition Kwidget_Reformer.cpp:602
bool m_autoplayEnabled
Definition Kwidget_Reformer.h:156
void updateSamplesTree()
Definition Kwidget_Reformer.cpp:330
std::vector< ParameterInfo > createParameters() override
Definition Kwidget_Reformer.cpp:518
bool isDroneVoice(int voiceIdx)
Definition Kwidget_Reformer.cpp:389
void noteOffInternal(int voiceIdx, float velocity)
Definition Kwidget_Reformer.cpp:467
static const StringArray ModeNames
Definition Kwidget_Reformer.h:83
bool m_readSpecificFiles
Definition Kwidget_Reformer.h:161
KrotosSampleOscillatorSound m_soSound
Definition Kwidget_Reformer.h:157
SamplesTree * m_samplesTree
Definition Kwidget_Reformer.h:165
void noteOnInternal(int voiceIdx, int midiNote, float velocity)
Definition Kwidget_Reformer.cpp:410
Kwidget_Reformer(const String &id)
Definition Kwidget_Reformer.cpp:88
static const int MaxSegmentationMethods
Definition Kwidget_Reformer.h:86
void noteCleared(int voiceIdx) override
Definition Kwidget_Reformer.cpp:496
void noteOff(int voiceIdx, float velocity) override
Definition Kwidget_Reformer.cpp:477
ListenerList< Listener > m_listeners
Definition Kwidget_Reformer.h:159
std::unique_ptr< KwidgetProcessor > createProcessor() override
Definition Kwidget_Reformer.cpp:582
bool m_enableNOR
Definition Kwidget_Reformer.h:154
static const std::map< int, String > SegmentationMethods
Definition Kwidget_Reformer.h:87
std::unique_ptr< CatIDSearch > m_categorySearch
Definition Kwidget_Reformer.h:121
static const String Version
Definition Kwidget_Reformer.h:19
MIDIMode m_activeMIDIMode
Definition Kwidget_Reformer.h:155
const std::vector< std::pair< String, GuiTypes > > m_reformerGuiTypes
Definition Kwidget_Reformer.h:127
void createNestedKwidgets(KwidgetAudioProcessor &) override
Definition Kwidget_Reformer.cpp:354
float m_soloValue
Definition Kwidget_Reformer.h:163
bool isUCSEnabled()
Returns true if the UCS-based search has initialised successfully and is ready for use.
Definition Kwidget_Reformer.cpp:387
void loadFiles(const StringArray &files)
Definition Kwidget_Reformer.cpp:293
bool isActive(int voiceIdx) override
Definition Kwidget_Reformer.cpp:394
static const int MaxFeatureExtrMethods
Definition Kwidget_Reformer.h:88
void removeListener(Listener *listenerToRemove)
Definition Kwidget_Reformer.cpp:596
void noteClearedInternal(int voiceIdx)
Definition Kwidget_Reformer.cpp:486
void soloDeActivate()
Called When the state of our solo button is selected false [SOLO].
Definition Kwidget_Reformer.cpp:607
void addListener(Listener *listenerToAdd)
Definition Kwidget_Reformer.cpp:594
static const std::map< int, String > FeatureExtrMethods
Definition Kwidget_Reformer.h:89
void noteOn(int voiceIdx, int midiNote, float velocity) override
Definition Kwidget_Reformer.cpp:421
std::unique_ptr< KwidgetGUI > createGUI() override
Definition Kwidget_Reformer.cpp:587
Definition KwidgetAudioProcessor.h:12
Kwidget * addChildKwidget(const String &kwidgetType, const String &parentID="", const String &childID="", int typeInstanceLimit=0)
Definition KwidgetAudioProcessor.cpp:600
ParameterManager parameterManager
Definition KwidgetAudioProcessor.h:217
Definition Kwidget.h:8
void init()
Definition Kwidget.cpp:27
std::vector< Kwidget * > & getChildKwidgets()
Definition Kwidget.h:219
void addChildKwidget(Kwidget *child)
Definition Kwidget.cpp:325
KwidgetProcessor * getVoice(int idx) const
Definition Kwidget.cpp:38
virtual void noteOn(int voiceIdx, int midiNote, float velocity)
Definition Kwidget.cpp:67
virtual void noteCleared(int voiceIdx)
Definition Kwidget.cpp:78
std::vector< Kwidget * > m_childKwidgets
Definition Kwidget.h:319
KParameter * getParameter(const String &parameterID) const noexcept
Get a raw pointer to a KParameter belonging to this Kwidget's KwidgetProcessor. Useful for low overhe...
Definition Kwidget.cpp:168
CustomParameter * createAndAddCustomParameter(const String &paramID, const var &value)
Definition Kwidget.cpp:419
const String & getKwidgetID() const
Definition Kwidget.cpp:367
CustomParameter * getCustomParameter(const String &parameterID)
Definition Kwidget.cpp:188
bool isStateChanging()
Definition Kwidget.h:230
virtual void noteOff(int voiceIdx, float velocity)
Definition Kwidget.cpp:76
void notifyAllParametersListeners()
Call every parameter's value changed listeners with their current values.
Definition Kwidget.cpp:233
void addParameterCallback(const String &paramID, std::function< void(float)> callback)
Definition Kwidget.cpp:458
virtual bool isActive()
Definition KwidgetProcessor.cpp:24
ValueTree addModulation(const String &sourceID, int modulatorIdx, const String &destinationID, const String &paramID, float depth=DefaultModDepth, KAttachment::Polarity=KAttachment::Polarity::Bipolar)
Definition ParameterManager.cpp:159
static const float OnOffThreshold
The threshold at which a toggle, or "on/off" parameter should change from on to off stage.
Definition ParameterManager.h:45
void setSegmentMuted(int segmentIndex, bool isMuted)
'Mutes' an audio segment in the sampler. In effect, this just means the sample is skipped in the roun...
Definition SampleEngine.cpp:372
void setSelectionRanges(const std::vector< Range< int > > &selectionRanges)
Sets the selection ranges of the audio segments.
Definition SampleEngine.cpp:106
std::vector< Range< int > > getSelectionRanges()
Returns an array of segment selection ranges.
Definition SampleEngine.cpp:96
void triggerDisplayUpdate()
send a trigger signal for the grain display to redraw
Definition SampleEngine.h:117
void setGranularOscillatorMIDIMode(MIDIMode newMode)
Definition SampleEngine.h:141
A wrapper around an individual sample in the tree, with parameters for mute, solo,...
Definition SampleDataTree.h:38
std::function< void()> dropCompleted
Assign this to do something once a "drop" action has been completed. This is called internally by the...
Definition SampleDataTree.h:175
std::function< void(Sample &newSample)> sampleAdded
Assign this to do something when a sample has been added to the tree.
Definition SampleDataTree.h:151
void setSampleSelections(const std::vector< Range< int > > &selections)
Set the selection ranges for all samples in the tree. The index of the selection range in the vector ...
Definition SampleDataTree.cpp:157
std::vector< Range< int > > getSampleSelections() const
Get the selection ranges for all samples in the tree. The index of the selection range in the vector ...
Definition SampleDataTree.cpp:145
const StringArray getFiles() const
Compatibility method for KrotosSampleOscillatorSound which requires samples to be loaded all at once ...
Definition SampleDataTree.cpp:122
Definition AirAbsorptionFilter.cpp:2
static const int MIDI_NOTE_MASK
Definition OscillatorUtils.h:21
static const int NUM_VOICES_POLY
Definition OscillatorUtils.h:32
static const int NUM_VOICES_DRONE
Definition OscillatorUtils.h:33
static const int MIDI_NOTE_FLAG_FLUSH
Definition OscillatorUtils.h:24
static const int MIDI_NOTE_FLAG_NOR
Definition OscillatorUtils.h:25
static const int MIDI_NOTE_FLAG_DRONE_NOTEUP
Definition OscillatorUtils.h:23
static const int MIDI_NOTE_NUMBER_C3
Definition OscillatorUtils.h:26
MIDIMode
Definition SampleEngine.h:54
float coeff6
Definition KrotosAudioBufferDSP.h:49
float coeff0
Definition KrotosAudioBufferDSP.h:43
float dispAH
Definition KrotosAudioBufferDSP.h:56
float coeff5
Definition KrotosAudioBufferDSP.h:48
float tracking
Definition KrotosAudioBufferDSP.h:51
float selectZ
Definition KrotosAudioBufferDSP.h:54
float coeff1
Definition KrotosAudioBufferDSP.h:44
float coeff7
Definition KrotosAudioBufferDSP.h:50
float selectX
Definition KrotosAudioBufferDSP.h:52
float dispAAlpha
Definition KrotosAudioBufferDSP.h:55
float dispAA
Definition KrotosAudioBufferDSP.h:57
float selectY
Definition KrotosAudioBufferDSP.h:53
float coeff3
Definition KrotosAudioBufferDSP.h:46
float coeff2
Definition KrotosAudioBufferDSP.h:45
float coeff4
Definition KrotosAudioBufferDSP.h:47
static const String MIDIMode
Definition Kwidget_CoreEngine.h:71
static const String TabIndex
Definition Kwidget_CoreEngine.h:67
static const String PitchRand
Definition Kwidget_CoreEngine.h:36
static const String Width
Definition Kwidget_CoreEngine.h:26
static const String SizeRand
Definition Kwidget_CoreEngine.h:34
static const String Solo
Definition Kwidget_CoreEngine.h:70
static const String SamplePaths
Definition Kwidget_CoreEngine.h:66
static const String Pan
Definition Kwidget_CoreEngine.h:27
static const String Robin
Definition Kwidget_CoreEngine.h:42
static const String Start
Definition Kwidget_CoreEngine.h:21
static const String Mute
Definition Kwidget_CoreEngine.h:69
static const String LevelMod
Definition Kwidget_CoreEngine.h:32
static const String GrainMax
Definition Kwidget_CoreEngine.h:52
static const String Pitch
Definition Kwidget_CoreEngine.h:24
static const String PanRand
Definition Kwidget_CoreEngine.h:38
static const String Level
Definition Kwidget_CoreEngine.h:28
static const String Size
Definition Kwidget_CoreEngine.h:22
static const String Rate
Definition Kwidget_CoreEngine.h:23
static const String LevelRand
Definition Kwidget_CoreEngine.h:39
static const String WidthRand
Definition Kwidget_CoreEngine.h:37
static const String Tracking
Definition Kwidget_CoreEngine.h:53
static const String Normalise
Definition Kwidget_CoreEngine.h:47
static const String Autoplay
Definition Kwidget_CoreEngine.h:50
static const String StartRand
Definition Kwidget_CoreEngine.h:33
static const String SALoop
Definition Kwidget_CoreEngine.h:43
static const String RateRand
Definition Kwidget_CoreEngine.h:35
static const String PitchMod
Definition Kwidget_CoreEngine.h:25
static const String GranularLevel
Definition Kwidget_CoreEngine.h:30
static const String Shape
Definition Kwidget_CoreEngine.h:51
static const String SlotIndex
Definition Kwidget_CoreEngine.h:68
static const String Quench
Definition Kwidget_CoreEngine.h:40
static const String Adsr
Definition KwidgetFactory.h:19
static const Identifier Mute
Definition SampleDataTree.h:22
static const Identifier Samples
Definition SampleDataTree.h:13