Hello all,
This is my first post on this forum. I searched the content for the same questions, but there were no other posts like my question.
Is it possible to make API calls for tapping BPM for a master BPM?
I know I can send API calls with static BPM tempo to set a BPM master. Because the variating music styles and the beats per minute is this feature not the best option.
When this feature is possible I can setup a Algato Stream Deck for side effects and BMP tapping.
If this post is not OK, please let me know!
Best wishes from a Dutch fan and user of Avolites!
R. Wijers
API Tap BPM (BPM tapping for master BPM's)
Moderator: Moderators
Re: API Tap BPM (BPM tapping for master BPM's)
Unfortunately no, at least not directly, the TapTempo function requires a DateTime timestamp which is not something that can be passed by WebAPI. An alternative is you can write a macro that performs the TapTempo press and then recall that macro using WebAPI. The macro could be hard-coded to a specific master or you write the macro to run on the context master:
The context master is normally only used in the Assign/Record master menu. It is possible to set it using the Masters.SetContext function however note that since the macro runs in the UI process instead of WebAPI process you would need to connect to the alternate HTTP port to set it:
http://localhost:4431/titan/script/2/Ma ... PMMaster:1
This will require enabling in the application config file.
Code: Select all
<macro id="Avolites.Macros.TapTempo.ContextMaster" name="Tap Tempo Context Master">
<description>Call Tap Tempo on the context (BPM) Master.</description>
<sequence>
<step>Masters.TapTempo(Masters.Context, Math.GetCurrentTimeStamp())</step>
</sequence>
</macro>
The context master is normally only used in the Assign/Record master menu. It is possible to set it using the Masters.SetContext function however note that since the macro runs in the UI process instead of WebAPI process you would need to connect to the alternate HTTP port to set it:
http://localhost:4431/titan/script/2/Ma ... PMMaster:1
This will require enabling in the application config file.
Re: API Tap BPM (BPM tapping for master BPM's)
Hi Gregory,
Sorry for the late reaction back.
Thank you for the information.
I have tried your solution, but the API request doesnt make it to the Titan software.
Maybe because i do the API request from the Streamdeck software?
I hope Avolites can program this option for simple BPM tap control from a website or hardware like Streamdeck.
Sorry for the late reaction back.
Thank you for the information.
I have tried your solution, but the API request doesnt make it to the Titan software.
Maybe because i do the API request from the Streamdeck software?
I hope Avolites can program this option for simple BPM tap control from a website or hardware like Streamdeck.
-
- Posts: 1122
- Joined: 02 Jul 2010, 10:29
- Location: Siegen, Germany
- Contact:
Re: API Tap BPM (BPM tapping for master BPM's)
Hi Mendex,
may I please elaborate on this (while Gregory is still lightyears ahead of me): what he said is that the tap function requires a DateTime object as argument which cannot be transferred via a http request. Instead you can simply use a macro to call a suitable tap function (DateTime is then run through the engine which is fine) and simply use another request to call this macro through web API. For starters, and - for the moment - without caring for the ContextMaster, you can simply trigger the factory macro 'Tap Tempo' with this web API call (even on the standard port 4430 without config changes):
http://localhost:4430/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapTempo
Just open Titan, program a chase, connect it, call this URL from your browser multiple times (F5 is your friend), and see the tempo changing.
Personally I'd rather use this method, maybe in conjunction with the special tap macros from the wiki: simply download and deploy the macros and change the macroId parameter in the request to something like this: "Avolites.Macros.TapBPM1"
http://localhost:4431/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapBPM1
However in order for this to work you need to edit the config file (as Gregory has mentioned), e.g. C:\Program Files\Avolites\Titan Mobile\Mobile.exe.config (if you use another Titan app then path and filename may differ):
Find the lines
and set the webapi.enabled value to true:
Then restart Titan. The web API is now also available on port 4431, and this - unlike the instance on 4430 which is treated as separate user - is directly connected to the Titan GUI. You can now run the a.m. command to call that user macro which taps the master as intended.
I'll have another look into this the next days, and will also try it with my Streamdeck (which is a nice idea btw.). But I can tell you that all this is possible right now. (and yes, some more info about this is about to be in the wiki too).
may I please elaborate on this (while Gregory is still lightyears ahead of me): what he said is that the tap function requires a DateTime object as argument which cannot be transferred via a http request. Instead you can simply use a macro to call a suitable tap function (DateTime is then run through the engine which is fine) and simply use another request to call this macro through web API. For starters, and - for the moment - without caring for the ContextMaster, you can simply trigger the factory macro 'Tap Tempo' with this web API call (even on the standard port 4430 without config changes):
http://localhost:4430/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapTempo
Just open Titan, program a chase, connect it, call this URL from your browser multiple times (F5 is your friend), and see the tempo changing.
Personally I'd rather use this method, maybe in conjunction with the special tap macros from the wiki: simply download and deploy the macros and change the macroId parameter in the request to something like this: "Avolites.Macros.TapBPM1"
http://localhost:4431/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapBPM1
However in order for this to work you need to edit the config file (as Gregory has mentioned), e.g. C:\Program Files\Avolites\Titan Mobile\Mobile.exe.config (if you use another Titan app then path and filename may differ):
Find the lines
Code: Select all
<!-- WebAPI -->
<add key="webapi.enabled" value="false" />
<add key="webapi.port" value="4431" />
and set the webapi.enabled value to true:
Code: Select all
<!-- WebAPI -->
<add key="webapi.enabled" value="true" />
<add key="webapi.port" value="4431" />
Then restart Titan. The web API is now also available on port 4431, and this - unlike the instance on 4430 which is treated as separate user - is directly connected to the Titan GUI. You can now run the a.m. command to call that user macro which taps the master as intended.
I'll have another look into this the next days, and will also try it with my Streamdeck (which is a nice idea btw.). But I can tell you that all this is possible right now. (and yes, some more info about this is about to be in the wiki too).
-
- Posts: 1122
- Joined: 02 Jul 2010, 10:29
- Location: Siegen, Germany
- Contact:
Re: API Tap BPM (BPM tapping for master BPM's)
After successfully testing this with my Streamdeck myself and after sorting out some questions with Gregory (again, thank you sooo much) here are some more hints; essentially everything runs as already described, but these are some more details.
So taking all this into account:
Calling custom macros from webAPI on port 4430 would require another quirk which I'll also put in the wiki occasionally (and again, thanks to Gregory for pointing this out and giving a solution). But as you need the api tied to your GUI on port 4431 anyway, there is no harm to avoid the additional effort and use this port for all the other calls.
I hope this helps.
- I would strongly suggest to systematically change the config setting and put the macro file into its folder (Documents\Titan\Macros), only then restart Titan, and then proceed with everything else; this way you can be sure that everything is ready to run as expected.
- Gregory's call http://localhost:4431/titan/script/2/Masters/SetContext?context=BPMMaster:1 works perfectly fine - for BPM Master 2 (the property index is 0-based, see the Handle column in this link). Thus, in order to see a result, either create BPM Master 2 in Titan, or change the call to ...context=BPMMaster:0.
- I successfully tried this with my Streamdeck. In order to do so I used Companion with the generic http connection module (see attached screenshot). With this, you simply add the full url string including the port, and port 4431 (or any other, I suppose) is no problem.
- Maybe there are other implementaions for the streamdeck as well but at the moment I am only aware of the companion module "Avolites Titan" by Jonas Nijs. So far, port 4430 is hardcoded in there (see the GitHub repo). But then, there is no Tap button at all in it at the moment. You are welcome to put in the feature request, or even add it yourself.
So taking all this into account:
- either use the designated Tap BPM macros from the wiki and call them with a request like http://localhost:4431/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapBPM1
- or set the context master with http://localhost:4431/titan/script/2/Masters/SetContext?context=BPMMaster:0 and then call the macro Gregory suggested (above) with http://localhost:4431/titan/script/2/Macros/Run?macroId=Avolites.Macros.TapTempo.ContextMaster
Calling custom macros from webAPI on port 4430 would require another quirk which I'll also put in the wiki occasionally (and again, thanks to Gregory for pointing this out and giving a solution). But as you need the api tied to your GUI on port 4431 anyway, there is no harm to avoid the additional effort and use this port for all the other calls.
I hope this helps.
- Attachments
-
- Screenshot: Companion http connection
- comp_http.png (93.2 KiB) Viewed 11678 times
-
- Posts: 1122
- Joined: 02 Jul 2010, 10:29
- Location: Siegen, Germany
- Contact:
Re: API Tap BPM (BPM tapping for master BPM's)
And finally there is a waaaaaaaay easier solution if you only want to make your streamdeck buttons control tap: sACN triggers.
Strictly this belongs into another section in this forum. And thank you for starting this thread. Of course there are many actions which cannot be done with triggers, other cannot be done with webAPI. But this one in particular can be done using either way. Pick what you want.
- instead of http use the sACN connection module in companion and define a few buttons/channels
- in Titan deploy the macros you want to use on some buttons
- make sure sACN from companion reaches Titan (same machine or network, firewalls etc.)
- then define some triggers in Titan (they need to be hardware triggers, trigger source is of course sACN)
Strictly this belongs into another section in this forum. And thank you for starting this thread. Of course there are many actions which cannot be done with triggers, other cannot be done with webAPI. But this one in particular can be done using either way. Pick what you want.
Re: API Tap BPM (BPM tapping for master BPM's)
Hi icke_siegen,
Thank you for these possibilities. After the "4 days marches" (Nijmegen) in the Netherlands i will try them.
Thank you for these possibilities. After the "4 days marches" (Nijmegen) in the Netherlands i will try them.
Who is online
Users browsing this forum: No registered users and 1 guest