beat-link-trigger icon indicating copy to clipboard operation
beat-link-trigger copied to clipboard

No phrase info trigger

Open oligriffiths opened this issue 3 years ago • 4 comments

Describe the issue When a track has no phrase information embedded in it, there is no way to trigger on this use case. This would be useful so that when a track with no phrase info is played, an alternative trigger can be executed and a different lighting preset can be selected.

Solution Provide an option in the show phrase trigger menu to allow for "No phrase info" or similar to be used as the trigger. This would be activated when a track is loaded with no phrase info.

Describe alternatives you've considered As far as I can tell this isn't possible right now and there are no alternatives

Current Beat Link Trigger Version 7.0.1

Additional context None

oligriffiths avatar Sep 13 '22 01:09 oligriffiths

Hmm, this is a kind of interesting idea. I think the cleanest way to integrate it would be to have “unanalyzed track” be one of the Phrase Types you could choose in the Phrase Types filter for a phrase trigger. If you chose only that, of course, the Track Banks button would be grayed out and meaningless. Or maybe Track Banks would just be ignored when an unanalyzed track trigger was matched. That UX interaction would require a bit of thought.

The tricky part would be, how would you define where the pseudo-phrase began? On the first beat of the track? The first down beat? And where would it end? The final beat? The final down beat? Probably the most consistent would be to have the simulated phrase start on the track’s first beat, but keep the trigger’s down beats aligned with the tracks, just as happens when an analyzed phrase does not begin on a down bet. If you want to try implementing this I would definitely take a look at it and review a pull request.

If you don’t need to paint cues in the “phrase” sections like a normal phrase trigger, and just want to send events when such a track starts or stops playing, you could do it with the existing release of BLT by using an ordinary (non-phrase) trigger to implement it, configuring a custom enabled filter expression that uses the AnalysisTagListener to make sure it is enabled only for tracks that have no phrase analysis tag. If you’d like help implementing this simpler approach, ask on the Zulip chat and if nobody else has chimed in by the time I get back from traveling to catch Odesza’s tour, I can take a stab at a proof-of-concept implementation. It might make another nice integration example for the user guide.

brunchboy avatar Sep 13 '22 05:09 brunchboy

Thanks for the prompt reply.

I only recently started working with BLT (it is awesome thank you for all the hard work figuring this out), as such I am not familiar with custom expressions and clojure etc, I don’t think I’m in a position to be able to submit a pull request either.

I’ll defer to your guidance on if this is possible to achieve without any code updates in the short term, but as you suggest having an option in the phrase types dialog would make most sense I think (or something in the context menu), that way it can sit alongside the other phrase triggers. I assume this would also be possible with the custom scripting options I just don’t know how to do that.

More than happy to help test this. I have a pioneer xdj-xz and have it working perfectly with BLT and triggering different lighting effects based on phrase triggers, really cool stuff.

Many thanks

Oli

oligriffiths avatar Sep 13 '22 14:09 oligriffiths

I think I have found a practical approach for implementing this, but it is going to require some subtle, intricate, and careful coding. The biggest problem is that there is no way to create a fake phrase object without actual data from a player describing it. But the code in beat-link-trigger.show-phrases/update-running-phrase-triggers looks like it can be tweaked to allow a nil value for new-phrase to still check for eligible phrase triggers, using the default phrase type and track bank values to run an alternate version of trigger-context that uses the first and last beats of the track as well as the default phrase type and bank. The various functions that get called lower down will need to be examined to make sure they work properly with nil phrase objects, but the simulated context looks like a plausible solution.

This would not allow changes to the defaults to have an effect until a different track loads, but that could just be documented as a limitation.

This will require at least a focused weekend of work, so I am not stating it tonight. In the mean time, we have found a reasonable workaround as described on Zulip. If I decide that the approach outlined in this comment is too complicated or risky, I will just write up that approach as an integration example instead.

brunchboy avatar Sep 21 '22 02:09 brunchboy

There are additional complications. The expression code is supposed to be given the SongStructureEntry associated with the phrase, and none will exist for defaulted phrases. This can be warned about in the documentation, I suppose. But the code in editors/show-bindings-for-phrase that grabs track-bank and phrase-type will need to be enhanced to look for the defaults for the current show (if there is even a way to get a handle on the show) when those values are nil because the structures they are accessing now look at the actual values maintained across all shows, and thus these cannot provide any insight into defaults that have been set up in a single show.

brunchboy avatar Sep 24 '22 23:09 brunchboy