User Submitted CoyoteScript

Virtual CC Sender

Author: Sander

Script Version: 1

Minimum CoyoteMIDI Build: 664

This script lets you manipulate virtual CC controllers, tracking their CC values and letting you increase or decrease them from translations.

This script adds the following translation parameters:
CC: The CC number to manipulate the value of.
Direction: The direction to change the CC value in. Up will increase the CC value, and Down will decrease it.
Amount: The amount to change the CC value with.
				
					// Get the CC we want to manipulate
$cc = ($parameters CC)
// Make sure this CC has a value in the map of CCs this script is manipulating
if %virtual_cc_manipulator_values !contains $cc
    %virtual_cc_manipulator_values $cc = 0
// Get the last set value for this CC
$value = (%virtual_cc_manipulator_values $cc)
// Get the direction we want to move the CC in
$direction = ($parameters direction)
// Get the amount we want to move the CC with
$amount = ($parameters amount)
// If the direction is up, increase the value
if $direction == Up
    $value = (min 127 ($value + $amount))
// If the direction is down, decrease the value
else if $direction == Down && $value > 0
    $value = (max 0 ($value - $amount))
// Update the last set value to the map
%virtual_cc_manipulator_values $cc = $value
// Send the MIDI event to the MIDI out devices
midi controlchange $cc $value

// Declare the map holding the virtual CC values
event scriptsloaded
    %virtual_cc_manipulator_values new map
// Register the input fields to be shown in a translation using the script
event uirefreshed
    translationparameter CC (numberbox "CC" "The CC number to change the value of." 1 default false 0 127 1)
    translationparameter direction (combobox Direction "The direction to move the CC value in." Up,Down Up 0.5)
    translationparameter amount (numberbox "Amount" "The amount to increase or decrease the CC value with." 1 default false 0 127 1)
				
			

2 downloads