Skip to content
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

No phrase info trigger #140

Open
oligriffiths opened this issue Sep 13, 2022 · 4 comments
Open

No phrase info trigger #140

oligriffiths opened this issue Sep 13, 2022 · 4 comments

Comments

@oligriffiths
Copy link

oligriffiths commented Sep 13, 2022

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

@brunchboy
Copy link
Member

brunchboy commented Sep 13, 2022

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.

@oligriffiths
Copy link
Author

oligriffiths commented Sep 13, 2022 via email

@brunchboy
Copy link
Member

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
Copy link
Member

brunchboy commented Sep 24, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants