-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When Jack is used, start / stop jack transport #4412
Conversation
This appears to not be building on mingw, which I believe is Windows. Do you maybe need a preprocessor directive to prevent your logic from compiling in when Jack isn't present? This is my best guess without actually inspecting your code. |
Yep, Travis is only failing on Windows. |
Awesome, looks like the build is fixed. I'll let someone with more knowledge of JACK decide if this is good to merge. |
As such the feature is pretty limited : it only starts and stops the jack transport when playback is started / stopped in LMMS. I think the next step would be to to also synchronize the play position when the song is stopped or the user skips to a random location in LMMS. IMHO the feature as is already provides significant value because it makes recording audio with jack clients a lot easier, which is an important use case that is not handled by LMMS itself. I'd like to go further and add support for the jack_transport_reposition API. If anyone could share some LMMS knowledge about how to fill in a jack_position_t struct from LMMS timing info it would be very helpful. I'm also struggling a bit to find a hook to tap into to detect when the play head position changed, I've considered Song::setPlayPos but it doesn't seem to be called when the play head skips, same for SampleTCO::playbackPositionChanged. Anybody knows what I could use? |
👍
I guess these functions will be useful: Lines 105 to 108 in 2f19fa1
Lines 124 to 140 in 2f19fa1
|
Thanks a lot! I'm still struggling to make the mapping, is a "Tact" the same as a "Bar"? I can't seem to find a way to get the current bar. |
Tact is the same as bar. And I really really really want this in lmms! |
Thanks, yeah me too but it's proving to be harder than I thought, care to help ? :) I've got this piece of code together to fill in the jack position struct: jack_position_t pos;
pos.valid = jack_position_bits_t::JackPositionBBT;
pos.bar = m_song->currentTact() + 1;
pos.beat = m_song->getBeat() + 1;
pos.tick = m_song->getBeatTicks() + 1;
pos.bar_start_tick = m_song->getTicks();
pos.beats_per_bar = m_song->getTimeSigModel().numeratorModel().value();
pos.beat_type = m_song->getTimeSigModel().denominatorModel().value();
pos.ticks_per_beat = m_song->getPlayPos().ticksPerBeat(m_song->getTimeSigModel());
pos.beats_per_minute = m_song->getTempo(); and then I do jack_transport_reposition(m_client, &pos); but Ardour will just go to around bar 1 and loop... Can you spot something obviously wrong in the mapping code? |
Ok stupid noob question. Did you check if those functions actually return the correct bbt values? |
Yes I did, the values seem to make sense:
|
I'm getting closer, I had forgotten to set the "frame" field in the jack position object. The sync is now almost working, I can skip in lmms and it skips to what seems to be the correct position in ardour. The problem is that I don't really know where to put this sync code. I think jack_transport_reposition should be called:
At the moment I have the sync code in I was hoping the Song::playbackPositionChanged signal would do the trick but it doesn't seem to be ever emitted... any ideas? |
As a workaround for not finding a suitable place to hook into to adjust the transport position, I'm only running the sync code when the song is stopped. It's not ideal but usable. |
I guess you may use JACK timebase callback for this purpose. Setting the callback notify JACK that LMMS is working as transport master. |
@djfm Are you willing to continue this pull request? If not, some of us can continue working on this. |
The new build failure is due to missing |
Can we use |
Was not able to compile:
Is this PR actual? Is it make sense to try "insert this" against (for example) LMMS stable code base? |
@firewall1110 It seems like you're missing Qt private headers for |
quote:"It will be nice if someone could create a PR against upstream, or I can do that no one is going to." P.S. This PR change only 6 files and time to manually apply this change to stable (this not download anything in configuration and "is stable" - not changing every week) may be the same as time to solve compilation problem |
@firewall1110 Have you read the instruction for getting submodules? |
I "solved" compilation problem by manual adapting code against master: I am an one step to "create a PR against upstream" ... But I do not see issue, that solves this code ... |
I "rebased" the changes on the current master here: |
It is good that @ycollet is about to work with this jackd integration with LMMS . P.S. |
Thanks for your answer :) |
LMMS with xjadeo now can be used (pmaster.patch.gz , and (I hope) Your "rebased" this PR version). P.S. |
This PR is not replaced yet ? jackd_sync.mp4I will wait about 10 days . After I will realize my plan myself ... |
Excellent, I will just say GO ! |
Thanks a lot for the update ! |
I just have opened PR #6066 so this should be closed ... |
Closing in favor of #6066. |
This allows lmms to function as a jack transport master.
Ideally there should be a switch to toggle between jack master / jack slave but this is already enough to do things like recording audio in ardour and have it sync'd with lmms easily.