Skip to content

Commit

Permalink
Fix handling of blank parameters, add note to README for Push 1 users
Browse files Browse the repository at this point in the history
  • Loading branch information
tomduncalf committed May 17, 2016
1 parent 20e582f commit 0b5bb0d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Common/UbermapLibs.py
Expand Up @@ -80,9 +80,9 @@ def load(self, name, subdir = None, log_enabled = True):
self._config_cache[name] = {}
self._config_cache[name]['mtime'] = mtime
self._config_cache[name]['config'] = config
except:
except Exception as e:
if log_enabled:
log.error('error parsing config: ' + path)
log.error('error parsing config: ' + path + " " + str(e))
return False

return UbermapConfigProxy(self, name, subdir, log_enabled)
Expand Down
9 changes: 7 additions & 2 deletions Devices/README.md
Expand Up @@ -16,6 +16,10 @@ To install, download the ZIP file from Github (https://github.com/tomduncalf/ube

I also recommend creating an Options.txt file for Live to set it to always auto populate plugin parameters regardless of the number, see below for further explanation - to do this, copy the included Options.txt file to ~/Library/Preferences/Ableton/Live 9.6.2b1/, or edit your existing file and add the line "-_PluginAutoPopulateThreshold=-1".

### Push 1 users

If you are a Push 1 user, you need to update the Ubermap config to specify that you are using Push 1. Open "<your user directory>/Ubermap/global.cfg" and change "Version = 2" under "[Push]" to "Version = 1".

At this point you can (re-)start Ableton and the script should be working.

### Installation Notes
Expand Down Expand Up @@ -62,7 +66,8 @@ Configuration files are formatted using something resembling the ini file format
InternalParamName2 = Display Name 2
[[Bank Name 2]]
InternalParamName3 = Display Name 3
"" = ""
_blank_0 = ""
_blank_1 = ""
InternalParamName4 = Display Name 4

[ParameterValues]
Expand All @@ -79,7 +84,7 @@ Configuration files are formatted using something resembling the ini file format

### Parameter Banks

All visible parameters will by default be exported into the [Banks] section, split into banks of 8. You can then go in and rename banks, move parameters between, rename parameters (changing the part after the "=" to set the display name for a parameter) and insert blank spaces on the display (achieved by adding a line with an empty mapping: "" = "").
All visible parameters will by default be exported into the [Banks] section, split into banks of 8. You can then go in and rename banks, move parameters between, rename parameters (changing the part after the "=" to set the display name for a parameter) and insert blank spaces on the display (achieved by adding a line with an empty mapping: `_blank_0 = ""` – note that the same key (left hand name) cannot occur twice in a section, so you need to use e.g. `_blank_1`, `_blank_2`, if you want multiple blank spaces within a single bank).

Note that in 9.5+, it seems that the "Best Of" bank (which used to be the bank shown on Push when you select a device but don't go "in" to view all parameters) has been done away with, and instead the first bank is shown when you select but don't go "in to" a plugin device. To replicate this functionality in 9.5, set your device configuration file up so that the first bank you define has the controllers you want quick access to without going "in" to the device (you could call this bank "Best Of" and replicate the parameters in later banks if you like).

Expand Down
1 change: 1 addition & 0 deletions Devices/UbermapDevices.py
Expand Up @@ -123,6 +123,7 @@ def get_parameter_by_name(device, nameMapping):
count = 0
for i in device.parameters:
if nameMapping[0] == str(count) + "_" + i.original_name or nameMapping[0] == i.original_name:
log.info("got " + nameMapping[1] + " for " + nameMapping[0])
i.custom_name = nameMapping[1]

[i.custom_parameter_values, i.custom_parameter_start_points] = get_custom_parameter_values(nameMapping[0])
Expand Down
17 changes: 11 additions & 6 deletions Devices/UbermapDevicesPatches.py
Expand Up @@ -97,17 +97,22 @@ def apply_device_component_patches():
# _get_provided_parameters - return Ubermap parameter names if defined, otherwise use the default
_get_provided_parameters_orig = DeviceComponent._get_provided_parameters

def _get_parameter_info(self, parameter):
if not parameter:
return None

if is_v1():
from Push.parameter_mapping_sensitivities import parameter_mapping_sensitivity, fine_grain_parameter_mapping_sensitivity
return ParameterInfo(parameter=parameter, name=parameter.custom_name, default_encoder_sensitivity=parameter_mapping_sensitivity(parameter), fine_grain_encoder_sensitivity=fine_grain_parameter_mapping_sensitivity(parameter))
else:
return ParameterInfo(parameter=parameter, name=parameter.custom_name, default_encoder_sensitivity=self.default_sensitivity(parameter), fine_grain_encoder_sensitivity=self.fine_sensitivity(parameter))

def _get_provided_parameters(self):
ubermap_params = ubermap.get_custom_device_params(self._decorated_device)

if ubermap_params:
param_bank = ubermap_params[self._bank.index]

if is_v1():
from Push.parameter_mapping_sensitivities import parameter_mapping_sensitivity, fine_grain_parameter_mapping_sensitivity
param_info = map(lambda parameter: ParameterInfo(parameter=parameter, name=parameter.custom_name, default_encoder_sensitivity=parameter_mapping_sensitivity(parameter), fine_grain_encoder_sensitivity=fine_grain_parameter_mapping_sensitivity(parameter)), param_bank)
else:
param_info = map(lambda parameter: ParameterInfo(parameter=parameter, name=parameter.custom_name, default_encoder_sensitivity=self.default_sensitivity(parameter), fine_grain_encoder_sensitivity=self.fine_sensitivity(parameter)), param_bank)
param_info = map(lambda parameter: _get_parameter_info(self, parameter), param_bank)
return param_info

orig_params = _get_provided_parameters_orig(self)
Expand Down

0 comments on commit 0b5bb0d

Please sign in to comment.