Comments (4)
Yes. The duration of a beat corresponds to the one of a quarter note. If you're dealing with different signatures check out the section about Phase Synchronisation in Link's documentation.
from linkkit.
Thanks, although that does bring me to my next question ...
I'm using the current time signature's 'beats per bar' to determine the quantum. However, when the 'beats per bar' changes (as a result of a user interaction, or due to an event in the sequence), the beat time returned by LinkKit becomes discontinuous, and the timeline jumps to a different position. I've worked around this by adding a compensation offset when a quantum change occurs, as follows:
// Has the quantum changed since the last call?
if (mQuantum != zQuantum)
{
// Calculate the beat time using both the old and the new quantum
f64 OldQuantumBeat = ABLLinkBeatAtTime(mpCapturedTimeline, HostTime, mQuantum);
f64 NewQuantumBeat = ABLLinkBeatAtTime(mpCapturedTimeline, HostTime, zQuantum);
// The difference between the two returned beat times must be added as an offset in all future calls
// to prevent a timeline discontinuity
mBeatOffset += (OldQuantumBeat - NewQuantumBeat);
// This is now the new quantum
mQuantum = zQuantum;
}
// Return the beat time, adding our offset to prevent discontinuities when the quantum changes
return ABLLinkBeatAtTime(mpCapturedTimeline, HostTime, mQuantum) + mBeatOffset;
This seems to work, and the app's bar start (phase) still seems to align with the connected peers when the quanta are a multiple of each other but it still feels like a workaround. Have I handled this correctly?
from linkkit.
Yes. The beat time will be discontinuous when changing the quantum. For Ableton Live we're taking an alternative approach on handling this. We're saving the quantum when starting transport and use this for alignment with Link until transport is stopped. When transport is started again we update the quantum.
from linkkit.
OK. This is the same alternative approach I thought of last night, so I think I might change it!
Thanks once again for your help.
from linkkit.
Related Issues (20)
- Crash when attempting to enable or disable Link, possible race condition? HOT 7
- Ver 3.0.2 presenting viewcontroller audio dropouts HOT 4
- Crashes when calling ABLLinkDelete because layoutMargins observer is not removed in ABLSettingsViewController.mm. HOT 4
- Are the hostTimeAtOutput argument of the ABLLinkSetTempo method has any restrictions? HOT 2
- Polyrhythm HOT 5
- LinkKit for Catalyst/UIKitForMac HOT 18
- Localization Support HOT 7
- Support for Scenes on iPad OS HOT 3
- [3.1.0] Tempo callback not called if new tempo matches old tempo HOT 2
- iOS 14 Unexpected Behavior HOT 26
- Compiling against iOS 12 SDK βΒ does not find devices on local network HOT 6
- Cocoapod or SPM support HOT 1
- ARM Mac - Cannot link when building with LinkKit to target (ARM based...) iOS Emulator HOT 23
- Apple Privacy HOT 1
- WatchOS build HOT 12
- are Callbacks from Link guaranteed to execute in specific order? HOT 6
- Minor header documentation error, causing build warnings HOT 2
- Crashes in ABLLinkNew() on older iPad HOT 4
- Latest release not compatible with Xcode 14 HOT 5
- Update to Xcode 14 new error: libABLLink.a building for iOS, but linking in object file built for iOS Simulator ..."architecture arm64" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linkkit.