This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
examples:pangoscript [2025/04/17 18:05] Lyra Letournea |
examples:pangoscript [2025/04/17 18:11] (current) Lyra Letournea [Examples from Users] |
||
---|---|---|---|
Line 80: | Line 80: | ||
===== Examples from Users ===== | ===== Examples from Users ===== | ||
- | The following examples are from the userbase, at the permission of the users. | + | The following examples are from the userbase, at the permission of the users. Scripts many not have been validated by pangolin internally, and opinions expressed, and explanations are directly from the user not pangolin. |
==== Jeff Vyduna ==== | ==== Jeff Vyduna ==== | ||
Line 268: | Line 268: | ||
Many workspaces keep the default scheme of having the first two QuickFX layers apply colors. On some compact MIDI controllers, | Many workspaces keep the default scheme of having the first two QuickFX layers apply colors. On some compact MIDI controllers, | ||
+ | |||
+ | === Relative encoder for fine Channel adjustment === | ||
+ | |||
+ | // Fine control from a relative encoder | ||
+ | // Place this script in a MIDI-to-PangoScript slot. | ||
+ | // and be sure to change the channel number in several places below | ||
+ | | ||
+ | // Channels are displayed in the UI as 0 to 100 | ||
+ | // but can be set as 0-1000 values using ChannelOut | ||
+ | // Channel.< | ||
+ | VAR ChannelNumber, | ||
+ | ChannelNumber = 5 | ||
+ | ChVal = int(Channels.5.Value * 1000) | ||
+ | // | ||
+ | // | ||
+ | | ||
+ | VAR MidiVal | ||
+ | MidiVal = ExtValue(0, | ||
+ | DisplayPreview " | ||
+ | | ||
+ | if (MidiVal > 64) GOTO Incr | ||
+ | | ||
+ | if (ChVal <= 0) GOTO Done | ||
+ | ChannelOut ChannelNumber, | ||
+ | // | ||
+ | GOTO Done | ||
+ | | ||
+ | Incr: | ||
+ | if (ChVal >= 1000) GOTO Done | ||
+ | ChannelOut ChannelNumber, | ||
+ | // | ||
+ | | ||
+ | Done: | ||
+ | // | ||
+ | |||
+ | Beyond channels show up as values between 0 and 100 in the Channels tab, but are internally stored as a normalized 0..1 float. This makes them useful tools for linking to any parameter that takes an input. Sometimes you want much finer control over a parameter than 127 values from MIDI (and few controllers support 14-bit MSB+LSB). You may have experienced this when linking MIDI controllers to Z rotation - it's steppy and I've resorted to enabling physics to dampen the motion which helps a little but is still imprecise. I was recently preparring for a film shoot where I needed fine control over some large value ranges (precise points counts in a resampler to help tune rolling shutter banding). By configuring my rotary encoder to send incremental up/down values, you can route it to parameter inputs through Channels using arbitrary fine resolution using the internal float value. | ||
+ | |||
+ | === Select Groups mode Destination cues from APC40 mkii Track/Clip Stop buttons === | ||
+ | |||
+ | // Activate a Destination cue (Groups) on APC40 mk2's Track Select button or Clip Stop button | ||
+ | | ||
+ | // Requires GlobalVar lastDestinationCueNumber - Define these in the controller init scripts! | ||
+ | // GlobalVar lastDestinationCueNumber | ||
+ | // lastDestinationCueNumber = 0 | ||
+ | | ||
+ | // For this script, Destination Cues page MUST be in page 1 of the whole workspace | ||
+ | // Select a desitnation cue; CueDown is the only trigger possible -- MouseDown doesn' | ||
+ | // Cancel all other track and clip stop indicator LEDs | ||
+ | // Illuminate the correct light | ||
+ | // Handle if a destination cue was clicked again by holding internal state | ||
+ | | ||
+ | // You must set this correctly for each button you add this script to | ||
+ | Var destinationCueNumber | ||
+ | destinationCueNumber = 1 | ||
+ | | ||
+ | Var isSecondRow | ||
+ | isSecondRow = (destinationCueNumber > 8) & (destinationCueNumber <=16) | ||
+ | | ||
+ | // StartCue doesn' | ||
+ | CueDown 1, destinationCueNumber // Page 1 must be " | ||
+ | | ||
+ | // Turn off all lights in this group | ||
+ | // Using a loop was too slow for the device or PangoScript. :-/ | ||
+ | MidiOut 0x90, 0x33, 0x00 | ||
+ | MidiOut 0x91, 0x33, 0x00 | ||
+ | MidiOut 0x92, 0x33, 0x00 | ||
+ | MidiOut 0x93, 0x33, 0x00 | ||
+ | MidiOut 0x94, 0x33, 0x00 | ||
+ | MidiOut 0x95, 0x33, 0x00 | ||
+ | MidiOut 0x96, 0x33, 0x00 | ||
+ | MidiOut 0x97, 0x33, 0x00 | ||
+ | | ||
+ | MidiOut 0x90, 0x34, 0x00 | ||
+ | MidiOut 0x91, 0x34, 0x00 | ||
+ | MidiOut 0x92, 0x34, 0x00 | ||
+ | MidiOut 0x93, 0x34, 0x00 | ||
+ | MidiOut 0x94, 0x34, 0x00 | ||
+ | MidiOut 0x95, 0x34, 0x00 | ||
+ | MidiOut 0x96, 0x34, 0x00 | ||
+ | MidiOut 0x97, 0x34, 0x00 | ||
+ | | ||
+ | | ||
+ | // Turn on this button' | ||
+ | MidiOut 0x90 + ((destinationCueNumber - 1) % 8), 0x33 + isSecondRow, | ||
+ | light | ||
+ | | ||
+ | // Handle repeat press of same cue | ||
+ | if (lastDestinationCueNumber = destinationCueNumber) Goto ToggleThisDestination | ||
+ | | ||
+ | destinationPlaying = 1 // Global. A new destination was clicked, so it's playing | ||
+ | | ||
+ | Goto FinishUp | ||
+ | | ||
+ | | ||
+ | ToggleThisDestination: | ||
+ | destinationPlaying = 1 - destinationPlaying // global | ||
+ | if (destinationPlaying = 0) MidiOut 0x90 + ((destinationCueNumber - 1) % 8), 0x33 + isSecondRow, | ||
+ | | ||
+ | FinishUp: | ||
+ | lastDestinationCueNumber = destinationCueNumber | ||
+ | |||
+ | I like Groups mode, though it still has several bugs around destination/ | ||
---- | ---- |