Jump to DAW playback position
-
Hello all,
I searched the forum for an answer but could'n find anything.I'm working on a drums plugin that contains midi clips.
I've already a working transport handler to sync/unsyc the plugin and the clips to the DAW, but I want to do this:- DAW is already playing (user wants to find a good midi clip that matches his song)
- User will click on several midi clips listen to them along his song
- The midi player should jump to the DAW's play head and start playing the clip at the right beat in the right bar (not start at 0 when the bar is 2.5).
Engine.getPlayHead()
is empty (that's been already reported) and I can't think of any other way to do that.Would anyone have a idea about how doing it ?
Cheers
-
@ulrik Aah ok noted. Thank you for your help !
-
@Matt_SF Try this snippet, it's built for having the midi files in the projects midi folder, so if you're having them elsewhere you have to adjust the settings
HiseSnippet 3802.3oc2Yk1iiajdVZlQdc2axB6EKBBxmHFjfn1Z.snNnDsg2o0snnnnDE0o2EdoHKdHdJV7PRKLv9OK+ExOE+87gMUQI0s5YZOdvfrAYSCzM5538sddO4SQNNvSA.gdAYxdqzAePlr+C4ldvMznkgroaF11Yx9ujaPjiOgjGwXa4CajUrF6AMCM8byz7fuLDBTyjM6K6g2e1adUlze9o21T1V1UA73TYxL2yTALzzwL7wYGeOmoscWYUfjoyU6tx8rJdts7r8hPX6k4JlwGcxx5fQx3s8hbY5KCMxj8qxUrJM.Tqrlppb4xpzzzL0YpvPIqUrh7FJZlJkpTqT8ZZYx9YcTMC8BlFJGBfYx9pldpGlZ3k3d5.laBM2XCvCnxLEcxmltqmsJ1Dwylokgos53KNMXlLYyM9QW3KO4B+c43MUMeX9GckeQ5BDOJw0Nvru3ov6kOAdTWCuhWAumARu3JH8qtDUSgDJ.BBRgxM43OO5ZLzJJH.3FNErKB7jf2O81yKIEfBCWO+POO+NtxHjod8zWxUl5Cd5BYe4GsYR8AMyLXKpqoM.axYuL.sar4gxOZKGJm4Ee4mmipZkxjtRzb0aQIO3HCGoq6x98ZLN9HkMI4v39iVp0n6oesVpFOY4X4i9tKn51.5eXRawibP1UFh6GxdPZqb39v5h7a6KFKNXGHwcw5NB8aOXqXaZdnv1wj7s0ZzXYwBGAbQb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Xjq0A
-
@ulrik oh and one more thing, if you start the midi player when the daw is playing, there is a function in the Play callback that calculate the midi file length, based on the the last note off timestamp in the loaded sequence.
So if your midi file has silence after the last note off event, it will fail to set the right playback position.
I couldn't find a way to calculate the actual length of the midi file (maybe there is a way that I'm not aware of) -
@ulrik Many Thanks Ulrik! I tried using
setOnGridChange
but the docs lacked some details (what are the arguments, how many are they). What is theclock
arg ? What are its units ?I'm not a math genius but, using what you've made I managed to get the playhead position without relying on the timestamps. As you said, if there is slience after the last notOff event, it might mess up the calculation.
I haven't tried in a compiled plugin but seems to be working.Let me know what you think! At this hour I don't know if I can be trusted
HiseSnippet 3256.3oc2Zs0TajbEdD1ZSfMYqc2rUpT4kLEURsirYkPiDBXc4XP2.rQfrjvX7lMTslokTCi5d7bAPdKWYeK+7RdH+.xOgM+BRNm4hzHYgtAaprgG.5Kem9zmy24zWltpkPiZaKrjhsRidlToX+h306wc5TnCgwkNnnTrea7SLrXW9k1xNVDtsovxYeBW2fZIkumIw1lpKEK1C1C6erkenj2O+vyxSLHbM5fpjjdkfoQOj0k4Ln1p67BlgQYhNsAqajdmcmCzD7BBCgKnaOH95RlDsKIsoGQvtsTbo8I1cjh8n3jLYzakK2Vaqqkciza2hrotVyLauAUWMaF51Tc8Myn2rUKoXeTIclivptCwgZKE6g4E58p2QbM2e.dEyl0zfhERKUGFY+pKKLzwoHVqTgNLC8pgFMaIoXwqNvD9.eS3WDuBSm0u9AlxO0qA4AHhZ.iszvp2CFR8RGU8VOh5MFUZoHpzOKzq5oRFjdfaCUkkiWInTTcnfqkEk6Tm9VW5PNue3YAM0vBbCQq+PgvrDm.ZldzpQg2D5ZcS5vMD6Ay7zL8DmlR3LpLyfhS4XgEfdiSOfeTj3PjV58whqtU5j7F4dwVER+tce2d4Stu1MWlI+EcKm7vWzt8tu442jrS4MUKdIoUQwElWre6FcN7kEpmozq4tUr4V165XcAqCqbkiqW8MapYt2d2TbuZIK17hMeiS0F4DV8ztRr6gGbxtIczK+5N56+t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aV4QK1sqvkOzqhZzmv2CmsuOxTdHkO7+4dHk+DHXOVrH53xg5XcVWSCZINr8RATCpied7hzVDWCmvZGlKWQvElcDblVTGcMpiEqcapUTcerSnccbF5cg9E6TiZPIQIs+9cNDHaDK7H1KnsH8raKlj+52D2Wckw.P4e5lj9A++cR5ZBW7YkUg.jPXQ63G41sNjaTihOnBN0.+xrwVByu4WdcrrexQttWg+M7SPiowxwBZLcXi+WYL5RzfMvp4+oYQd5O2qFXdy8dYrKGuBVVN8G9EYwuP+4ZZCKpO.n5hBLyhBL6hBbiEEXtEE3lKJvslNPbQncccDc8CMkjpTsj2WPOVr9OI9XOP5+.kpqvGA
-
@Matt_SF said in Jump to DAW playback position:
@ulrik Many Thanks Ulrik! I tried using
setOnGridChange
but the docs lacked some details (what are the arguments, how many are they). What is theclock
arg ? What are its units ?I have only tried the first arg which I named "clock", I don't know what the 2 others are
The clock argument counts how many, in this case, 1/64T has occurred, up to the daw playback position meaning that if the count is 96 sixty-fourths triplets, 4 quarter notes has passed
The unit is the note value you set here:TH.setEnableGrid(true, 23);
So in my case (with extended tempo settings), 0 refer to 8/1, 1 to 6/1, etc... and 23 refer to 1/64T, the shortest note value
-
@ulrik Aah ok noted. Thank you for your help !
-
-
@Matt_SF at line 82 you have a undefined variable if there is no midi file loaded in the midi player, and trying to load a midi file with the vp will make Hise crash.
And if the daw is playing and you start to play a midi file with "Play" button, it will start from the beginning not from where the daw playhead is.I think my example take care of that.Counting bars taken from the Timesignature object will not work with midi files that have more than one time signature
Otherwise, if the midi player is already running it seems to work nicely when changing midi files
-
@ulrik said in Jump to DAW playback position:
at line 82 you have a undefined variable if there is no midi file loaded in the midi player
Ah, indeed...
And if the daw is playing and you start to play a midi file with "Play" button, it will start from the beginning not from where the daw playhead is.I think my example take care of that.
That's weird, it's working here...
Counting bars taken from the Timesignature object will not work with midi files that have more than one time signature
Also true...
-
@Matt_SF said in Jump to DAW playback position:
That's weird, it's working here...
Sorry, my bad, it is indeed working here as well
-
@ulrik Ok, I'm not completely useless then
It's the first time I'm using midi clips in a plugin so...
Thank you again for your help, it's much appreciated !