HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. Orvillain
    • Profile
    • Following 1
    • Followers 0
    • Topics 61
    • Posts 475
    • Groups 0

    Orvillain

    @Orvillain

    88
    Reputation
    62
    Profile views
    475
    Posts
    0
    Followers
    1
    Following
    Joined
    Last Online

    Orvillain Unfollow Follow

    Best posts made by Orvillain

    • RE: Need filmstrip animations

      @d-healey I really like that UI. Very simple, accessible, and smooth looking - for lack of a better word!

      posted in General Questions
      OrvillainO
      Orvillain
    • RE: Can We PLEASE Just Get This Feature DONE

      Free mankini with every commercial license???

      posted in Feature Requests
      OrvillainO
      Orvillain
    • RE: Orv's ScriptNode+SNEX Journey

      Lesson 5 - SNEX code in a bit more detail.

      So I'm by no means an expert in C or C++ - in fact I only just recently started learning it. But here's what I've sussed out in regards to the HISE template.... and template is exactly the right word, because the first line is:

      template <int NV> struct audio_loader
      

      Somewhere under the hood, HISE must be setup to send in an integer into any SNEX node, that integer corresponding to a voice. NV = new voice perhaps, or number of voices ????

      The line above declares a template that takes this NV integer in, and creates a struct called audio_loader for each instance of NV. Indeed we can prove this by running the following code:

      template <int NV> struct audio_loader
      {
      	SNEX_NODE(audio_loader);
      	
      	ExternalData data;
      	double note = 0.0;
      	
      	// Initialise the processing specs here
      	void prepare(PrepareSpecs ps)
      	{
      
      	}
      	
      	// Reset the processing pipeline here
      	void reset()
      	{
      		
      	}
      	
      	// Process the signal here
      	template <typename ProcessDataType> void process(ProcessDataType& data)
      	{
      
      	}
      	
      	// Process the signal as frame here
      	template <int C> void processFrame(span<float, C>& data)
      	{
      
      	}
      	
      	// Process the MIDI events here
      	void handleHiseEvent(HiseEvent& e)
      	{
      		double note = e.getNoteNumber();
      		Console.print(note);
      
      	}
      	
      	// Use this function to setup the external data
      	void setExternalData(const ExternalData& d, int index)
      	{
      		data = d;
      	}
      	
      	// Set the parameters here
      	template <int P> void setParameter(double v)
      	{
      		
      	}
      };
      
      

      There are only three things happening here:

      1. We set the ExternalData as in a previous post.
      2. We establish a variable with the datatype of double called 'note' and we initialise it as 0.0. But this value will never hold because....
      3. In the handleHiseEvent() method, we use e.getNoteNumber() and we assign this to the note variable. We then print the note variable out inside of the handleHiseEvent() method.

      Now when we run this script, any time we play a midi note, the console will show us the note number that we pressed. This is even true if you play chords, or in a scenario where no note off events occur.

      That's a long winded way of saying that a SNEX node is run for each active voice; at least when it is within a ScriptNode Synthesiser dsp network.

      The next line in the script after the template is established is:

      SNEX_NODE(audio_loader);
      

      This is pretty straight forward. The text you pass here has to match the name of the script loaded inside your SNEX node - not the name of the SNEX node itself.

      2aa2dbe0-4ea2-40b8-8a45-49d96ada26ec-image.png

      Here you can see my SNEX node is just called: snex_node.

      But the script loaded into it is called audio_loader, and so the reference to SNEX_NODE inside the script has to also reference audio_loader.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: scriptAudioWaveForm and updating contents

      @d-healey said in scriptAudioWaveForm and updating contents:

      @Orvillain Did you try, AudioWaveform.set("processorId", value); ?

      Yeah I did, and it does update it based on a follow up AudioWaveform.get('processorId') call - but the UI component doesn't seem to update, and still shows data from the previous processorId. When I compile the script, then the UI updates one time... but not on subsequent calls to the set method.

      I figured I needed to call some kind of update() function after setting the processorId, but no such luck so far.

      posted in General Questions
      OrvillainO
      Orvillain
    • RE: UI Design - AI?

      They're all crap quite honestly.

      posted in Presets / Scripts / Ideas
      OrvillainO
      Orvillain
    • RE: c++ function optimization using vectorization or SIMD???

      @griffinboy said in c++ function optimization using vectorization or SIMD???:

      It's more popular nowadays to store waveforms in frequency domain using FFT, and to silence bins above Nyquist before inverse FFT. Either that or use filters to make mipmaps (multiple copies of your waveform at different pitches, with antialiasing filters applied, baked into the copies, play back the appropriate pre-antialiased file for the pitch) optionally doing so at 2x oversampling and using additional interpolation to remove aliasing that happens from extra processes that happen in Realtime.

      Cheers dude! I was aware of this, but I wanted to see how far I could get with sinc. Turns out, quite far! I've got 22% CPU usage for about 30 voices now. Which isn't really super optimal, but it was a fun project.

      That paper you linked me a while back - https://www.mp3-tech.org/programmer/docs/resampler.pdf - was what got me interested.

      I think I understand the process you mean though, for the mipmapping approach. Something like:

      • Oversample original audio x2 (juce::dsp::oversampling can handle this)
      • Set up a root note
      • For mip-maps below the root note - lowpass and downsample (dsp::FilterDesign::designFIRLowpassWindowMethod then keep every 2nd sample)
      • For mip-maps above the root note - upsample and then lowpass (use the same oversampling approach here for the upsampling and then the same kind of FIR filter???)
      • Store each level, and then move on to the playback engine

      I think that'd be the approach??

      Playback engine-wise, I'd still need to have an interpolation method to playback notes in between the mipmap levels I would guess. Can Hermite cover this, or do I need to go polyphase still?

      posted in C++ Development
      OrvillainO
      Orvillain
    • RE: Getting debug output to the compiler console..

      Hey apologies for the bump. But I got this to work by putting:
      JUCE_LOG_ASSERTIONS=1

      into the preprocessor definitions and then rebuilding. I get data from my custom c++ node printing to the visual studio log:
      947b7f47-31e0-48be-ad66-7de6be45afe0-image.png

      It wasn't working until I did that.

      posted in C++ Development
      OrvillainO
      Orvillain
    • RE: Orv's ScriptNode+SNEX Journey

      @Orvillain

      Lesson 4 - SNEX Node layout.

      I'm still wrapping my head around how the SNEX node works.

      The first thing to note is, SNEX code does not support strings. The documentation for HISE does make this clear, but if you haven't seen it yet... then I've told you again! Here's the docs link:
      https://docs.hise.audio/scriptnode/manual/snex.html#getting-started

      As the docs say:
      The Scriptnode Expression Language (SNEX ) is a simplified subset of the C language family and is used throughout scriptnode for customization behaviour.

      Which means that most of the syntax you're used to when writing interface scripts, is just not going to be the same. There are some overlaps however - Console.print() is still used in SNEX scripts. However, print messages only get logged to the console when you put the SNEX node into debug mode. Which you can do by clicking this button:
      13b51aa6-bc19-42f4-a155-79e6a22b5edd-image.png

      From what I can tell, by default we have the following methods:

      • prepare
      • reset
      • process
      • processFrame
      • handleHiseEvent
      • setExternalData
      • setParameter

      Each one of these methods has a purpose. I'm still experimenting to figure out what those are, but here's what I've come up with so far:

      • prepare
        This is called when you compile or initialise your SNEX node, and it seems to run for each audio channel. I would guess this is meant to setup global parameters like sample rate and block size. Things that do not change from voice to voice.
      • reset
        This is called when you trigger a voice, in my case from midi. When using a ScriptNode Synthesiser, the midi passes into the node automatically. This is where you would initialise variables that can hold different values from voice to voice, but that must start out with the same default value each time.
      • process
        Haven't quite figured this one out yet.
      • processFrame
        Haven't quite figured this one out yet.
      • handleHiseEvent
        This is called when you trigger a HiseEvent - typically a midi event. This is where you would parse out your midi notes, velocities, controllers, and program changes; any midi data really.
      • setExternalData
        This is called whenever there is a change to the external data. In our case, that would be the AudioFile we added in previous steps. So for example if you went to the complex data editor for the External AudioFile Slot (in the node editor) and loaded a new file, this method would get called. This is where you would resize any arrays that you're using to store the sample data, for example.
      • setParameter
        This is called whenever a parameter inside the SNEX node is adjusted. You can parse the parameters out by using if statements and checking P against 0, 1, 2, 3, etc, depending on how many parameters you actually have.

      SNEX has some hard-coded variable names, most of which I don't know yet. But a valuable one is "ExternalData". Consider this code:

      template <int NV> struct audio_loader
      {
      	SNEX_NODE(audio_loader);
      	
      	ExternalData data;
      	// Initialise the processing specs here
      	void prepare(PrepareSpecs ps)
      	{
      
      	}
      	
      	// Reset the processing pipeline here
      	void reset()
      	{
      	
      
      	}
      	
      	// Process the signal here
      	template <typename ProcessDataType> void process(ProcessDataType& data)
      	{
      
      	}
      	
      	// Process the signal as frame here
      	template <int C> void processFrame(span<float, C>& data)
      	{
      
      	}
      	
      	// Process the MIDI events here
      	void handleHiseEvent(HiseEvent& e)
      	{
      		
      	}
      	
      	// Use this function to setup the external data
      	void setExternalData(const ExternalData& d, int index)
      	{
      		data = d;
      	}
      	
      	// Set the parameters here
      	template <int P> void setParameter(double v)
      	{
      		
      	}
      };
      

      Most of it doesn't do anything. But we have established that ExternalData is linked to a variable called data. We can also see this in the data table view:

      3432f74b-5161-4a02-bcb4-06589ff748d5-image.png

      Notice how ExternalData is a Data Type, and it is named data. Also notice how it has a variety of sub attributes - dataType, numSamples, numChannels, etc.

      Let's swap out the file loaded in the AudioFile editor:
      ae436812-4ef9-4d74-b7c7-1b01d056c4d5-image.png

      Notice how numSamples has updated, and also numChannels.

      Back to the code:

      // Use this function to setup the external data
      	void setExternalData(const ExternalData& d, int index)
      	{
      		data = d;
      	}
      	
      	// Set the parameters here
      	template <int P> void setParameter(double v)
      	{
      		
      	}
      

      The data variable we established as ExternalData at the top of the script, is now actually having the data pushed into it by the setExternalData method - which has two inputs; "d" and "index".

      This shows the very very basics of getting sample data into a SNEX script. But we're still not doing anything with it yet.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: Orv's ScriptNode+SNEX Journey

      @d-healey I don't mean to be rude, but please don't distract from the purpose of this thread. Beautiful code and efficient code isn't the point here.

      The point is to demonstrate how the API works, and for there to be a resource for people who come along in the future looking to do sample loading from their scripts, and looking to do advanced things in ScriptNode or SNEX.

      I know full well that in a real world scenario, you wouldn't specify a bunch of files each as an individual const, and you'd put them in a key value pair inside of an array, or perhaps a function acting as a meta-object.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: Orv's ScriptNode+SNEX Journey

      @Orvillain

      Lesson 3 - using the SNEX node with sample content.

      This one is something I'm still getting my head around. @Christoph-Hart kindly provided a one shot SNEX node demo, which you can find by going to the example snippet browser in the Help menu:

      9dc656c3-1c19-4519-a65b-23a8b0f68951-image.png

      This will open a whole new window where you can experiment with snippets. Maybe I'll go over the specific snippet in another post, but for this one... we're starting fresh, and we're going to just do the basics.

      So.... here we have a basic interface script that gives us some file const references, an AudioSampleProcessor retreiving the AudioSampleProcessor from a Scriptnode Synthesiser in our module tree. That synthesiser has a DspNetwork assigned to it:

      694c0445-52bf-4463-9e87-26e544831daf-image.png

      Right now, if we run the code... it will fail to find the AudioSampleProcessor as explained above. Let's add a SNEX node:
      79d066a0-73ee-4e1a-95db-b38bf740fc4b-image.png

      When you do this, it will be blank. You will need to click the three dot menu icon and choose "create new file" - strangely enough, you have to do this even when creating an embedded network. But fine. Let's do it:
      bb7e6551-caff-4400-a6df-a48dc78ca076-image.png

      We need to give it a name:
      40eba1f6-f540-44cf-a267-eec804013f1e-image.png

      At this point, the node becomes active, indicated by the green highlight text:
      644f74ac-0bb3-4dff-b3c8-aa7a1857925e-image.png

      Now if you open the same menu, you get more options:
      335c2077-daf7-41c7-a48e-d0a8bf3b4faa-image.png

      We're going to select 'Add AudioFile':
      bdc1ef26-6564-497a-88cf-c936e11b18fe-image.png

      You can see that now there is an extra icon in the SNEX node, which opens the AudioFile "Complex Data Editor" panel.

      We can add an External AudioFile Slot using the icon on the right hand side:
      1f59716d-91f4-46c7-9acf-06dc11862eee-image.png

      And now you can see that the data editor will display whatever sample you assign to that AudioSampleProcessor from your script:
      fbdb8b3a-79c1-4f4c-89f8-0b16ad744232-image.png

      So here we see that file_r has been loaded into the buffer, and if we wanted to do file_f instead we could change the code to do that:
      8a440106-6b99-411d-92a1-9bb2cbdc1bf6-image.png

      Note - you will not be able to playback the audio at this stage, as your SNEX code will be completely empty. If you click the icon on the right side, it will open the code editor for this SNEX node:
      74b46993-1131-4f9e-905d-5606bc69f521-image.png

      So whilst the data is loaded, our code isn't doing anything with it.

      posted in ScriptNode
      OrvillainO
      Orvillain

    Latest posts made by Orvillain

    • RE: A very basic 101 phaser network

      @DanH I think spread can be achieved by adding a split container after this "mono" phaser... and letting the signal through in the left half of the split (just add a gain there) and in the right... add a delay, and set the delay time to sub 20ms.

      That'd be a nasty way to do it anyway!

      I'm just now learning how to use the clone stuff, so there may be a better way.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: A very basic 101 phaser network

      @DanH I think when you go to insert a node, it should just show up at the top of the list.....

      6c15ee23-46cd-4b26-baea-f9f4c2d7892f-image.png

      Note the clipboard icon on the left hand side.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • A very basic 101 phaser network
      ScriptNode1964.3oc6c18TaiCD.WApBPgRuNzo2q7v8ZyXI+8isvQGd.NtlN28Hiahf3oN14bbJj6u9aksiikwNINM8HIixzghi9Z0pc2eqzLXccPWFpQyKb5DEDN9FmndnFuA2IvOxw0mE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kx+jKk7RIubqlWJ+6uTxK234k1qG7RMEIuTxKk7xsYdoojWJ4kaf7xWK79JPYMAXRj.SIvTBL2lAlVRfoDXtwCLWSdC+nIeC+HAlRf4VMvT9F9QBL2X.lKyas2WfIzU76r2Y5yRqvm8U3176Yr1I2RIyTyQKp4VhaIgb2xT07JcJqcxqzIou8yjucseu2uO97vw+MKZlWoAZ1FFP9RfJARxS0zXAuv1Jda2Mm2a+outsah+L+ld4m90lS9qrgzFqaannYnU7NeINouBce4Y0x8kWHUi3cfzB75VGTCIuMdOmM.BGMuk14ldyOrXlcq6sRMl+Ojuka6C
      

      In theory you should be able to copy this and insert it into a new network. It is a very basic phaser circuit, using clones to create the stages. I've chosen 12 here, but you can quite easily modify it to be 3, 6, 9, etc.

      Any tips on improving it - I'm all ears!!

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: Drift.... and how to design it....

      @Lindon d6c4b1cd-95ad-45fe-b286-5bc0209153e3-image.png

      This creates a per-voice random value between 0.0 and 1.0.

      posted in General Questions
      OrvillainO
      Orvillain
    • RE: Drift.... and how to design it....

      @Lindon https://forum.hise.audio/topic/8527/polyphonic-lfo-2023

      I found this thread quite informative when thinking about polyphonic LFO's. Seems like a similar use case for you.

      posted in General Questions
      OrvillainO
      Orvillain
    • RE: How to modulate a network parameter

      @Christoph-Hart Awesome!

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: How to modulate a network parameter

      @Lindon woah. You know kung fu!

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: How to modulate a network parameter

      @Lindon I might be dumb. I'll have a play with the pma nodes, but not sure I get it.

      Frequency goes from 20hz to 20,000khz.

      I think the oscillator goes from -1 to 1.0.

      I don't know how these interface so that I can see my network parameter to 500hz, and then have my modulation go from, for example 400hz through to 600hz, based on a 'depth' parameter.

      posted in ScriptNode
      OrvillainO
      Orvillain
    • How to modulate a network parameter

      Say I've got a top level network parameter called frequency, and I have it set to the frequency knob of an svf filter.

      Then I've got a mod chain with an oscillator in it, with a peak node tracking the output, giving me an oscillator LFO source.

      How would I take the network parameter and perform a modulation on it so that my eventual svf frequency knob receives an LFO modulated version of the original network parameter value???

      This is a really contrived example:
      ac946b21-78bc-423c-9672-bfbc29e94090-image.png

      Essentially what I'm asking is... how do I blend/multiply/scale/process modulation signals??

      posted in ScriptNode
      OrvillainO
      Orvillain
    • RE: SNEX Wave Shaper

      @Oriah-Beats

      I actually just did this the other day:
      https://forum.hise.audio/topic/9656/orv-s-scriptnode-snex-journey/9?_=1752509228365

      It is a bit crap, but it proves the concept.

      posted in General Questions
      OrvillainO
      Orvillain