d00mfish / BPM-to-OSC

Simply sending the detected BPM to Resolume or any other LJ / VJ Software via OSC commands.
GNU General Public License v3.0
22 stars 0 forks source link

Tap #1

Closed grbfst closed 1 year ago

grbfst commented 1 year ago

As I am not able to compile (getting WX errors) would it be easy to also send a signal to the Tap button?

d00mfish commented 1 year ago

Sounds like it can be done. I even tried to send a signal to the tap-button on every beat but the problem is that it takes for ever to get to the new bpm at a tempo change. What are you trying to achieve with this that is different than the current method?

grbfst commented 1 year ago

It is a visual cue in Resolume for me since I cannot (at most times) see the GUI for BPMtoOSC (hidden behind Resolume.....)

Forgot to mention that I thoroughly enjoy this program :-)

would:

in main_gui.py:

def Read_LastSession_ini(self): """Reading / creating lastsession.ini """ try:

if no config found, create one with default values

         self.config.read(self.CONF_PATH)
         if self.config.sections() == []:
             self.config['OSC'] = {'IP': '127.000.000.001', 'PORT': 

7000, 'RESYNC_BAR_ADRESS':

'/composition/tempocontroller/resync', 'BPM_ADRESS': '/composition/tempocontroller/tempo', ++ 'TAP': '/composition/tempocontroller/tempotap'}

and in beatfinder.py:

SEND to osc and BOTH display if sync is on

                 self.parent.send_bpm = self.bpm

self.client.send_osc(self.parent.config['OSC']['BPM_ADRESS'], self.bpm, map_to_resolume=True) ++ self.client.send_osc(self.parent.config['OSC']['TAP'], 1, map_to_resolume=True) ++ self.client.send_osc(self.parent.config['OSC']['TAP'], 0, map_to_resolume=True) self.parent.update_bpm_display(self.bpm, send_to="both", Blink=True) self.parent.next_led()

work?

Leo schreef op 04-01-2023 18:08:

Sounds like it can be done. I even tried to send a signal to the tap-button on every beat but the problem is that it takes for ever to get to the new bpm at a tempo change. What are you trying to achieve with this that is different than the current method?

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you authored the thread.Message ID: @.***>

Links:

[1] https://github.com/d00mfish/BPMtoOSC/issues/1#issuecomment-1371194128 [2] https://github.com/notifications/unsubscribe-auth/AFU3VX3533JTAQ7GCYW3TKDWQWVCRANCNFSM6AAAAAATQY3J24

d00mfish commented 1 year ago

Glad, you like the program :)

The code would partly work. However there occurs this problem, that after a change in tempo, the bmp only change very slowly becase the new tempo is added to the average tap duration of the old tempo thus never resulting in the desired tempo change.

To prevent this, there must be a 1-2 second break in sending the tap signal for resolume to realize a new tempo is now tapped.

I personally find the beat-indicator (the little rotating square) enough as a visual cue. But if you want I can implement and compile it for you.

grbfst commented 1 year ago

(sorry, sent too early)

Ha, I totally forgot about the rotating square. Is a good visual cue indeed.

Still, it would be a nice addition, you could add an option in the program to "see" the beat with the tap.

What would happen if you did the following:

if beat is detected

if beat[0]: ++ self.client.send_osc(self.parent.config['OSC']['TAP'], 1, map_to_resolume=True) ++ self.client.send_osc(self.parent.config['OSC']['TAP'], 0, map_to_resolume=True)

This would send an osc message after each detected beat no? (with the added "'TAP': '/composition/tempocontroller/tempotap'" in main_gui.py)

Leo schreef op 05-01-2023 11:15:

Glad, you like the program :)

The code would partly work. However there occurs this problem, that after a change in tempo, the bmp only change very slowly becase the new tempo is added to the average tap duration of the old tempo thus never resulting in the desired tempo change.

To prevent this, there must be a 1-2 second break in sending the tap signal for resolume to realize a new tempo is now tapped.

I personally find the beat-indicator (the little rotating square) enough as a visual cue. But if you want I can implement and compile it for you.

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you authored the thread.Message ID: @.***>

Links:

[1] https://github.com/d00mfish/BPMtoOSC/issues/1#issuecomment-1372025865 [2] https://github.com/notifications/unsubscribe-auth/AFU3VX5IAPQ2SBFN2AV7NF3WQ2NN7ANCNFSM6AAAAAATQY3J24

grbfst commented 1 year ago

Also, small addition, The Resync button in Resolume stays on when the resync bar in the app is clicked. I think you should also send a /composition/tempocontroller/resync/0 when the button is pressed again or send the same after the button click.

d00mfish commented 1 year ago

Resync button is not active after pressed. It only has 'focus' wich is a feature that can not be turned of in wxpython. By pressing another button or tab it goes away though.

Also Like I said, you could do what you are suggesting. At a beat change it will take about one minute to reach the new BPM value though, as the tap-bpm are an average of multiple taps. And if the average-array has different bpm taps in it, it will be something in between.

Example-Array in seconds between taps with a tempo change in between: [0.5, 0.5, 0.5, | 0.3, 0.3, 0.3] -> Avg is 0.4 -> BPM is 150 instead of the new 200

Do you get what I mean? And to add a feature to detect tempo-change and pause the tapping for a second or two is possible but I dont really see the benefit compared to the current way of directly sending the bpm. But since it is opensource you can fork it and build it yourself.

If you need help with the wx errors, maybe I can help there. Had some myself, most important is to install Version 4.1.1