ldrolez / clyphx-live11

ClyphX advanced macros and scripting for Ableton Live 12, 11 and 10
GNU Lesser General Public License v3.0
202 stars 19 forks source link

CLIP NOTES actions crash if invalid note name is specified #51

Open light2peter opened 10 months ago

light2peter commented 10 months ago

For example, running "1/CLIP NOTESON" crashed clyphx [and disabled it for the whole track]. Instead, it should just return silently.

I believe the cause is that get_note_name_from_string can return None, but get_note_range doesn't handle that case.

https://github.com/ldrolez/clyphx-live11/blob/6f61d170f0f055e6d3033314a5a53271c8ef09af/ClyphX/ClyphXClipActions.py#L911C1-L914C1

https://github.com/ldrolez/clyphx-live11/blob/6f61d170f0f055e6d3033314a5a53271c8ef09af/ClyphX/ClyphXClipActions.py#L941C1-L950C22

2024-01-04T21:59:44.656610: info: Python: INFO:_Framework.ControlSurface:655 - LOG: (ClyphX) get_xclip_action_list returning 1/CLIP NOTESON
2024-01-04T21:59:44.656628: info: RemoteScriptMessage: (ClyphX) get_xclip_action_list returning 1/CLIP NOTESON
2024-01-04T21:59:44.656704: info: Python: INFO:_Framework.ControlSurface:655 - LOG: (ClyphX) replace_user_variables returning 1/CLIP NOTESON
2024-01-04T21:59:44.656720: info: RemoteScriptMessage: (ClyphX) replace_user_variables returning 1/CLIP NOTESON
2024-01-04T21:59:44.656893: info: Python: INFO:_Framework.ControlSurface:655 - LOG: (ClyphX) get_track_to_operate_on returning result_tracks=[1-Operator] and result_name=CLIP NOTESON
2024-01-04T21:59:44.656912: info: RemoteScriptMessage: (ClyphX) get_track_to_operate_on returning result_tracks=[1-Operator] and result_name=CLIP NOTESON
2024-01-04T21:59:44.656989: info: Python: INFO:_Framework.ControlSurface:655 - LOG: (ClyphX) format_action_name returning, track(s)=[1-Operator] and action=CLIP and args=NOTESON
2024-01-04T21:59:44.657006: info: RemoteScriptMessage: (ClyphX) format_action_name returning, track(s)=[1-Operator] and action=CLIP and args=NOTESON
2024-01-04T21:59:44.657167: info: Python: INFO:_Framework.ControlSurface:657 - LOG: (ClyphX) get_clip_to_operate_on returning clip= and clip args=NOTESON
2024-01-04T21:59:44.657190: info: RemoteScriptMessage: (ClyphX) get_clip_to_operate_on returning clip= and clip args=NOTESON
2024-01-04T21:59:44.657310: info: Python: INFO:_Framework.ControlSurface:657 - LOG: (ClyphX) Error when executing task
2024-01-04T21:59:44.657327: info: RemoteScriptMessage: (ClyphX) Error when executing task
2024-01-04T21:59:44.657370: info: RemoteScriptError: Traceback (most recent call last):

2024-01-04T21:59:44.657414: info: RemoteScriptError:   File "c:\Jenkins\live\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\Task.py", line 230, in do_update

2024-01-04T21:59:44.657578: info: RemoteScriptError:   File "c:\Jenkins\live\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\Task.py", line 51, in update

2024-01-04T21:59:44.657680: info: RemoteScriptError:   File "c:\Jenkins\live\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\Task.py", line 146, in do_update

2024-01-04T21:59:44.657777: info: RemoteScriptError:   File "c:\Jenkins\live\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\ControlSurfaceComponent.py", line 196, in wrapper

2024-01-04T21:59:44.657954: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphXTriggers.py", line 250, in on_timer

2024-01-04T21:59:44.670039: info: RemoteScriptError:     self._parent.handle_action_list_trigger(self._track, clip)

2024-01-04T21:59:44.670105: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphX.py", line 256, in handle_action_list_trigger

2024-01-04T21:59:44.680363: info: RemoteScriptError:     self.action_dispatch(action['track'], xtrigger, action['action'], action['args'], ident)

2024-01-04T21:59:44.680419: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphX.py", line 168, in action_dispatch

2024-01-04T21:59:44.680527: info: RemoteScriptError:     self._clip_actions.do_clip_note_action(clip_action[0], t, xclip, ident, args)

2024-01-04T21:59:44.680574: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphXClipActions.py", line 604, in do_clip_note_action

2024-01-04T21:59:44.686258: info: RemoteScriptError:     note_data = self.get_notes_to_operate_on(clip, args.strip())

2024-01-04T21:59:44.686305: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphXClipActions.py", line 885, in get_notes_to_operate_on

2024-01-04T21:59:44.686397: info: RemoteScriptError:     note_range = self.get_note_range(new_args[0])

2024-01-04T21:59:44.686435: info: RemoteScriptError:   File "C:\Users\light\Documents\Ableton\User Library\Remote Scripts\ClyphX\ClyphXClipActions.py", line 926, in get_note_range

2024-01-04T21:59:44.686513: info: RemoteScriptError:     note_range = (start_note_num, start_note_num + 1)

2024-01-04T21:59:44.686556: info: RemoteScriptError: TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'