HISE Logo Forum
    • Categories
    • Register
    • Login

    Scriptnode SFZ Dropper

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 572 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • modularsamplesM
      modularsamples
      last edited by

      Is there a way to access the SFZ importer in scriptnode from the UI?

      If so, could someone show me how please? :)

      FP.png

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @modularsamples
        last edited by

        @modularsamples This isn't possible at the moment, but you can easily implement a file drop and right-click browse functionality with a ScriptPanel.

        Then you just need to format the reference that you pass into the audio file slot so that it detects it's a SFZ file.

        d.healeyD modularsamplesM 2 Replies Last reply Reply Quote 1
        • d.healeyD
          d.healey @Christoph Hart
          last edited by

          @Christoph-Hart HISE can play SFZ files now?

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @d.healey
            last edited by

            @d-healey the audio file slot can load single audio files or multisample sets from SFZ or included sample maps.

            And the sampler can parse SFZ files and load them as sample map on the compiled plugin too: https://docs.hise.audio/scripting/scripting-api/sampler/index.html#loadsfzfile

            d.healeyD 1 Reply Last reply Reply Quote 1
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @Christoph-Hart Oh that's interesting. Is it possible to manually parse the SFZ file so we can implement various opcodes?

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @d.healey
                last edited by

                @d-healey no, it just takes the opcodes that correlate to a sample map property and maps it automatically.

                The prime use case are hybrid synths with sample playback that want to allow more than a single custom user sample.

                1 Reply Last reply Reply Quote 1
                • modularsamplesM
                  modularsamples @Christoph Hart
                  last edited by

                  @Christoph-Hart Okay, good to know it's possible.. thanks!

                  modularsamplesM 1 Reply Last reply Reply Quote 0
                  • modularsamplesM
                    modularsamples @modularsamples
                    last edited by

                    So I finally got a handle on this. David's video on the File API was super helpful getting started.

                    Here's how its done:

                    const var ScriptnodeSyntesiser1 = Synth.getAudioSampleProcessor("Scriptnode Syntesiser1");
                    
                    const slot = ScriptnodeSyntesiser1.getAudioFile(0);
                    
                    inline function onLoadSFZControl(component, value)
                    {
                    
                    
                    	if (value)
                    		{
                    		FileSystem.browse (FileSystem.Desktop, false, "*.sfz", function (f) 
                    	{
                    		
                    
                    		slot.loadFile("{XYZ::SFZ}" + (f.toString(File.FullPath)));	
                    	});	
                    
                    }
                    
                    }; 
                    
                    Content.getComponent("LoadSFZ").setControlCallback(onLoadSFZControl);
                    

                    Generally speaking it works really well. Some observations:

                    • It prefers well formatted files like this to autogenerated messes like this

                    • I've not extensively tested this, but it seems the path must be included in the region. Setting it with "default_path" doesn't seem to work

                    • It doesn't like .AIF or FLAC files

                    • If a file doesn't work, try removing anything that isn't directly related to the mapping of samples (opcodes, comments etc)

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    48

                    Online

                    1.7k

                    Users

                    11.7k

                    Topics

                    101.9k

                    Posts