HISE Logo Forum
    • Categories
    • Register
    • Login

    Enter data address in item (combobox)

    Scheduled Pinned Locked Moved Scripting
    samplemapcomboboxsaveaddresspreset
    8 Posts 3 Posters 2.4k 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.
    • Dark BoubouD
      Dark Boubou
      last edited by

      Hello guys running Hise,
      After long weeks talking with D.Healey, we arrived at an issue we didn't really know how to solve.
      It's about saving samplemaps properties in a preset.
      What we have to do is this:

      OnInit: 
      const var mainSampler = Synth.getChildSynth("Sampler");  //define sampler
      const var cmbSampleMap = Content.addComboBox("CmbSampleMap", 24, 51); //addcombobox
      const var samplemaps = ["80's_Chords.ch1", "Filter_Velocity_Bass.ch1"]; //let samplemaps $ = the list
      cmbSampleMap.set("items", samplemaps.join("\n"));  // assign this list as the items for the combobox
      
      OnControl: 
      function onControl(number, value)
      {
      	switch(number)
      	{
      		case CmbSampleMap:
                  mainSampler.loadSampleMap(value);  //load the samplemap @ the combobox value (=address)
              break;
      	};
      }
      

      In theory this should work, we're just not sure about the address lines.
      When I boot these lines and try load a samplemap, nothing happens.
      Is it because of a wrong address?
      Is it because I have made ch1 files from xml including samples data located in AudioFiles, which is the wrong directory?
      We don't really know, that's why I write here.

      We have made a snippet here to better understand: just replace the item value by your samplemap adress see if it works...

      HiseSnippet 1252.3oc4XstaaTDEdVmrnZm1pVH+fegVYgD1RAK6zzRgHTcrSRUDwMV1QQUBPoimcr8P1cFqYm0oon7RvSBOB7HviReCfyrW7NapahcoPQv9iUdN2luyYNWl0ckBBMHPHQVqc7ESnHqaa2+BtZb6wXFGcvtHqOwtO1ehGsCdxwz.0gBrKp0ESvAATWjk0JOUKnUwUQQOu9IsvdXNglQBgNQvHzCY9LUF0tM+Nlm29XW5wLeCo2p4ADAusvSDBfZE65nIXxY3Qzmg0hUvFMkQOO.YU29AaVSdViAuZmZ5m325moszu+Z8qnecXDKDITJob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aGMavQOz6CET6IBUvvrNXnAvKgQJvTm9vjVB0b1SA87r3000q0.pOk6VO8yVSX1X1fJfYiTlHRpo.eK426hUX.STtdJRzcs7fQfdlozAv7bMjfIcnYe3B315HGPqOdJMtCSLddqCs6vHcEPvDpizMcr29eFm1GSjhSIw28V652JhBf.dz+aPQ6N50NMRuqs9vxGl6cJgnqp9R33Z9Zr4RqwCVZM1Zo03gKsFOZo03qVZMd70ng9RF6DpD9w8XQn+D8218m. 
      

      Hope someone will light my mind :)
      D.B.

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

        Hi Dark Bobou,

        there are several issues with this:

        1. Use Synth.getSampler() instead of Synth.getChildSynth() in order to access sampler specific stuff like sample map loading.
        2. The .ch1 extension are the monolith sample files. You need to load the xml files found in SampleMaps. However, just leave the file-extension, then it should work (["80's Chords], "Filter_Velocity_Bass"]). Also not sure if the ´ is a valid character for a filename on all operating systems. There's a function called Sampler.getSampleMapList() that automatically gives you an array with all existing sample maps.
        3. The value from the onControl callback from Comboboxes is the index of the selected entry. Use CmbSampleMap.getItemText() for the current text.
        4. Monolith Sample files must be stored in the Samples directory, not the AudioFiles directory (this is for impulse responses and other small audio files.
        1 Reply Last reply Reply Quote 1
        • Dark BoubouD
          Dark Boubou
          last edited by

          Right I check this! :)

          1 Reply Last reply Reply Quote 0
          • Dark BoubouD
            Dark Boubou
            last edited by Dark Boubou

            Ok I have updated my code, here it is:

            HiseSnippet 1242.3oc4XssaaaCFlxIZa1ooncHWrKEL1E1.YFxoocEKXnN14vBVbhQbZPA5F5nkns4hDoAIUNzh7NsGg8H02fsepCVTodY1ccqCa7h.w+Cje+moSOA2iHkbAxZkSudBAYcO69WyTi6LFSYnC1AYce6tXohHbRH095IXoj3irrVZeMAqxKihWu8YswAXlGImDBcFm5QNjFRU4T6056oAA6g8ImRCMjdyVG3wYc3A7H.OKY6hlf8NGOhbDVKVIazETxkRjkq8i1ng37lCd81Mzq1MxVG97Wz7468ca2c+F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zwPNvsKT+KONeO634AN5Acerf5I7HEL.qKFZ.bELFAlzzGlt5QLm2TROCKYuqduFP8ILe2retZJylSGNALalwD4kcTfsk98NXEFvDgombD+9p.XrWfYJsDlgqgDLcCM8Ww.ls1yAz5iufjzgIAO+gCp6R85wAmITGoa5Xu0+LFcH1SvekWx6s0l9mESAP.K9+WPY6t58NMydesNXEBy8dkmmtp5qfv0r0XiEViGsvZr4BqwiWXMdxBqwWuvZ7z6PC8iL1NRwCS5whP+Nv.V8dM
            

            It still doesn't load anything.
            I have remade a basic project, made the same lines we wrote in a dummy preset, took 2 samples in Samples folder, ceated 2 samplesmaps and then tryed load... It doesn't do anything... But I have everything that D.Healey and you told me...?

            Also I'm not sure about how using Sampler.getSampleMapList()... I have 55 samplemaps, it would be faster?
            Btw I have to remake all the samplemaps I did because as you said the samples are in the wrong directory :(
            Hundreds of samples manually cut, normalized, looped and set on the keyboard :((

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

              You might be able to solve this by opening the .xml sample map files with a text editor and do a Search & Replace to set the correct path.

              1 Reply Last reply Reply Quote 1
              • Dark BoubouD
                Dark Boubou
                last edited by

                Thanks, I'll do this!
                It will be really faster than rewrite all the addresses... :D

                And what about the other problems? In theory should this work? Or I did again something bad? :)

                1 Reply Last reply Reply Quote 0
                • Dark BoubouD
                  Dark Boubou
                  last edited by

                  Ah :) Problem solved! (Thanks D.Healey ^^ )

                  JayJ 1 Reply Last reply Reply Quote 1
                  • JayJ
                    Jay @Dark Boubou
                    last edited by

                    @dark-boubou It doesn't load anything

                    Joansi Villalona

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

                    40

                    Online

                    1.7k

                    Users

                    11.7k

                    Topics

                    102.1k

                    Posts