HISE Logo Forum
    • Categories
    • Register
    • Login

    Drum Mapping- user defined

    Scheduled Pinned Locked Moved General Questions
    drum mapping
    40 Posts 5 Posters 2.6k 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.
    • gorangroovesG
      gorangrooves
      last edited by

      @d-healey So, I managed to get this working, to my great surprise :) It is all thanks to you! I have another challenge to solve with this.

      Here is the code I currently have:

      OnInit

      const var map = Engine.createMidiList();
      reg KickNumber;
      const var KickKey = Content.getComponent("ComboBoxKickMidi"); // Declare combobox
      
      reg SnareNumber;
      const var SnareKey = Content.getComponent("ComboBoxSnareMidi"); // Declare combobox
      

      OnNoteOn

      function onNoteOn()
      {
         //----kick mapping----------
         KickNumber = Message.getNoteNumber() + 1;
          
      	if(KickNumber == KickKey.getValue())
          {
              Message.setNoteNumber(36);
          }
          
          //----snare mapping----------
         SnareNumber = Message.getNoteNumber() + 1;
          
      	if(SnareNumber == SnareKey.getValue())
          {
              Message.setNoteNumber(38);
          }
      }
      

      Here is what is happening now...
      By default, the Kick is C1 and snare D1. If I set the Kick to B0, the kick will sound when pressing either B0 or C1.
      However, if I now set the snare to C1 (kick's default note), then all 3 notes (B0, C1, D1) will now trigger the snare!

      The ideal scenario would be that once a note is set for an instrument, it would only play on that set note and the default note would now be freely available for another instrument to use. In the above example, B0 should trigger kick, C1 should trigger snare and no note will sound on D1.

      Is this achievable and if so, any idea of how I would go about it?

      Thank you!

      Goran Rista
      https://gorangrooves.com

      Handy Drums and Handy Grooves
      https://library.gorangrooves.com

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

        @gorangrooves this is pretty simple isnt it?

        on init:

        reg KickLocation = 36;  //where the kick actually is
        reg KickTrigger = 54;   //the note that triggers a kick
        
        reg SnareLocation = 38;  //where the snare actually is
        reg SnareTrigger = 56;   // the note that triggers a snare
        

        on note on:

        	if (Message.getNoteNumber() == KickTrigger)
                  {
        	      Message.setNoteNumber(KickLocation);  
        	  };
        	
        	
        	if (Message.getNoteNumber() == SnareTrigger)
                   {
        	      Message.setNoteNumber(SnareLocation);  
        	   };
        

        Or did I mis-understand your requirement?

        HISE Development for hire.
        www.channelrobot.com

        gorangroovesG 1 Reply Last reply Reply Quote 0
        • gorangroovesG
          gorangrooves @Lindon
          last edited by

          @Lindon Thanks. I think your solution will achieve the same result that I currently have, but without the ability for a user to pick a note. What I am trying to do is use a combobox within the interface to pick a note that should trigger a particular instrument (kick, snare etc.). I got the basic function for that working.

          The challenge now is to refine it to do this:

          By default, the Kick is C1 and snare D1. If I set the Kick to B0, the kick will sound when pressing either B0 or C1.
          However, if I now set the snare to C1 (kick's default note), then all 3 notes (B0, C1, D1) will now trigger the snare!

          The ideal scenario would be that once a note is set for an instrument, it would only play on that set note and the default note would now be freely available for another instrument to use. In the above example, B0 should trigger kick, C1 should trigger snare and no note will sound on D1.

          Goran Rista
          https://gorangrooves.com

          Handy Drums and Handy Grooves
          https://library.gorangrooves.com

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

            @gorangrooves then just add a call back for the combobox that sets the trigger value..

            inline function onmyKickComboBoxControl(component, value)
            {
            	KickTrigger = value;
            };
            
            Content.getComponent("myKickComboBox").setControlCallback(onmyKickComboBoxControl);
            

            HISE Development for hire.
            www.channelrobot.com

            gorangroovesG 1 Reply Last reply Reply Quote 0
            • gorangroovesG
              gorangrooves @Lindon
              last edited by

              @Lindon Thank you!

              I tried it, but unfortunately, it still produces exactly the same results. The issue still remains that a user-selected note is in addition to the default note for a particular instrument. So, if default note for kick is C1 and user select E0, now we have the kick sounding when pressing either E0 or C1. It doesn't free up the original kick default note to used by another instrument.

              The issue gets more complicated when we introduce a second note. Lets say we have the snare by default at D1. If a user selects snare note now to be C1 (default note of the kick), now there is no kick sound! Snare is heard when pressing either E0, C1 or D1.

              How do we go about having a user select a note for each instrument and that note being the sole note which triggers a particular instrument?

              Goran Rista
              https://gorangrooves.com

              Handy Drums and Handy Grooves
              https://library.gorangrooves.com

              1 Reply Last reply Reply Quote 0
              • gorangroovesG
                gorangrooves
                last edited by

                Updated code:

                On Init

                Engine.createMidiList();
                
                //kick    
                inline function onComboBoxKickMidiControl(component, value)
                {
                	reg KickTrigger = value;
                };
                
                Content.getComponent("ComboBoxKickMidi").setControlCallback(onComboBoxKickMidiControl);
                
                //snare
                
                inline function onComboBoxSnareMidiControl(component, value)
                {
                	reg SnareTrigger = value;
                };
                
                Content.getComponent("ComboBoxSnareMidi").setControlCallback(onComboBoxSnareMidiControl);
                

                On Note On

                //----kick mapping----------
                   if (Message.getNoteNumber() +1 == KickTrigger)
                          {
                	      Message.setNoteNumber(36);  
                	  };
                    
                    //----snare mapping----------
                    if (Message.getNoteNumber() +1 == SnareTrigger)
                    {
                        Message.setNoteNumber(38);
                    }
                

                Goran Rista
                https://gorangrooves.com

                Handy Drums and Handy Grooves
                https://library.gorangrooves.com

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

                  @gorangrooves why are you adding 1 to the Message.getNoteNumber()??

                  Actually thinking a bit about it a combo box is probably not a good way to select a midi note number, try a knob instead...

                  HISE Development for hire.
                  www.channelrobot.com

                  gorangroovesG 1 Reply Last reply Reply Quote 0
                  • gorangroovesG
                    gorangrooves @Lindon
                    last edited by

                    @Lindon Adding +1 is necessary for the values to present a correct note. Without it, the resulting note is a semitone lower. C gets played as B, so with +1, it becomes C. Not sure why it is. Maybe a 0 gets counted, but it doesn't have any note...

                    I don't think a knob would be a better option, to be honest. How would you display 127 notes in a circle? Selection of a note is not an issue, but rather how to properly process it later.

                    Goran Rista
                    https://gorangrooves.com

                    Handy Drums and Handy Grooves
                    https://library.gorangrooves.com

                    LindonL 1 Reply Last reply Reply Quote 0
                    • gorangroovesG
                      gorangrooves
                      last edited by

                      @Christoph-Hart Any idea of how I can get this to work properly? User-selected note to be assigned to a single instrument, freeing up the default note to be used by another user-assigned instrument.

                      Goran Rista
                      https://gorangrooves.com

                      Handy Drums and Handy Grooves
                      https://library.gorangrooves.com

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

                        @gorangrooves well the reason you are having to add the 1 is that a combo box returns 1 as the first index so a combo box with this in it:

                        • zero
                        • one
                        • two

                        When you select "zero" the combo box will return a value of 1, when you select "one" the combo box will return 2 etc. etc.

                        So you should either map the returned values to meaningful note ranges or use a knob

                        If you use a comboBox I assume you dont want to map ANY note number you might want to map notes 60 -80 in that case you will need to set up your comboBox to contain the following:

                        60
                        61
                        62
                        63
                        64
                        65
                        66
                        67
                        68
                        69
                        etc..

                        and in your call back say:

                        //kick    
                        inline function onComboBoxKickMidiControl(component, value)
                        {
                        	reg KickTrigger = value + 59;
                        };
                        

                        So a knob returns its value : so define a knob (a slider in the UI) values 0 to 127 and set showValuePopup = "Above" and the knob will display the numbers 0 to 127 above itself whenever the user moves the knob, and will remove this pop up after a few seconds

                        HISE Development for hire.
                        www.channelrobot.com

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

                          with luck this will give you a clue how to proceed.

                          HiseSnippet 1605.3oc6YE0aaaCDVJNJsNqYXsnOrG1CBEc.1Xso1oIoMKnn1wNoMnIMFVoA6ACTvHS6PDIRAJJ250EreO6s8Sn+j5+fsiTRQTINYVAccEcUAvP73c79tiGu6DSGNyEGFx3Flk2eb.1v7FVNiohiZcDhPM1tsg42X0mG4yw9n.iMFGfBCw8MLMK8LIClkm0P87gmtAxCQcwYjLLNfQbw6P7IhLpcZ7Bhm2Vn938I9ZbubiscYzVLOVD.lRV0LBPtGiFheIRx1LVFlysYehfwcDHANzvb1MX8G6bD6MzX9OfDRNzCKGT2vAVnXxaw75KQr7ciVGQ752I0nCMLLs5j4BJE6Bts0tj9jSom4J9N0D1YRn6OLm4xfW8qH7L0f2rwv6lVNtbRfHal3sosoBLe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WTPGDr0qw4FjjSdvbwTxmlUi0Si8TPUqrzDp4L2Wq4nfaooCt+C2jQ4TL5PjaUaRGA4p.JRLdKnS9AnHOQJ074M2kQYAGwnD27YFR97YcrOQCpoP.Ilxnb6FcwdXTnVps61XGnWIDOeBuB4KpO89hKa+56shgqsLYu8WF8JT5+88JbYtN3KCUYurAsyEeluOeCKUpdaY6H+WA0trHAzlQZodKnef3qARuqfYjcZDOtlbrDPNXZe0f+BdRlrdZKDxIqmNoga5RA1Vx6p6kvrDlJKcnZA1CZNwSOjND5zRBoYrf2UapxqPGFGO.9dstLYyPVlKIuwD1KviSG7bh1fcXGHW3XT+bRxfeWZ6wcfkB5sHdI2V96rZ8y8f1f3g8fTY8YzdMCBjPt2NLWjWu8w9A85h32scWTsEW4wq06.B7EhCw1s4Q9g1HZea.Ag8Z5gCIg1Ncue8U6o90F5j0tV8dGBa1x+w.g06soGbfhyntK9FzHi1QAdDWXKVFHXbNacMcacMcacsqls9aExVqUe4haqpKWLwXa54wFa6P4SvX+TDK9oPG9HWN60twWfmLp+5JJP7NU4xKasqbrc8zqrSdN0G5440ttxDp2GNoNYIVpvR7vBKwxEVhUJrDqVXIdTgk3wWhDxFLaFIX9wkWABc1LNkj4lmlRpjweyiIwWZ
                          

                          HISE Development for hire.
                          www.channelrobot.com

                          1 Reply Last reply Reply Quote 0
                          • gorangroovesG
                            gorangrooves @Lindon
                            last edited by

                            @Lindon said in Drum Mapping- user defined:

                            So a knob returns its value : so define a knob (a slider in the UI) values 0 to 127 and set showValuePopup = "Above" and the knob will display the numbers 0 to 127 above itself whenever the user moves the knob, and will remove this pop up after a few seconds

                            This is not very user-friendly, I am afraid. I am certain that 99.99% of my users will have no clue which note pertains to which midi id#, so numerical values would be of no use. My combobox displays note names (C0, C#0 etc.) which a user will know to select. They are then turned into numerical values to be used internally.

                            I will check the snippet you provided. Thank you!

                            Goran Rista
                            https://gorangrooves.com

                            Handy Drums and Handy Grooves
                            https://library.gorangrooves.com

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

                              @gorangrooves most people use a midi learn function...

                              Well to be honest every time we've built a drum ROMpler we provided a mapping for all the major players:

                              • BFD
                              • SD
                              • iDrum
                              • DrumIt5
                              • GM
                              • Roland VDrum
                              • Yamaha DTX900

                              etc.

                              HISE Development for hire.
                              www.channelrobot.com

                              gorangroovesG 1 Reply Last reply Reply Quote 0
                              • gorangroovesG
                                gorangrooves @Lindon
                                last edited by

                                @Lindon Your snippet works very well! I am going to tweak it now to fit my setup. With a bit of luck, I'll report back with good news :) Thank you very much!

                                Goran Rista
                                https://gorangrooves.com

                                Handy Drums and Handy Grooves
                                https://library.gorangrooves.com

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

                                  @gorangrooves no problem, of course it WONT really expand to deal with all your articulations - the code would become a nightmare - so you should really put all your "sources" in one array and all your "triggers" in another.

                                  I guess its not giving too much away but heres one kit with its articulations

                                  Addictive Drums

                                  Kick Soft Beater 24
                                  Kick Hard Beater 36

                                  Snare Centre 38
                                  Snare Edge 43
                                  Snare Rimshot 37
                                  Snare Centre Undamped 84
                                  Snare Edge Undamped 86
                                  Snare Rimshot Undamped 88
                                  Snare Sidestick 42

                                  Hat Fully Closed 49
                                  Hat Closed 51
                                  Hat Open Quarter 52
                                  Hat Open Half 54
                                  Hat Open Three Quarters 55
                                  Hat Open 57
                                  Hat Edge Fully Closed 50
                                  Hat Edge Closed 53
                                  Hat Edge Open Quarter 85
                                  Hat Edge Open Half 87
                                  Hat Edge Open Three Quarters 90
                                  Hat Edge Open 92
                                  Hat Pedal Shut 48
                                  Hat Pedal Open 59

                                  Hi Rack Tom 69
                                  Lo Rack Tom 67
                                  Floor Tom 65

                                  Ride Centre 45
                                  Ride Bell 61
                                  Ride Edge 62

                                  Crash Centre 77
                                  Crash Edge 46

                                  ...I guess you've worked out all the articulations for all the kits you want to use. I suggest you start by working out your default mapping for those (but you may well have done that already).

                                  HISE Development for hire.
                                  www.channelrobot.com

                                  gorangroovesG 2 Replies Last reply Reply Quote 0
                                  • gorangroovesG
                                    gorangrooves @Lindon
                                    last edited by

                                    @Lindon Thank you, Lindon. I already have the mapping sorted out which follows the GM mapping for the most part. I've gone 1 step beyond the Addictive Drums. Notice all those hats (edge/ bow) taking up so many notes? I made mine by occupying only 2 notes: 1 for bow and 1 for edge. On them I have tight close, close, 25% open, 50% open, 75% open, 100% open, each having several velocity levels and 8 round robins 😉 You switch between them using a controller.

                                    I duplicated the code to include 3 notes now and it works fine. Each note has to be setup or it won't sound, but that is fine. I didn't see the point of the reg kickTrigger = 50; parts, since those values get set by the comboboxes. I took those lines out and the results are the same :)

                                    Off to some copy, paste, edit...

                                    Goran Rista
                                    https://gorangrooves.com

                                    Handy Drums and Handy Grooves
                                    https://library.gorangrooves.com

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

                                      @Lindon So, I managed to get 8 instruments going by copy, pasting and editing the code, but it doesn't seem to work past that number. I am guessing that the limitation is with the On Note On portion of the code, since those conditions seem to be nested (8 levels deep). I am assuming that it will need to be done in a slightly different manner. You said that I should put all the sources in an array. I assume that the code would now be completely different for On Note On, right?

                                      Goran Rista
                                      https://gorangrooves.com

                                      Handy Drums and Handy Grooves
                                      https://library.gorangrooves.com

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

                                        @gorangrooves your problem here will be that there are A LOT of midi files out there that people will have invested in and they'd like them to work with your ROMpler, so if you remove mappings from the overall structure then their AD or BFD focused midi files will not work with your ROMpler

                                        HISE Development for hire.
                                        www.channelrobot.com

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

                                          @gorangrooves yes two arrays - in a strict articulation order.

                                          So on Note look thru the trigger array to see if the incoming note is used, if so then use the note at the same position in the source array, if not then remove the event.

                                          For playing notes you will need to keep the event id so you can do the VDrum muting.

                                          HISE Development for hire.
                                          www.channelrobot.com

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

                                          58

                                          Online

                                          1.7k

                                          Users

                                          11.7k

                                          Topics

                                          101.7k

                                          Posts