HISE Logo Forum
    • Categories
    • Register
    • Login

    Velocity select instrument and variation

    Scheduled Pinned Locked Moved General Questions
    9 Posts 2 Posters 223 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.
    • MikeBM
      MikeB
      last edited by

      is this possible and if so how?
      Has anyone already done something like this?

      Bildschirmfoto 2021-05-20 um 12.13.24.png

      "One hour of trial and error can save 10 minutes of reading the manual."
      "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
      HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

        Yes you can specify a velocity to trigger with the Synth.playNote() function.

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

        1 Reply Last reply Reply Quote 0
        • MikeBM
          MikeB
          last edited by

          This works
          But how do I get the terms in the array into Label1?

          // Knob1 Instrument - 1-16
          const var Knob1 = Content.getComponent("Knob1");
          // Knob2 Variation - 1-5
          const var Knob2 = Content.getComponent("Knob2");
          // Label shows Instrument
          const var Label1 = Content.getComponent("Label1");
          // Label shows Vartiation
          const var Label2 = Content.getComponent("Label2");
          
          
          var InstrumentID;
          var VariationID;
          var Wert;
          var Instrument = ["Bassdrum", "Snare", "HiHat", "Cymbal", "TomLow", "TomMid", "TomHigh"];
          
          inline function onKnob1Control(component, value)
          {
          //Every 5 velocity values a new instrument starts - within these values they are variations of the same instrument.
          	InstrumentID = value * 5;
          	Console.print("Instrument " + value);
          	
          	Wert = InstrumentID + VariationID;
          	Label1.set("text", "Instrument " + Wert);
          	Console.print("WERT " + Wert);
          
          };
          Content.getComponent("Knob1").setControlCallback(onKnob1Control);
          
          
          
          inline function onKnob2Control(component, value)
          {
          	VariationID = value;
          	Console.print("Variation " + value);
          	
          	Wert = InstrumentID + VariationID;
          	Label1.set("text", "Instrument " + Wert);
          	Label2.set("text", "Variation " + VariationID);
          	Console.print("WERT " + Wert);
          };
          
          Content.getComponent("Knob2").setControlCallback(onKnob2Control);
          
          Wert = InstrumentID + VariationID;
          Console.print("WERT " + Wert);
          
          
          function onNoteOn()
          {
          	Synth.playNote(60, Wert);
          }
          

          "One hour of trial and error can save 10 minutes of reading the manual."
          "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
          HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

            Instrument[Wert] perhaps?

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

            1 Reply Last reply Reply Quote 0
            • MikeBM
              MikeB
              last edited by MikeB

              At most with a lot of if-statements or case-statements.
              for example:

              If WERT is greater than or equal to 1 and less than or equal to 5.

              Instrument = "Bassdrum"

              If WERT is greater than or equal to 6 and less than or equal to 10

              Instrument = "Snare"

              Etc.
              Dann hab ich bei 16 Instrumenten exakt 32 Zeilen - das geht doch sicher in 2 Zeilen oder?

              "One hour of trial and error can save 10 minutes of reading the manual."
              "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
              HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                @MikeB Sorry I don't understand

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

                1 Reply Last reply Reply Quote 0
                • MikeBM
                  MikeB
                  last edited by MikeB

                  see the text inside please.

                  HiseSnippet 1332.3ocsWstSibCE1Cf2RBMqXk1G.qHUUnKjMIKPufpZJAXIZ4RDgEpTa0JmYbHVLwNZFmERWgz9nz+2+zGg8snuF8Mn8XOSlwIDRfHs.BY6yk4674i8435ARWVXnL.4j4r9cYHm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N0vM0aDwT9xC28VzWdIbZudCAsmWwFGYhvQtXbXtew.iEwQWLYgCzEV33OaEGhKisuspzFnq4dp1.1b10AgZyfRXJ8r0AiZAaSQHefK+9JTe9kBC+37DrOq0v7zzvmMO8Qa78oqhw2SwVWPtwCDBIwPighguBgdTn6UVn6uCr2EYwnKDWSQtV1y2izjQDPBKg2hvAFkQ8HxVDJI5hEhpMHGZfVundLOszZh8sYAPUNY.gcCsSWeFwdqYPuHoA2+frCt.X1cYh6xWkqftamrP+zRud9T0vMYqeYQrfQezgtiUQHW02N28Qz4cww14cowcY0CDtOCWmqbaOd7N2Xvq91uOy3M9cL4v60pEyUkB1Ev6+Ky5iVdDPAdHohKt7HpJfC4x3i60oA7rNWFfDgf4GpyblSepHZdQ8bMyzfI7LS9O3mXgkzychEVZfP35I2.46bipDneozhlU.LILOXLC9H8bRR8CLtn4ZOO96bc0Tw5.1GuMkmAad0LXyFyfMaNC1r0LXy2NC17cSzF8am+4dJYmniIvB02yTJ1wYOAExxLYjn+GviP7ou

                  "One hour of trial and error can save 10 minutes of reading the manual."
                  "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                  HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                    Label1.set("text", "Instrument " + Instrument[value]);

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

                    1 Reply Last reply Reply Quote 0
                    • MikeBM
                      MikeB
                      last edited by

                      Great - Thank you very much David - that's it.

                      "One hour of trial and error can save 10 minutes of reading the manual."
                      "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                      HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                      35

                      Online

                      1.8k

                      Users

                      12.0k

                      Topics

                      104.3k

                      Posts