HISE Logo Forum
    • Categories
    • Register
    • Login

    Problem rendering samples with modified start times

    Scheduled Pinned Locked Moved Bug Reports
    22 Posts 2 Posters 1.3k 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.
    • B
      blezzbeats @d.healey
      last edited by

      @d-healey Didn't know there was a way to do that with an envelope, my project calculates the bpm based on the sample length, chops a sample up into pieces, and plays it back in different sequences in the tempo of the host bpm regardless of pitch. So it's a haxxor timestretch using the sampleStartMod that needs to be as precise as possible. Surely some sort of timer must be needed?

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

        @blezzbeats Yep, probably need a timer for that, and you probably don't want it in your interfaces script (since this should be deferred).

        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
          blezzbeats @d.healey
          last edited by

          @d-healey Oh yeah? I got that backwards then. I thought deferring callbacks was useful for non-realtime things.

          You think that might have something to do with the audio being rendered differently too?

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

            @blezzbeats

            I thought deferring callbacks was useful for non-realtime things.

            It is. Always defer your interface script. Anything you need realtime (like starting timers at precise moments) should be in a secondary script.

            You think that might have something to do with the audio being rendered differently too?

            Possibly.

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

            B 2 Replies Last reply Reply Quote 0
            • B
              blezzbeats @d.healey
              last edited by

              @d-healey Thanks for your input!

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

                @d-healey One follow-up question that I can't seem to find any good info on when I'm detangling my scripts, how do I update a variable in another script from the interface script?

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

                  @blezzbeats You can use global variables, but you should avoid them at all costs because they make things messy.

                  Generally scripts should be independent of each other. Treat scripts like the way you treat HISE's built in modules, if you want to connect things on the UI script to the module you use either parameter/processor ID, or you use the setAttribute() command.

                  I posted a video on patreon last Saturday about articulation switching where I demonstrate this.

                  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
                    blezzbeats @d.healey
                    last edited by

                    @d-healey Thanks!

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

                      I think I found the problem in case anyone else runs into it. If you create a timer with Engine.createTimerObject(), it will be straight-up ignored when you render it in your DAW. The regular onTimer function does work though. I used a timer to trigger another timer so I guess I'm outta luck.

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

                        @blezzbeats Oh yes that's true. Timer objects are non-realtime, but the synth timer is. If you want two timers then use two scripts/midi processors.

                        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
                          blezzbeats @d.healey
                          last edited by

                          @d-healey Do you know how I can trigger the timer of the second script from the first one?

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

                            @blezzbeats Maybe, tell me what you are trying to achieve and I'll see what I can suggest.

                            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
                              blezzbeats @d.healey
                              last edited by

                              @d-healey The sample is divided into 16 even pieces. One timer controls when it should switch over to the next piece (next 16th), according to the host BPM, by changing the Constant modulator of the SampleStartMod of the sampler. Each time that one triggers, it triggers another timer which takes a calculation on how much to stretch the sample based on host BPM, sample rate, sample length, grain size, currently played pitch etc. and machineguns the same Constant modulator.

                              I had everything working pretty much, now after backtracking and rewriting everything I just need to figure out how to trigger that second timer from the first one. It may work having them run parallel?

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

                                The way things are twisted together it would be much easier if there's a way to have the timer of script 1 trigger the timer of script 2 though, to avoid duplicates of like 50 variables.

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

                                  @blezzbeats Well you could just put a knob in the second script and in that knob's callback you start your timer, then from the first script you change the value of the knob in the second script.

                                  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
                                    blezzbeats @d.healey
                                    last edited by

                                    @d-healey Genius!

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

                                    55

                                    Online

                                    1.7k

                                    Users

                                    11.7k

                                    Topics

                                    101.8k

                                    Posts