HISE Logo Forum
    • Categories
    • Register
    • Login

    Presets again...

    Scheduled Pinned Locked Moved Scripting
    7 Posts 2 Posters 501 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.
    • LindonL
      Lindon
      last edited by

      So I have a very simple plugin - it just loads a preset and shows me some of the values:

      • well it doesnt. but hey, here's the snippet
      HiseSnippet 2140.3oc4Zs7aabbFeWIsQRzRFxAI.4V2JjFPAKqH9v4khq1HJJG1JYwRJ+HnHPZztCIG3cmYytKoLqg.LPuza4Oh7mPu1CBsn27gflCoG8eB4RO0Cseyr6xcV9RjUMFQsq.L37MyuY9dOeyLtpGyD66y7TTW7nttXE0kzp2kFzpTKDgpTYWE0ap8DbGLsNww0F6orSWWjuO1RQUc16yGi5hyoH99gs2AYinl3DRJJOhQLw6SbHAITqZ7qI116grvGQbjFcQiJlLZIlMqMvOypsohKx7onl3Gf3CaFME02nrEIf4UO.Ef8UTmaGlU25sXmQCG+iH9jSsw7F4TpCSTH48X1VbNlSUoTKhsU0X41WAlkpIZgYC0Buk1ADKRO5IZiUDcnmfPVenNy3Xubxr2lSN6oJwdyExd2RqtoGwMHoGNucCsJz.rWCDXBjYqvwpLy8mWqDCFAMXCGzSw64AM5gH6GT3tqqWH2lqs0xYVNCXH7Cz6f7z+r1AsphnXa86oGCuINnDywkQgFYWs2HVkiMMxJPCu1lADf5Xm.4ANj44AscNE6karSQzXFI57S.57iDcgI.cgQht3Dft3PP+Hjca730bgCY0P6FGWoZGyoCfZfr8waER0hQnMgwRrPbkrTug+0nMUn80YzGvBvGRyt1xYd9xYzi9HMzyFOy+76oCFK7ZRcy+N.7Egv0MHMoLOb4NbVTLtsRF24KmYwkyb9fqWiFYWKyyyrXlyk6hK1dLaHyyv5km+vaLvx5zM5Wqq6zUnnRDJnGelMdCWOBWUR33zMCG9pwrLWp6I12KRmsl968d5YGPgF2qrZYPsNWgHT5wCo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Z39AeCId4Fg7x7PQX1ntBtXIsCHldrPBxbifB+FT1G2H1u7hW9xO0nWG0j8X+9u4SL1CisNE1kUBgQgB+ksioKC3ju9O+W2de1YUgEbOO7W0yl7G9NiOmL.UkcMNfH4e+psOBCQG06RMSYMmMsJb1I6nWCwBVi0NfPad.BBpg0UCRzUGx3XhACHEh34mqScFddlv1aFm3oNlZIZ7ufunNywaqF0Yt3Nk8RtUrWBT.cGlcagyK2971xTzqg6f8NMWZCkW2z2zthxiwARjLJ7GuyE6CJDpYJW+JNtss8A6KsoTtHHFNhupPcaGHS+g9R0EeTKOLxRd9fZorDtQRz9bRIo4.rs6hbbA8p7X1aLEtUOnsEgoWiwbz2L2Fmg5n3vErPcsChaZTOnlphMi4BVcuda.vITFJ3Lp+++vyH+z4Y.eew0COiMFvy3wL3PazPOibGm+t50wlLpk+H7QL9mJi0Gg2+0VejEiObco1dcvk+Jg+wBZQEII6R.LBnTCvd9wS5NHwJJT55e2e6cM3DxkbtjuVPHe5GxiZUneBE+eh7vqDqIq2B4hgMnC0jOF44.QBxZRgpVQ8Wnku3Fo+5bH7OMtM+mebIQakcHHeocEEebZ0RWYKOpnYK9lexEDGsKYRE1mYvuvhjg7NFGBA+9P7icp.n2xHUr9KJXTCa0N8KvBkOxZ12C0JdP19hwgcf8HcRAMYC4K9GY+Saes0lOeum1V7H12Ot.sLZGf7gPk9JSSRmp+xWN2E61elsGmp1dkuvnuG996+laZ7eMkUpmmd70FyYb8qM0x+lgEodchgEF9qOL7JZvYW+I.695Hb+0wZ3ffCRcbzSDyCMWPPAjapnFlEg7IPa8du+.W23PrHGaZxON3cxonLbD4mZDElZDEmZD2cpQ7ASMhObpQ7QiAA++bN7M7bB82ABUKKd4BU0xT9coJb8U92g1iu2B
      

      I have a preset called Init.preset in :

      C:\Users\Lindon\AppData\Roaming\ChannelRobot\TheModernistXylophone\User Presets\Factory\Xylophone

      this is what it looks like:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <Preset Version="1.0.0">
        <Content Processor="Interface">
          <Control type="ScriptButton" id="PresetButton" value="1"/>
          <Control type="ScriptSlider" id="InstrumentGain" value="-2.5999985"/>
          <Control type="ScriptSlider" id="InstrumentPan" value="3.8299999"/>
          <Control type="ScriptSlider" id="WarmthKnob" value="0.17"/>
          <Control type="ScriptSlider" id="ColourKnob1" value="1711.6"/>
          <Control type="ScriptSlider" id="VolumeSliderVoice1" value="0.79000002"/>
          <Control type="ScriptSlider" id="VolumeSliderVoice2" value="0.75999999"/>
          <Control type="ScriptSlider" id="VolumeSliderVoice3" value="0.55000001"/>
          <Control type="ScriptSlider" id="VolumeSliderVoice4" value="0.61000001"/>
          <Control type="ScriptButton" id="ByPassVoice1" value="0"/>
          <Control type="ScriptButton" id="ByPassVoice2" value="1"/>
          <Control type="ScriptButton" id="ByPassVoice3" value="1"/>
          <Control type="ScriptButton" id="ByPassVoice4" value="1"/>
          <Control type="ScriptSlider" id="MicroDelayTimeLeft" value="0"/>
          <Control type="ScriptSlider" id="MicroDelayTimeRight" value="0"/>
          <Control type="ScriptSlider" id="MicroDelayFeedbackLeft" value="0"/>
          <Control type="ScriptSlider" id="MicroDelayFeedbackRight" value="0"/>
          <Control type="ScriptSlider" id="Room1" value="-100"/>
          <Control type="ScriptSlider" id="Room2" value="-100"/>
          <Control type="ScriptSlider" id="ReleaseVoice1" value="796.87"/>
          <Control type="ScriptSlider" id="ReleaseVoice2" value="745.90002"/>
          <Control type="ScriptSlider" id="ReleaseVoice3" value="765.02002"/>
          <Control type="ScriptSlider" id="ReleaseVoice4" value="829.54999"/>
          <Control type="ScriptLabel" id="AuthNumber1" value="11111"/>
          <Control type="ScriptLabel" id="AuthNumber2" value="22222"/>
          <Control type="ScriptLabel" id="AuthNumber3" value="33333"/>
          <Control type="ScriptLabel" id="AuthNumber4" value="44444"/>
          <Control type="ScriptButton" id="FactoryPresetFlag" value="0"/>
          <Control type="ScriptLabel" id="AuthValues" value="Empty"/>
        </Content>
        <MidiAutomation/>
        <MPEData Enabled="0"/>
      </Preset>
      

      I think this should just run - load the preset and show me the contents of AuthNumber1-4, but it actually shows me the text "undefined"

      What am I doing wrong?

      HISE Development for hire.
      www.channelrobot.com

      1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon
        last edited by

        OK more reading...it seems the call to loadUserPreset is asynchronous, fine... so I need to set a timer and check back that the load has completed, whats the method I should use to check that the load is complete - I looked at getCurrentUserPresetName but that wont work as its the same name...

        HISE Development for hire.
        www.channelrobot.com

        1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey
          last edited by d.healey

          You should be able to get the value in the onControl callback straight after the preset loads.

          presetTest.mp3

          This file is actually a zip but I had to change the extension so the forum would allow me to upload it. Right click on it and select Save Link As (or whatever similar option your browser offers). Once downloaded, change the extension from mp3 to zip.

          This project has a preset browser and a knob. Moving the knob outputs its value to the console. From the preset browser you can select one of the presets which will also trigger the knob's callback after loading.

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

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @d.healey
            last edited by Lindon

            @d-healey OK well I see a problem right there "preset browser" I dont always want a preset Browser...is this always required?

            In fact I think re-reading your explanation this is nearly the opposite behavior to what I want.

            I want to specify a preset load it and set a number of widgets to those values... I dont want the browser involved in any way.

            HISE Development for hire.
            www.channelrobot.com

            1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon
              last edited by

              it tells me its not a valid project folder and wont let me open it

              HISE Development for hire.
              www.channelrobot.com

              1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon
                last edited by

                OK fixed that and if I remove the preset browser and add the line:

                Engine.loadUserPreset("New Directory/New Directory/Preset3");

                in the init this seems to work....

                HISE Development for hire.
                www.channelrobot.com

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Lindon
                  last edited by

                  @Lindon I've always used the preset browser to load presets so that was my go to. Glad it seems to be working :)

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

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

                  53

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.9k

                  Posts