Jump to content

FR: Absolute Time Offset for MIDI Tracks (by ms)


apt

Recommended Posts

On 2/1/2024 at 12:07 PM, msmcleod said:

Tempo changes are still discrete jumps, but just at a more granular level.  The tempo map is derived from the tempo envelope each time it's edited so it doesn't have to calculate it in real-time.

However, an absolute time offset it's still quite complex to do, due to the way MIDI events are queued up in time ready to play.  Part of the queuing process is determining which events to queue and when to queue them.  This is all done in batches of musical ticks at the moment.  If the delay (negative or otherwise) was specified in milliseconds, this would ultimately have to be converted to ticks - but when tempo changes are in play, the amount of ticks could be different for the start time for searching through what to buffer and the start time of each MIDI event.  Getting this wrong could result in either missing notes or notes queued up twice.

As far as it being computationally intensive... this is partially true.  Retrieving the tempo at any point in time is a fairly quick process, but does involve a binary search of the tempo map.  Doing this for every note may have an adverse affect on engine performance, but then again, it might be fine on faster machines.

Not saying it's impossible, but it's not trivial.  That part of the code is pretty involved (even more so now that we have articulations).

My suggestion;

absolute_time_offset_for_MIDI_events.thumb.png.94b00b68065395c6ba8e6c6f378e4635.png

In the end any MIDI Event (at least when using VST3 plugins) are time-based positions. They are applied in a plugin at an absolute sample position, based on the current block position plus the sampleOffset field in VST3 Event struct. That sampleOffset field there itself cannot be used for negative offstes, since its only valid within the current blocksize; 

Some fine tuning afterwards is additionally required; Also some sort of marker in a clip should be set to have an easy indicator where the clip is located within the look-up table. This would additionally increase speed.

Edited by Sunshine Dreaming
  • Like 1
Link to comment
Share on other sites

I'm glad that more and more people are requesting this. :) And thank you Bakers for trying to make this feature available!

What makes me think it's possible is that many other DAWs, such as Cubase, Studio One, and even Reaper, have this feature, and they are all good to use.

I don't know how they implemented this feature. But maybe you can take them as references.

Many thanks.

 

Link to comment
Share on other sites

We've added a new feature to the new Sonar that will allow you to create Articulations that delay notes either positively or negatively ( +/- 1000 ) in either ms or ticks. You can also decide whether to include a note's end time in the delay, or retain its original end time.

Using articulations rather than a track-wide setting allows you much greater flexibility.   For example, orchestral strings with a slow attack playing legato could have a negative delay on the start time but when you switch to pizzicato, there is no delay.  You could even have different delay times for different octaves if required.

For simpler cases where you want everything on the track delayed, just draw the articulation over the whole track duration.

 

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

On 2/13/2024 at 12:51 AM, msmcleod said:

We've added a new feature to the new Sonar that will allow you to create Articulations that delay notes either positively or negatively ( +/- 1000 ) in either ms or ticks. You can also decide whether to include a note's end time in the delay, or retain its original end time.

Using articulations rather than a track-wide setting allows you much greater flexibility.   For example, orchestral strings with a slow attack playing legato could have a negative delay on the start time but when you switch to pizzicato, there is no delay.  You could even have different delay times for different octaves if required.

For simpler cases where you want everything on the track delayed, just draw the articulation over the whole track duration.

 

Thank you very much! We finally will get this feature in Cakewalk/Sonar! And I'm also excited for the great flexibility!

Could you please also consider adding a track-wide setting? That would be very useful for those who make orchestral templates. Many instruments just need a constant delay time. With track-wide delay setting, we can just add the delay in the templates and don't need to draw an articulation every time. (Drawing articulations in a template could make it messy)

Many thanks!

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 2/17/2024 at 3:25 AM, apt said:

Thank you very much! We finally will get this feature in Cakewalk/Sonar! And I'm also excited for the great flexibility!

Could you please also consider adding a track-wide setting? That would be very useful for those who make orchestral templates. Many instruments just need a constant delay time. With track-wide delay setting, we can just add the delay in the templates and don't need to draw an articulation every time. (Drawing articulations in a template could make it messy)

Many thanks!

I second that as a track-wide setting would make this type of workflow a lot smoother. The per articulation timing is fantastic, this would be icing on the cake.
There is quite the database of time offsets (actually they call is Negative Track Delay) already being managed here:

https://vi-control.net/community/threads/negative-track-delay-database-spreadsheet.105332/

Quote

We've added a new feature to the new Sonar that will allow you to create Articulations that delay notes either positively or negatively ( +/- 1000) in either ms or ticks. You can also decide whether to include a note's end time in the delay, or retain its original end time.

Using articulations rather than a track-wide setting allows you much greater flexibility.   For example, orchestral strings with a slow attack playing legato could have a negative delay on the start time but when you switch to pizzicato, there is no delay.  You could even have different delay times for different octaves if required.

For simpler cases where you want everything on the track delayed, just draw the articulation over the whole track duration.

@msmcleod, Great points, and I am still learning more about the use case of having a TRACK DELAY ARTICULATION, that is interesting.

Many of the composers in their templates have a track per articulation but the way you describe it is a nice way to address this.

Great work.
Joyfully,
Simeon 

Edited by Simeon Amburgey
Link to comment
Share on other sites

Yes, unfortunately Track templates won't save articulations because they're stored as MIDI events, and track content isn't saved in Track templates, but Project templates can save MIDI content, including articulations.

  • Great Idea 1
Link to comment
Share on other sites

and by renaming a project template (CWT) (or even the project CWP) as .CWX, you can load it... but i don't see any MIDI (or any audio either) coming through when importing it as a track template. maybe i'm missing a step in the process, but it seems like the MIDI (and audio) are stripped out during the track template loading process.

Link to comment
Share on other sites

6 minutes ago, Glenn Stanton said:

but it seems like the MIDI (and audio) are stripped out during the track template loading process.

More like excluded on Saving. Track templates are only setting routing data, not content.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...