Convolution Samples Dropdown?
-
Hey there i was wondering if it is possible to store the sample path in presets to recall them with a dropdown menu.
I want to give the user 5 reverbs to choose from. Any snippets that show how or if it works?thx in advance :)
-
@Straticah The combo box value will be stored with the preset and in the combo box callback you can load the ir
-
@d-healey sounds good, is this how it is done? Or is there a more beginner friendly way since this is from 2018
https://forum.hise.audio/topic/598/loading-ir-sample-folders?_=1669662047778 -
@Straticah Get an array of the audio files, I think it's
Engine.getAudioFileList()
(check the API) and use the array to populate the drop down. Use the value (-1) of the drop down as the index to the array to load the file into the effect. I think the function isloadFile()
-
@d-healey rly have no idea but i will read step by step and maybe get somewhere, thanks a lot :)
-
Step 1: Get array of IRs using
that Engine function I mentioned.file system API or Engine.loadAudioFilesIntoPool().Step 2: Populate drop down from the array (I think I've shown this in a few videos, basically you're using a loop)
Step 3: In the combo box callback, load the IR into the effect. You get the IR from the array you got in step 2 and use the value of the combo box as the index (subtract 1 because combo box values start from 1 and arrays start from 0)
-
I created a convolution reverb based from impulse of my lexicon pmc60
See picture.
https://imgur.com/4HfScBzI Swap my IR with sliders with four positions.
Like David healey said I begin with this :
const var : convolution FX
const var : combobox// Pool audio files const audioFiles = Engine.loadAudioFilesIntoPool(); Engine.loadAudioFilesIntoPool(); // Reverb effects const reverbs = []; for (i = 0; i < 2; i++) reverbs.push(Synth.getAudioSampleProcessor("Convolution Reverb" + i)); // cmbImpulse const cmbImpulse = []; for (i = 0; i < 2; i++) { cmbImpulse.push(Content.getComponent("cmbImpulse" + i)); cmbImpulse[i].setControlCallback(oncmbImpulseControl); } inline function oncmbImpulseControl(component, value) { local index = cmbImpulse.indexOf(component); reverbs[index].setFile("{PROJECT_FOLDER}" + component.getItemText() + ".aif"); }
After
const var : knobs
const var : Filename of IR in audio folder
Callback function for each knobs// Panel 4 : size & time parameters for plate const var Knob2 = Content.getComponent("Knob2"); const var Knob9 = Content.getComponent("Knob9"); const var Knob10 = Content.getComponent("Knob10"); const var Knob11 = Content.getComponent("Knob11"); const var reverbmap = ["plate_size1_time1 L", "plate_size1_time2 L", "plate_size1_time3 L", "plate_size1_time4 L","plate_size2_time1 L", "plate_size2_time2 L", "plate_size2_time3 L", "plate_size2_time4 L","plate_size3_time1 L", "plate_size3_time2 L", "plate_size3_time3 L", "plate_size3_time4 L","plate_size4_time1 L", "plate_size4_time2 L", "plate_size4_time3 L", "plate_size4_time4 L"]; Knob2.setControlCallback(Knob2CB); inline function Knob2CB(control, value) { if (value == 0) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(1); cmbImpulse0.changed(); } else if (value == 1) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(2); cmbImpulse0.changed(); } else if (value == 2) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(3); cmbImpulse0.changed(); } else if (value == 3) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(4); cmbImpulse0.changed(); } }; Knob9.setControlCallback(Knob9CB); inline function Knob9CB(control, value) { if (value == 0) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(5); cmbImpulse0.changed(); } else if (value == 1) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(6); cmbImpulse0.changed(); } else if (value == 2) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(7); cmbImpulse0.changed(); } else if (value == 3) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(8); cmbImpulse0.changed(); } }; Knob10.setControlCallback(Knob10CB); inline function Knob10CB(control, value) { if (value == 0) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(9); cmbImpulse0.changed(); } else if (value == 1) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(10); cmbImpulse0.changed(); } else if (value == 2) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(11); cmbImpulse0.changed(); } else if (value == 3) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(12); cmbImpulse0.changed(); } }; Knob11.setControlCallback(Knob11CB); inline function Knob11CB(control, value) { if (value == 0) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(13); cmbImpulse0.changed(); } else if (value == 1) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(14); cmbImpulse0.changed(); } else if (value == 2) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(15); cmbImpulse0.changed(); } else if (value == 3) { cmbImpulse0.set("items", reverbmap.join("\n")); cmbImpulse0.setValue(16); cmbImpulse0.changed(); } };
Mathieu
-
@Sounddiy That's some fun code you have there :)
-
@d-healey I know
It is a mix of your's, others and peharps mine :)