HISE Logo Forum
    • Categories
    • Register
    • Login

    Randomizing MIDI Notes

    Scheduled Pinned Locked Moved General Questions
    14 Posts 3 Posters 786 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.
    • Christoph HartC
      Christoph Hart
      last edited by

      Yeah, sure, just adjust the timestamp.

      B 1 Reply Last reply Reply Quote 0
      • B
        BWSounds @Christoph Hart
        last edited by

        @Christoph-Hart
        So I did... (and I may be way off with this)

        if(note.isNoteOn())
            note.setTimestamp(Math.randInt(3, 6));
        

        but it just stretched them all from the start point.

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

          note.setTimestamp(note.getTimestamp() + Math.randInt(3, 6));

          But unless you have super powers, you won't hear the timing differences of 0.00015 seconds :)

          B 2 Replies Last reply Reply Quote 1
          • B
            BWSounds @Christoph Hart
            last edited by

            @Christoph-Hart said in Randomizing MIDI Notes:

            note.setTimestamp(note.getTimestamp() + Math.randInt(3, 6));

            But unless you have super powers, you won't hear the timing differences of 0.00015 seconds :)

            Haha... Thank you, I got it rolling now! With a more realistic timing difference.

            1 Reply Last reply Reply Quote 0
            • B
              BWSounds @Christoph Hart
              last edited by

              @Christoph-Hart
              Is it possible to kind of add a more predictable randomization to the notes?
              like set the transpose to go up or down 12st (nothing in between) or shift the notes forward or back a certain amount? Or an I asking for to much lol?

              Ive been trying to figure out how the seconds (EX.(-200000.50000, 0.50000)) work and how I could use that to accomplish my goal.

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

                Up or down 12st:

                Message.setTransposeAmount(Math.random() > 0.5 ? 12 : -12);
                

                The timestamp unit is sample rate, so you need to use Engine.getMillisecondsForSamples() to get the second amount (there are also other conversion functions in the Engine object that you can use to get tempo based values.

                B 3 Replies Last reply Reply Quote 1
                • B
                  BWSounds @Christoph Hart
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • B
                    BWSounds @Christoph Hart
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • B
                      BWSounds @Christoph Hart
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • NatanN
                        Natan
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        49

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.8k

                        Posts