@Lindon I always forget to do this. Thanks. I'll be back in the studio later.
Posts made by trillbilly
-
RE: Samplemap 1 not loading - other load fine
-
RE: Samplemap 1 not loading - other load fine
@d-healey Hi David, thanks for your reply.
My original code did not have these IF statements but as I mentioned, it prevented me from saving presets with custom samples. Like this, custom samples work within saving presets.
Is there another way to call an IF statement to keep the correct functionality?
-
Samplemap 1 not loading - other load fine
Hey Gang,
Im using a variation of the CustomSampleImport template. Im having a strange problem with my Samplers loading a particular sample map.
I have this code:
const var Sampler1 = Synth.getSampler("Sampler1"); //Sampler const var list = Sampler.getSampleMapList(); //Samplemap List const var SampleViewer1 = Content.getComponent("SampleViewer1");//Viewport const var SampleName1 = Content.getComponent("SampleName1");//Label SampleViewer1.set("useList", true); SampleViewer1.set("items", list.join("\n")); inline function onSampleViewer1Control(component, value) { if (value) { Sampler1.loadSampleMap(list[value]); SampleName1.setValue(list[value]); } }; Content.getComponent("SampleViewer1").setControlCallback(onSampleViewer1Control);
This works great except it will not load the first samplemap listed in my viewport. All others load fine including custom samples.
If I remove the "IF" statement above, the samplemaps, including the finicky first one, all load fine BUT now custom samples will not save to presets.
Where am I going wrong with this? Any help or direction would be appreciated.
All the best.
-
RE: Get Sample Filename from Sampler using custom Sample Maps.
@Lindon Hi Lindon. I used this now and its working as expected.
inline function onSampleViewer1Control(component, value) { if (value > 0) { local id = Sampler1.getSampleMapList()[value - 1]; Sampler1.loadSampleMap(list[value]); SampleName1.setValue(list[value]); Sampler1.loadSampleMap(id); } }; Content.getComponent("SampleViewer1").setControlCallback(onSampleViewer1Control);
If I take out the part you said was incorrect, then it stops working again.
Is there a different way I should go about this now?
-
RE: Get Sample Filename from Sampler using custom Sample Maps.
@Lindon Hi Lindon, thanks for the help! You're right, I should be doing this long before I come to the forum. I will for items like this going forward.
As for the issue, the Dynamic Sample loading seems to be working perfect, it just calling the samplemap name from the viewport that isnt correct,
When I use the console.print command, it does print a value that I know but it always just prints the first Samplemap name, no matter which I have selected in the viewport. Its just catching me off guard because we had it working previously with this exact code structure. I quadruple checked to insure I didnt change anything, and it all looks correct.
I'll keep looking over it again and try a few different things to see what the results are.
Again, I appreciate the help and time!
Best.
-
RE: Get Sample Filename from Sampler using custom Sample Maps.
@d-healey Hi David, I had to rebuild my plugin and now am having issues with this again. Could you take a look at this?
I have this in my onInit:
const var Sampler1 = Synth.getSampler("Sampler1"); const var list = Sampler.getSampleMapList(); const var SampleViewer1 = Content.getComponent("SampleViewer1");//viewport const var SampleName1 = Content.getComponent("SampleName1");//label SampleViewer1.set("useList", true); SampleViewer1.set("items", list.join("\n")); inline function onSampleViewer1Control(component, value) { Sampler1.loadSampleMap(list[value]); SampleName1.setValue(list[value]); }; Content.getComponent("SampleViewer1").setControlCallback(onSampleViewer1Control);
This is loading Samplemaps via the Viewport. It is supposed to update the label with the name of the Samplemap as well but fails to do so upon clicking the Samplemap in the Viewport.
I have this in the SampleLoadSave.js:
const var samplepanel = Content.addPanel("SamplePanel", 0, 0); samplepanel.setLoadingCallback(function(isPreloading) { if (!isPreloading && isCustomMap) { var s = Sampler1.createSelection(".*")[0]; SampleName1.set("text", s.get(Sampler1.FileName)); } });
This is the code you kindly provided me above. It sets the name of the label to the Custom Sample Filename/Path.
Everything works as it should except the Label not updating upon clicking the Samplemap in the Viewport.
Can you spot an issue?
All the best!
-
RE: Undo/Redo with Randomization?
@clevername27 no biggie, thanks for getting me going. I do think this is it, just not sure how to get there. I'll keep chugging away.
-
RE: Undo/Redo with Randomization?
@clevername27 So I've tried this in the Callback of the Randomize Button. I've also tried placing it in the Callback of the Undo Button.
Engine.performUndoAction({ "obj": Stepsknb1, // the object that will be modified "newValue": [Math.randInt(0, 16)], // the new state "oldValue": Stepsknb1.clone() // the old state (we need to clone it or it will not keep the old values) }, function(isUndo) { this.obj.clear(); // pick the values from the old or new state for(v in isUndo ? this.oldValue : this.newValue) this.obj.push(v); }); // new state Console.print(trace(myList)); Engine.undo(); // old state Console.print(trace(myList)); Engine.redo(); // new state Console.print(trace(myList));
It recalls the number of times the Randomize Button was pressed, but does not recall the correct settings for the Steps knob. Instead, it just randomizes the number again.
Do you know where I'm going wrong?
-
RE: Undo/Redo with Randomization?
@clevername27 I was attempting to see if
performUndoAction
was it but I couldn't figure it out from the article in the documentation. I'll also check outsetValueWithUndo
, thanks for pointing that out.I'll just be in trial and error mode until I get somewhere. God help me...
Best and thanks again.
-
RE: SOLVED: Arp skipping steps?
Solved.
I didnt realize having the "note length" of the arp set to the highest setting would cause this but sure enough that was it. If anyone else comes across this, insure your Note Length is below maximum value.
-
Undo/Redo with Randomization?
Hey Gang,
I've got a randomization button for sequencers (6) and sample selection (6).
It seems the plugin does not recognize that the Steps, Velocity, Stride and Time have been changed if I used the random button as it does not recall anything when undo it pressed. However, if I also set the UndoManager to ENABLE on the Random Button, then when I click undo, it randomizes the sequencer again rather than recall the parameters. Changing the Steps, Velocity, etc manually on the UI works as it should with undo/redo.
Using the random button with the Sample Selection poses the same issue. It does not recognize that the sample has been changed unless I have the Random Sample button UndoManager enabled. Again, when you click undo, instead of showing you the previous step it randomizes the sample again. This is loading Sample Maps via a view port into the sampler.
I have the correct "metaparameter" settings.
Where am I going wrong with the undo/redo action?
-
SOLVED: Arp skipping steps?
Hey Gang,
Im using a variation of the CustomSampleImport template for a drum sequencer. I have 6 samplers, each with an arp. All arps act strange in the same function.
Firstly, the arp is skipping steps. See the settings below. The arp should be playing each step, but only plays step one on each. It skips the other steps in the sequence. The velocity is up, the settings seem correct, Im a bit stumped. Has anyone had this issue?
Secondly, what is the best way to describe what the "Stride" setting?
Thanks for any and all help.
-
RE: User Specified Sample Folder per Sampler?
@Lindon said in User Specified Sample Folder per Sampler?:
FileSystem.browseForDirectory(var startFolder, var callback)
Yes, thank you. I have added this to the SampleLoadSave.js of the CustomSampleImport project. On Right Click, it opens the directory browser twice. I can select a folder but it does not load the samples in the folder or randomize the folder.
SampleDropper.setMouseCallback(function(event) { // Clear the sample on double click if(event.doubleClick) { Sampler1.clearSampleMap(); return; } this.data.hover = event.hover; // Show a directory browser on right click if(event.rightClick) { FileSystem.browseForDirectory(FileSystem.Samples, loadSample); return; this.repaint(); } });
Here is how I am randomizing some components in case I need something here. I know there is a way to reduce the script, I just don't know it.
const sampleMapsRAN = Sampler.getSampleMapList(); inline function onShuffleSamplebtn1Control(component, value) { if (value) { local index = Math.randInt(0, sampleMapsRAN.length); local sampleMap = sampleMapsRAN[index]; Sampler1.loadSampleMap(sampleMap); SampleViewer1.setValue(index); SampleName1.setValue(list[index]); } }; Content.getComponent("ShuffleSamplebtn1").setControlCallback(onShuffleSamplebtn1Control);
Thanks again.
-
RE: User Specified Sample Folder per Sampler?
@d-healey Hi David, I've seen this and used parts of it. I see within the SampleLoadSave.js how to import the custom samples.
I'm confused though how I allow a user to choose their own sample folder to be randomized.
I will be back at the studio tomorrow and can dig a bit deeper into into it.
Thanks and best!
-
User Specified Sample Folder per Sampler?
Hey Gang,
I've got a drum plugin that has 6 samplers with the ability to randomize samplemaps individually as well as globally. I have a customer request to allow users to select a custom folder/sampler, which has their own samples in it, and randomize through the samples of the selected folder instead of the samplemaps.
The plugin would have to default back to the samplemaps folder if none is selected or the custom folder is not found for whatever reason.
Is this possible? If so, does anybody have an idea where to start? Or even better, a snippet?
Best!
-
RE: onNoteOn: Engage multiple MIDI events
@d-healey said in onNoteOn: Engage multiple MIDI events:
HiseSnippet 1232.3oc6YstaaaCElxNLX1YMXsnXX+TnX+vAHHvNqWFPPPct3TXz5DuH2r8u.FoisIrDolDsa7F1qwdcVA1KvdT5av1gRxQxIZINdcqoc1+PP7bg7biemifaGHsgvPY.wnTmw9.w3yoViEp960mwEjl6SLVk1hEpf.yXR6N1mEFBNDCihuPSvnzRjneu646xbYBaHkDgbhjaCuh6wUoTaW+kbW2CXNPGtWFoeb8l1RwdRW4PzdJRqR7Y1CX8fCYZwJPIFK2vgqjAVJlBBQY1U5L1pu7MhX4OgGxOyEzKpQrvMJlLYu9bWm1S70PBtQsS87hwd9Cos3N7KnmFA9hHFloZjMFXT35Lo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ly6nsatXz17Fsk9Obz1iFAAi3vaR+nzpeJOtasEi6tXb26Fi619C+3tKOOi6dii+sXVzOBlEcyEyhtXVz+2OK5+EmgGyNPdpcLTutN8yhnf9sH5eTpDskdsYsK2ffnQ93mZaO8VcEE2bdU7alWEe77p3SlWEe57p3ylWE+1aVQ8Xt6LTI8huZRHsZ2HpirgQCACqxitQP9KPdFlyA
Ahhh, ok I see now. Thank you and best!
-
RE: onNoteOn: Engage multiple MIDI events
@d-healey Hi David. Thanks but I couldn't get that to work.
I forgot to note that all of the individual drum sounds are in their own sampler. So I have 6 samplers total that I'm trying to engage with MIDI #71.
Here is the original from an old chord gen project:
inline function onCHORD1Control(component, value) { if (value) { Synth.playNote(60, 64); Synth.playNote(64, 64); Synth.playNote(67, 64); Synth.playNote(48, 64); Synth.playNote(36, 64); } else Engine.allNotesOff(); }; Content.getComponent("CHORD1").setControlCallback(onCHORD1Control);
Here is what I used in my onNoteOn:
if (Message.getNoteNumber() = 71) { Synth.playNote(60, 64); Synth.playNote(62, 64); Synth.playNote(64, 64); Synth.playNote(65, 64); Synth.playNote(67, 64); Synth.playNote(69, 64); } else Engine.allNotesOff();
I have a feeling this is way off.
-
onNoteOn: Engage multiple MIDI events
Hey Gang,
How can I engage multiple MIDI Events with a single MIDI note?
Im trying to create a one-touch drum generator. I have samples loaded on C,D,E,F,G & A. When I press B, I would like it to engage the previous keys as well.
I see how I can do it with a button on the GUI, but how can I do it via onNoteOn so its engaged via MIDI?
-
RE: CustomSampleImport - Loop Panel Visibility
@d-healey Ahhhh, its all about placement. Thank you. It seems that did the trick!
-
RE: CustomSampleImport - Loop Panel Visibility
@d-healey Yes I found this earlier and couldnt find anything except the Loop Button enabling the Sampler Loop Function. I tried removing that from the code but no luck. Do you see something maybe I missed?
I'll also check in the LoopPointDragger.js. This is from the SampleLoadSave.js
inline function initAfterSampleLoad() { local id = Sampler1.getCurrentSampleMapId(); isCustomMap = id == "CustomJSON"; if(isCustomMap || id.length == 0) SampleMapLoader.setValue(0); // fetch the first sound sound = Sampler1.createSelection(".*")[0]; totalSamples = 0; // if the sample map is empty, clear everything and abort. if(!isDefined(sound)) { LoopPointDragger.updateLoopPoints(); storeSampleMapData(); return; } // We need this number for the loop point dragger. totalSamples = sound.getRange(Sampler1.SampleEnd)[1]; local xf = sound.get(Sampler1.LoopXFade); local xfr = sound.getRange(Sampler1.LoopXFade)[1]; // setup the non persistent UI controls local fadeValue = xfr > 0 ? xf / xfr : 0; Content.getComponent("XFade").setValue(fadeValue); Content.getComponent("Loop").setValue(sound.get(Sampler1.LoopEnabled)); LoopPointDragger.updateLoopPoints(); storeSampleMapData(); }
EDIT: I see nothing in the LoopPointDragger.js that seems to have that function called except
SampleLoadSave.initAfterSampleLoad();
which doesnt solve the problem if removed.