HISE Logo Forum
    • Categories
    • Register
    • Login

    Adding a compile button to the interface?

    Scheduled Pinned Locked Moved General Questions
    21 Posts 3 Posters 1.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.
    • d.healeyD
      d.healey @BWSounds
      last edited by d.healey

      @BWSounds You don't have brackets for your if statement, so only the line immediately after it will take the if into account, is that what you want?

      You're missing a semi-colon at the end of this line note.setTransposeAmount(Math.random() > 0.5 ? 0 : -12)

           > note.setTimestamp(note.getTimestamp()   
      

      What's with the >?

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

      B 1 Reply Last reply Reply Quote 0
      • B
        BWSounds @d.healey
        last edited by

        This post is deleted!
        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @BWSounds
          last edited by

          Let's get some brackets { } for your if statement so we can make sure everything you want to be affected by it is.

          What is triggering your button when the tempo is changed?

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

          B 1 Reply Last reply Reply Quote 0
          • B
            BWSounds @d.healey
            last edited by

            This post is deleted!
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @BWSounds
              last edited by

              @BWSounds Does the tempo go off if you don't click the button?

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

              B 1 Reply Last reply Reply Quote 0
              • B
                BWSounds @d.healey
                last edited by

                @d-healey
                if I dont click the button everything is ok.. but the button is the only way i can randomize the sequence.

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

                  @BWSounds What happens if you remove this line note.setTransposeAmount(Math.random() > 0.5 ? 0 : -12);

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

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    BWSounds @d.healey
                    last edited by

                    @d-healey
                    same thing, the sequence stays the same but the length of it is changed.

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

                      @BWSounds So the only thing that is causing the problem is this MIDIPlay.flushMessageList(list); I guess it must be a bug or an intended behaviour. I haven't used the MIDI player myself so I'm not familiar with this function. @Christoph-Hart Will know the answer.

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

                      B 1 Reply Last reply Reply Quote 0
                      • B
                        BWSounds @d.healey
                        last edited by

                        @d-healey
                        Ahh, well thank you for your help!

                        1 Reply Last reply Reply Quote 1
                        • B
                          BWSounds
                          last edited by

                          @Christoph-Hart
                          any insight would be greatly appreciated.

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

                            @Christoph-Hart - any insight would be greatly appreciated.

                            Bump Bump :)

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

                              I'll try one more time :man_shrugging: ...Bump
                              (I've tried everything, just cant be done yet I guess)

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

                                Link Preview Image
                                HISE | Audio Modules | Midi Player

                                A MIDI processor that plays MIDI files.

                                favicon

                                (docs.hise.audio)

                                The timestamp will use the current tempo and samplerate to be consistent with the rest of the MIDI processing in HISE. So if you have quarter notes at 44,1kHz and 120BPM, you will get these timestamps for the first bar:

                                This is your problem right here. The timestamps in your list have the old tempo baked in. In order to solve it, recreate the list at each randomization (however then the randomization will "stack up"):

                                inline function onButtonranControl(component, value)              
                                {
                                    list = MIDIPlay.getEventList();
                                
                                    for(note in list) 
                                    {
                                        if(note.isNoteOn())
                                            note.setTransposeAmount(Math.random() > 0.5 ? 0 : -12);
                                    }
                                
                                    MIDIPlay.flushMessageList(list);          
                                };
                                Content.getComponent("Buttonran").setControlCallback(onButtonranControl);
                                
                                B 1 Reply Last reply Reply Quote 2
                                • B
                                  BWSounds @Christoph Hart
                                  last edited by

                                  @Christoph-Hart
                                  Ahh oK.. I took a quick look, but im getting this error
                                  Can't assign to this expression!

                                  I'll look deeper into this error and try to fix it.

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

                                    You probably have declared the list as const var. Use reg instead.

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

                                      @Christoph-Hart
                                      yep! thank you sir.

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

                                      25

                                      Online

                                      1.8k

                                      Users

                                      12.1k

                                      Topics

                                      105.4k

                                      Posts