In case some samplers are set to One Shot and the samples are really short, do I need to use Synth.noteOffByEventID() if I do not need to stop the sample playback? Is there any performance penalty for hanging NoteOns?
Posts
-
Do we need to manually NoteOff every artificial note on?
-
RE: Modular samplemap xml
@d-healey Well let's look at guitar libraries again. Each string has a SampleMap consisting different articulations, and each articulation has lots of velocity layers and perhaps many RRs, that's many thousand lines of <sample />. If we can split each articulation of each string to a separated XML, each file might only contain tens or at most hundreds, not only easier to read, but also easier to manipulate with select all function in text editors.
-
Modular samplemap xml
Can we add the function to import other xml files in our samplemap xml? Either with XInclude or XML eternal entities.
The ability to split xml content into different modules would be very helpful when maintaining large and complex samplemaps.
For reference:
-
RE: Again no sound after compilation :)
@d-healey How do you have different script communicate with each other without global variables?
-
RE: Again no sound after compilation :)
I found the error.
It's caused by the order of module importation with include.
My guess is that because I'm using many global objects (with arrays), when compiling namespaces, HiSE replaces the variable with the pointer of those global objects during the copying and paste during the "include" process. So if the global object was not created before including a namespace that uses it, the pointer will return undefined objects.
The problem is that, when recompiling scripts in HiSE, the "include" process does return the correct pointer to the arrays or whatever.
Is that some kind of memory leak with variables?
-
RE: Again no sound after compilation :)
@lindon The project might be a little too messy to look at, although I do have it on github https://github.com/RCJacH/hummingbird-in-hise.
I just found out why it's not making any sound.
When I first load the preset in HiSE, key triggers do not play any sound, but they do after I recompile all scripts. And since I normally do not reload HiSE preset while writing scripts, I did not notice this bug at all.Now the problem is to find out why scripts don't work initially, only after recompilation.
-
RE: Again no sound after compilation :)
Okay I created a mini project with a sampler under Master Chain using a single sample (then later on with a samplemap from the real project), with no script, and the samples are playing in the vsti. So I can conclude it's not a problem with sample location or sample format.
Could be the scripts.
How can I debug them in the DAW though? They work fine using HiSE standalone.
-
RE: Again no sound after compilation :)
@d-healey I do see the UI keyboard animate when playing on MIDI keyboard
-
Again no sound after compilation :)
I'm trying to make a MVP for my sample library, and I have read through the forum on related topic but still couldn't figure out how to fix the issue.
So basically sample playback is fine when debugging in the HiSE standalone (triggered with MIDI keyboard), I even added a keyboard in the gui (with no other component) and made sure that it plays audio in HiSE standalone, however the compiled plugin, standalone or vsti, plays no sound.
I suspect it might be a problem with sample location or sample format.
I have all my samples in WAV files residing in the Samples folder in my project folder, and all links in the SampleMaps are relative ones using the {PROJECT_FOLDER} wildcard. And the path in the LinkWindows file points to the Samples folder of the project.
What am I missing?
-
RE: Scriptnode is fun!
@christoph-hart I updated to the latest commit in develop branch and compilation is successful again.
-
RE: Scriptnode is fun!
@d-healey I removed all but the develop branch before building HiSE.
-
RE: Scriptnode is fun!
I just compiled the newest version of HiSE from the develop branch. However I'm not able to compile to vsti. So I tried creating a new preset and added a sampler with empty samplemap to the master chain and hit export as instrument plugin. After a while, it says
g:\coding\hise\hi_scripting\scripting\hardcoded_modules\arpeggiator.h(47): fatal error C1003: error count exceeds 10
0; stopping compilation (compiling source file ....\JuceLibraryCode\include_hi_scripting_04.cpp)and fails compilation.
-
RE: How should I implement a common method in multiple namespaces
@d-healey okay thanks for the reminder.
I refactored the script like you said and used a switch condition :face_with_tears_of_joy: -
How should I implement a common method in multiple namespaces
Let's say I have A B C three articulations, and each with a namespace implementing a RR count (using namespace because it's local to a script).
I want to use the getNextRR() method in the corresponding namespace based on Message.getChannel(), because each is implemented differently. How should I approach this?
The problem is that we can't add namespaces themselves to a list, only methods from namespaces.
I can think of three ways to make this work, but each with drawbacks.
-
The simplest way is to use a switch condition, it works fine but lots of code for each method, plus switch in Javascript is not performance friendly.
-
Keep only the RR count in namespace, and implement another set of objects with corresponding methods calling Namespace.RR. Methods from objects work, but this method is convoluted and I'm not sure how it performs.
-
Implement an object within each namespace itself, then use an const var array for calling based on index, mainly because array[index] is faster than switch in Javascript.
So for each namespace we add a reg methods = {"method1": method1, "method2": method2...}, then in the main script const var articulations = [A.methods, B.methods...], and you call by using articulations[index]"method1".
However this doesn't work all the time lol. It compiles, but calling methods this way doesn't trigger Console.print() in them, and returns the wrong value when the method tries to retrieve values from a global array.
So what should I do about this?
-
-
RE: HiSE not responding when loading 5g+ of samples
@d-healey Hmm, is the modulation using velocity -> gain?
-
RE: HiSE not responding when loading 5g+ of samples
@d-healey you mentioned about it a month ago, I was wondering if you separate rr and up/down by velocity, and dynamic by rr group, then don't you have to manually change the gain, velocity, and the rr group of each midi note?
-
RE: HiSE not responding when loading 5g+ of samples
@crd I'm using a separated sampler for each articulation of each string, for round robins. Is there a better way to handle that?
I'll try installing VS to compile the newest version of HiSE, though I'm constantly running out of hard drive space...
-
HiSE not responding when loading 5g+ of samples
I'm working on a guitar library that has more than 10k samples (5GB on a HDD), with around 100 samplers. Whenever I open the project, HiSE becomes not responding. However it's only using 10% of the CPU and not even using a gig of memory (out of 64GB).
I made a debug version of the project by removing half of modules, and it opens fine.
So what would be the problem here? I'm using the newest 2.0 release version released 3 years ago.
-
Q: Performance friendly way for triggering note to specific child synth
Here's my problem:
I'm writing a guitar library, and the hierarchy of my project goes something like this:
Root
..Each String:
....Articulations
......Downstroke
......UpstrokeOn NoteOn, I need to trigger multiple (but not all) articulations at once, each delayed by a different amount, but whether each articulation is triggered as downstroke or upstroke depends on a global variable.
How should I approach this?
I thought about and experimented with two approaches.
- Modular approach.
Using a script in EVERY sampler, which loads many global namespaces to determine the current articulation and whether or not to ignore the midi event. This approaches creates a complex web of tiny scripts, a bit less manageable, and I don't know how performant it would be if every sampler needs to have a MIDI script handling every note on with many conditional branches. - Grouped approach.
I tried writing a bigger script at level of each string. Upon receiving a NoteOn message, it creates a NoteOn message for each involved articulation, differentiated by midi channels, and handles the attributes of samplers (such as down/up strokes and round robin) directly as parent synth. This way, I don't need to add a script for each sampler so it MIGHT be more performant?
The problem is that I can't find a way to send a MIDI event to a specific child synth. There's only Synth.playNote() and Synth.addNoteOn(), and both can't be delayed.
Although as I am writing this I just came up with the idea of using a local variable to record the eventid generated by addNoteOn(), then check for equivalent event in onNoteOn() and set timestamp and channel in a if branch.
However it would be nice to know which approach would be more performance friendly. Is A, numerous NoteOn callbacks from multiple MIDI processors to check whether an event should be ignored, better than B, generating many specific NoteOns and setting attributes of multiple child processors from one parent MIDI processor?
PS. another question, is hardcoded script better than hand written script for filtering events in terms of performance?
- Modular approach.
-
RE: Q: Get module name with script
Thx, oh so Id is the name string :face_with_tears_of_joy: