How To Repeat a Preset in MTP?

Hello,

Pretty much what the title says.

For context, I’m tasked with compiling chapters of books on a website into a single document. I managed to programmed so that instead of copy & pasting manually, I just press a single button and voila! the entire chapter is now in my word document in under a second.

The problem now is there’s upward of 6000 chapters and I might just go insane sitting here and pressing a button for that long even though that’s technically already miles faster than me doing everything manually.

Now that I have a preset that works, I’m wondering if I can program a function to perform the preset, wait say about 3000ms, then perform it again, and so on. I’d like to set it so it repeats 10 times so I can check if it copied properly. Then once I’m sure that works, increase the number to 50 at a time, and when I’m brave enough infinity. But I imagine there needs to be some way to stop the infinite repeat or some sort of fail-save.

And I’m here because I haven’t found a way to do that yet. Scouring through the net and manual, I think I have to make use of the Perform feature? but not quite sure so I figured it’s best to ask for help here.

Thanks!

You can use a timer to turn off and then back on a preset, but from what you describe you might want to use a timer to drive the Perform action of Bome MIDI Translator Pro v 1.9.0. I would have to look at your project file to get a sense of what changes to make.

You can use global variables to adjust the duration of the timer. If you are using an infinite timers, you then just start it again using the new global variable value after starting it again.

For infinite timers, you can always create a trigger that can kill them.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Book Copier.bmtp (3.8 KB)

Ah sorry, I should’ve uploaded my project file in the initial post.

I’ll give an overview of the purpose of each translator

0.0 - 0.2: Triple click (to highlight text on website)
0.3: Scroll down to bottom of page
0.4 - 0.6: Shift click (to highlight last line of chapter)
0.7 - 0.11: Maneuvers to copy the text and paste it into my word document.

Hopefully that gives you a sense of what it’s doing.

Does simply turning preset off and on execute all the translators within the preset? I’ve used the timer in the past, but I didn’t know if there was a way for it to execute all the translators.

Hi, please find the attached updated project file.

I create a new Preset ‘Init’ that does some house keeping chores and sets up enabling and disabling of the second preset.

  • Translator 0.0 executes Perform ‘Init’ when the project is opened.
  • Translator 0.1 does the same thing with a Cntrl-Up keystrok
  • Translator 0.2 Sets up some global variables in rule and then deactvates preset 1 if enabled.
  • Translator 0.3 Activated Preset 1 and Translator 0.4 Deactivates it

When Preset 1 is enabled, we start a timer ‘Book Copy’ at 1 second intervals.

When Preset 1 is disabled, we stop the timer ‘Book Copy’

Timer ‘Book Copy’, as it triggers, executes translator 1.2 which sets the sequence in motion with the Perform ‘Book Copy’ action.

The remainder of the translators use the same perform action to execute their given action with the necessary delay on output. I put Log entries in the rules of each translator.

I use the global variable zz in translator 0.2 to determine if we are in debug mode (Logging only) or regular mode (outgoing actions) are happening. I left it in debug mode for now. To change it to normal mode, set zz=0 in translator 0.2 and restart the project by whatever means you want. (Like Control Up)

I use a different MIDI message for start and stop but you can change them how you would like in translators 0.3 and 0.4

I also setup an alias for your MIDI in port as shown here.

image

You can learn more about aliases from this tutorial.

Of course, I did not test it because I don’t have your environment but I otherwise did not change the perform translators other than the rules, so if the one you sent is working, this should work as well.

Book Copier-sjc.bmtp (5.3 KB)

Good luck!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Ok can confirm that it works. That’s a neat trick! Didn’t know Activating/deactivating presets could work as incoming actions to trigger other outgoing.

1 Like

I’m glad it is working for you!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz