Skip to content

Commit

Permalink
refactor: remove Live 8 snap actions
Browse files Browse the repository at this point in the history
chore: add error check to symlink script
refactor: command handler skeleton
refactor: user settings decoupling
chore: add parsing tests
chore: split dev tools into another repo
  • Loading branch information
nuno-andre committed Feb 8, 2021
1 parent 58e8508 commit c8405f8
Show file tree
Hide file tree
Showing 305 changed files with 49,216 additions and 2,403 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.pytest_cache/
__pycache__/
vendor/
tests/
.mypy_cache/
vendor/**
.bin/
.env
*.msi
.vscode/settings.json
!vendor/typing.py
6 changes: 6 additions & 0 deletions .vscode/.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
"editor.insertSpaces": true,
"editor.unusualLineTerminators": "auto",
"python.disableInstallationCheck": true,
"python.analysis.useLibraryCodeForTypes": true,
"search.exclude": {
"**/.bin": true,
"**/.git": true,
"**/.mypy_cache": true,
"**/.pytest_cache": true,
"**/vendor": true
},
"[python]": {
Expand All @@ -33,6 +36,9 @@
"files.eol": "\r\n"
},
"[markdown]": {
"editor.rulers": [
80
],
"files.trimTrailingWhitespace": false
},
"[git-commit]": {
Expand Down
32 changes: 12 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
# Contributing to ClyphX

## Vendorized packages

## Installing development environment
| package | version | description |
| ----------------- | ------- | ----------- |
| [`python-future`] | 0.18.2 | Compability layer between Python 2.7 and Python 3 |
| [`typing`] | 3.7.4.3 | Backport of the `typing` built-in module for Python 2.7 |

### Windows
[`python-future`]: https://github.com/PythonCharmers/python-future
[`typing`]: https://github.com/python/typing

```powershell
PS> git clone https://github.com/nuno-andre/clyphx.git
PS> cd clyphx
PS> . .\tools\win.ps1; install-runtime
PS> python3 .\tools\vscode.py
PS> install-dev-script
```

## VSCode

## Vendorized libs

| package | version | description |
| ------- | ------- | ----------- |
| [`python-future`](https://github.com/PythonCharmers/python-future) | 0.18.2 | Compability layer between Python 2.7 and Python 3 |


## VSCode tasks
### VSCode

<kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>P</kbd> &rarr; _Tasks: Run tasks_

| task | description |
| ---- | ----------- |
| task | description |
| ---------------- | ----------- |
| `(re)start Live` | Restart Live, or start it if closed.
| `open Log.txt` | Open `Log.txt` with the default application for txt files.
| `open Log.txt` | Open Live's `Log.txt` with the system default application for txt files.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# ClyphX
ClyphX
======

**ClyphX** is a _MIDI Remote Script_ for Ableton Live 9.6+ or 10.x that provides an extensive list of Actions related to controlling different aspects of Live. These Actions can be accessed via X-Triggers (Session View Clips, Arrange View Locators or MIDI Controls). Each X-Trigger can trigger either a single Action or a list of Actions.
**ClyphX** is a _MIDI Remote Script_ for Ableton Live 9.6+ or 10.x that provides
an extensive list of Actions related to controlling different aspects of Live.
These Actions can be accessed via X-Triggers (Session View Clips, Arrange View
Locators or MIDI Controls). Each X-Trigger can trigger either a single Action
or a list of Actions.

As an example, a simple Action might be `OVER`, which will toggle _Overdub_ on/off. A more complex Action List might mute _Tracks 1 - 2_, unmute and arm _Track 4_, turn the 2nd Device on _Track 4_ on and launch the selected Clip on _Track 4_: `1/MUTE ON; 2/MUTE ON; 4/MUTE OFF; 4/ARM ON; 4/DEV2 ON; 4/PLAY`
As an example, a simple Action might be `OVER`, which will toggle _Overdub_
on/off. A more complex Action List might mute _Tracks 1 - 2_, unmute and arm
_Track 4_, turn the 2nd Device on _Track 4_ on and launch the selected Clip on
_Track 4_: `1/MUTE ON; 2/MUTE ON; 4/MUTE OFF; 4/ARM ON; 4/DEV2 ON; 4/PLAY`

**ClyphX** also includes a component called **Macrobat** that adds new functionality to Racks in Live such as the ability to control Track mixer parameters or send MIDI messages from Rack Macros.
**ClyphX** also includes a component called **Macrobat** that adds new
functionality to Racks in Live such as the ability to control Track mixer
parameters or send MIDI messages from Rack Macros.

**ClyphX** also includes extra preference options for changing some of Live's default behaviors such as the ability to choose to have Track's automatically Arm upon selection.
**ClyphX** also includes extra preference options for changing some of Live's
default behaviors such as the ability to choose to have Track's automatically
Arm upon selection.

> This is a fork of ClyphX 2.6.2, which is licensed under the [GNU LGPL][lic] and is [no longer being developed, updated or supported][note].
> This is a fork of ClyphX 2.6.2, which is licensed under the [GNU LGPL][lic]
> and is [no longer being developed, updated or supported][note].
[lic]: https://spdx.org/licenses/LGPL-2.1-or-later.html "GNU LGPL 2.1 or later"
[note]: https://forum.nativekontrol.com/thread/992/current-version-clyphx-live-9 "nativeKONTROL Forum"
[note]: https://forum.nativekontrol.com/thread/992/current-version-clyphx-live-9
"nativeKONTROL Forum"

---
Copyright &copy; 2013-2017 Sam "Stray" Hurley <<[email protected]>>
Expand Down
40 changes: 34 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
[metadata]
name = ClyphX
version = attr: clyphx.__version__
license_files = COPYING; COPYING.LESSER
long_description = file: README.md
long_description_content_type = text/markdown

[mypy]
python_version = 2.7
allow_redefinition = true
check_untyped_defs = true
ignore_missing_imports = true
implicit_reexport = true
local_partial_types = true
strict_optional = true
strict_equality = false
no_implicit_optional = false
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unreachable = true
warn_no_return = false


[flake8]
# See https://flake8.pycqa.org/en/latest/user/configuration.html
ignore =
E221, # multiple spaces before operator
E241, # multiple spaces after ':'
E303, # too many blank lines (2)
W503, # line break before binary operator
exclude =
.git,
__pycache__,
.pytest_cache,
max-complexity = 18 # ClyphX.handle_action_list_trigger()

[tool:brunette]
line-length = 99
verbose = true
single-quotes = true
max-line-length = 99
per-file-ignores =
**/__init__.py: E402, F401,
inline-quotes = '
multiline-quotes = '''
docstring-quotes = '''
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ def install():
copytree(HERE / 'src/clyphx', path)


if __name__ == '__main__':
install()
# if __name__ == '__main__':
# install()
52 changes: 25 additions & 27 deletions src/clyphx/UserSettings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with ClyphX. If not, see <https://www.gnu.org/licenses/>.



***************************** [SETTINGS NOTES] **************************


# Please DO NOT change any of the spacing in this file.
# Please DO NOT change the name of this file or its file extension. When done
# Please DO NOT change any of the spacing in this file.

# Please DO NOT change the name of this file or its file extension. When done
# making your changes to the settings below, just save the file.
# After saving this file, you will need to restart Live for your changes

# After saving this file, you will need to restart Live for your changes
# to take effect.

# For Windows 7/Vista users, depending on how your privileges are set up, you
# may not be able to save changes you make to this file. You may receive an
# error such as Access Denied when trying to save. If this occurs, you will
Expand All @@ -51,7 +51,7 @@ INCLUDE_NESTED_DEVICES_IN_SNAPSHOTS = On
SNAPSHOT_PARAMETER_LIMIT = 500
# Setting:
# Any whole number

# Description:
# Determines the number of parameters that Snapshots will be allowed to store.
# If the limit is exceeded, you'll receive an error message.
Expand Down Expand Up @@ -98,21 +98,21 @@ EXCLUSIVE_ARM_ON_SELECT = Off
# On or Off

# Description:
# Upon selecting Tracks, if the selected Track can be armed, it will be armed
# Upon selecting Tracks, if the selected Track can be armed, it will be armed
# and any other armed Tracks will be disarmed.

# Note:
# This function may produce undesirable results if Select On Launch is on
# in your Live preferences.



EXCLUSIVE_SHOW_GROUP_ON_SELECT = Off
# Setting:
# On or Off

# Description:
# Upon selecting Tracks, if the selected Track is a Group Track, it will be
# Upon selecting Tracks, if the selected Track is a Group Track, it will be
# unfolded and any other Group Tracks will be folded.

# Note:
Expand All @@ -126,13 +126,13 @@ CLIP_RECORD_LENGTH_SET_BY_GLOBAL_QUANTIZATION = Off
# On or Off

# Description:
# This changes the behavior of launching the selected Clip Slot so that
# This changes the behavior of launching the selected Clip Slot so that
# (under the Conditions listed below) you can easily record a new Clip with a
# length defined by the Global Quantization value. This will do nothing if the
# Conditions below aren't met.

# Conditions:
# - Selected Track is armed
# - Selected Track is armed
# - Selected Clip Slot has no Clip on it
# - Global Quantization is not set to None

Expand All @@ -156,17 +156,15 @@ DEFAULT_INSERTED_MIDI_CLIP_LENGTH = 0


# CsLinker allows you to link the grid selectors (colored borders around clips)
# of two Control Surfaces either horizontally or vertically.
# of two Control Surfaces either horizontally or vertically.

# The Control Surface script names to use are as shown in Live's Control Surface
# chooser. If a Control Surface's name has a space in it (like MXT Live), you
# chooser. If a Control Surface's name has a space in it (like MXT Live), you
# should use an underscore in place of the space (like MXT_Live).

# Note, Push and Push2 cannot be used for matched linking. Additionally,
# Note, Push and Push2 cannot be used for matched linking. Additionally,
# horizontal linking with Push2 may produce undesirable results due to Push2's
# inclusion of Chain mixer settings along side normal Track mixer settings.

# You can also omit 'CSLINKER_' in props names, e.g.: MATCHED_LINK
# inclusion of Chain mixer settings along side normal Track mixer settings.


CSLINKER_MATCHED_LINK = False
Expand Down Expand Up @@ -218,16 +216,16 @@ CSLINKER_SCRIPT_2_NAME = None



******************************* [USER CONTROLS] *******************************
******************************* [USER CONTROLS] *******************************


# Below, you can specify a list of MIDI Controls to use as X-Controls.
# Below, you can specify a list of MIDI Controls to use as X-Controls.

# The entry format is:
# CONTROL_NAME = MSG_TYPE, MIDI_CHANNEL, NOTE_OR_CC_NUM, ON_ACTION_LIST

# CONTROL_NAME = A unique one-word name (Identifier) for the control.
# See [IDENTIFIER NOTE] below.
# See [IDENTIFIER NOTE] below.
# MSG_TYPE = The word Note or CC.
# MIDI_CHANNEL = The MIDI Channel number in the range of 1 - 16
# NOTE_OR_CC = The Note or CC number in the range of 0 - 127.
Expand All @@ -243,7 +241,7 @@ CSLINKER_SCRIPT_2_NAME = None
# Example: MY_BTN2 = CC, 16, 117, 1/MUTE ; 2/MUTE, 3/PLAY >

# To perform the same Action List for the On Action List and Off Action List,
# just specify an asterisk for the Off Action List.
# just specify an asterisk for the Off Action List.

# Example: MY_BTN3 = NOTE, 5, 0, 1/MUTE, *

Expand All @@ -259,17 +257,17 @@ CSLINKER_SCRIPT_2_NAME = None
#>>>>>>>>DELETE THIS ENTIRE LINE AND START YOUR LIST HERE<<<<<<<<#


******************************* [USER VARIABLES] *******************************
******************************* [USER VARIABLES] *******************************


# Below, you can specify a list of Variables to use in your Action Lists.

# The entry format is: VARIABLE_NAME = VALUE

# VARIABLE_NAME = A unique one-word name (Identifier) for the variable.
# See [IDENTIFIER NOTE] below.
# See [IDENTIFIER NOTE] below.
# VALUE = Any value or word or combination of words. See the User Variables
# section of the manual for more info on this.
# section of the manual for more info on this.

# The Variables listed below are just examples and can be removed.

Expand All @@ -282,6 +280,6 @@ ex_var2 = mute


# Identifiers and Variable names should not contain characters other than
# letters, numbers and underscores.
# letters, numbers and underscores.

# Also, Variable names and their values are not case-sensitive.
17 changes: 14 additions & 3 deletions src/clyphx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,31 @@
# You should have received a copy of the GNU Lesser General Public License
# along with ClyphX. If not, see <https://www.gnu.org/licenses/>.

# from __future__ import absolute_import, unicode_literals
from __future__ import absolute_import, unicode_literals
__version__ = 2, 7, 2

import sys
import os

base = os.path.dirname(os.path.realpath(__file__))
vendor = os.path.join(base, 'vendor', 'future')
sys.path.insert(0, vendor)
sys.path.insert(0, os.path.join(base, 'vendor')) # type: ignore
sys.path.insert(0, os.path.join(base, 'vendor', 'future')) # type: ignore

from future import standard_library
standard_library.install_aliases()

import Live
from .clyphx import ClyphX

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Any


def create_instance(c_instance):
# type: (Any) -> ClyphX
'''
:param c_instance: A MidiRemoteScript object that is used to
communicate with the C++ core of Ableton Live.
'''
return ClyphX(c_instance)
25 changes: 0 additions & 25 deletions src/clyphx/action_list.py

This file was deleted.

Loading

0 comments on commit c8405f8

Please sign in to comment.