I tried a script that works in the phrase script editor, but gives an error in your tool. Is there a compatibility issue over a certain amount of characters?
script;
return pattern {
parameter = {
parameter.enum("scale1", "Chromatic", {
"Algerian", "Altered Dominant", "Arabian", "Arabian Hijaz", "Augmented", "Balinese",
"Balinese Pelog Selisir", "Blues Major", "Blues Minor", "Byzantine", "Chromatic",
"Chinese", "Diminished Half", "Diminished Whole", "Double Harmonic", "Dorian",
"Enigmatic", "Harmonic Major", "Harmonic Minor", "Harmonic Minor Inverse", "Hungarian Gypsy",
"Hungarian Major", "Indian Todi", "Iwato", "Japanese", "Japanese In Sen", "Kumoi",
"Lydian", "Lydian Augmented", "Lydian Dominant", "Locrian", "Locrian Major", "Melodic Minor",
"Messiaen Mode 1", "Messiaen Mode 2", "Messiaen Mode 3", "Mixolydian", "Natural Major",
"Natural Minor", "Neapolitan Major", "Neapolitan Minor", "Nine-Tone", "Pentatonic Egyptian",
"Pentatonic Major", "Pentatonic Minor", "Phrygian", "Phrygian Dominant", "Prometheus",
"Pelog", "Pelog Bem", "Romanian Minor", "Ryukyu", "Spanish Eight-Tone", "Spanish Gypsy",
"Spanish Phrygian", "Super Locrian", "Tritone", "Tritone Dominant", "Whole Tone",
"Yo Scale"
}, "Scale 1"),
parameter.integer("steps1", 16, {3, 32}, "Steps per rhythm (Scale 1)"),
parameter.integer("pulses1", 1, {1, 16}, "Pulses per rhythm (Scale 1)"),
parameter.integer("variation1", 1, {1, 100}, "Variation (Scale 1)"),
parameter.enum("scale2", "Chromatic", {
"Algerian", "Altered Dominant", "Arabian", "Arabian Hijaz", "Augmented", "Balinese",
"Balinese Pelog Selisir", "Blues Major", "Blues Minor", "Byzantine", "Chromatic",
"Chinese", "Diminished Half", "Diminished Whole", "Double Harmonic", "Dorian",
"Enigmatic", "Harmonic Major", "Harmonic Minor", "Harmonic Minor Inverse", "Hungarian Gypsy",
"Hungarian Major", "Indian Todi", "Iwato", "Japanese", "Japanese In Sen", "Kumoi",
"Lydian", "Lydian Augmented", "Lydian Dominant", "Locrian", "Locrian Major", "Melodic Minor",
"Messiaen Mode 1", "Messiaen Mode 2", "Messiaen Mode 3", "Mixolydian", "Natural Major",
"Natural Minor", "Neapolitan Major", "Neapolitan Minor", "Nine-Tone", "Pentatonic Egyptian",
"Pentatonic Major", "Pentatonic Minor", "Phrygian", "Phrygian Dominant", "Prometheus",
"Pelog", "Pelog Bem", "Romanian Minor", "Ryukyu", "Spanish Eight-Tone", "Spanish Gypsy",
"Spanish Phrygian", "Super Locrian", "Tritone", "Tritone Dominant", "Whole Tone",
"Yo Scale"
}, "Scale 2"),
parameter.integer("steps2", 16, {3, 32}, "Steps per rhythm (Scale 2)"),
parameter.integer("pulses2", 1, {1, 16}, "Pulses per rhythm (Scale 2)"),
parameter.integer("variation2", 1, {1, 100}, "Variation (Scale 2)"),
parameter.integer("seed", 123456, {0, 999999}, "Random Seed"),
},
unit = "1/4",
pulse = function(context)
-- Generate random states for both scales separately
local rand1 = math.randomstate(math.floor(context.parameter.seed) + context.parameter.variation1)
local rand2 = math.randomstate(math.floor(context.parameter.seed) + context.parameter.variation2)
-- Generate rhythms for both scales independently
local pattern1 = pulse.euclidean(context.parameter.pulses1, context.parameter.steps1, 0)
local pattern2 = pulse.euclidean(context.parameter.pulses2, context.parameter.steps2, 0)
-- Combine both patterns (they can play independently in parallel)
return {pattern1, pattern2}
end,
event = function(context)
-- Scale definitions
local scales = {
["Chromatic"] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59},
["Natural Major"] = {48, 50, 52, 53, 55, 57, 59},
["Natural Minor"] = {48, 50, 51, 53, 55, 56, 58},
["Pentatonic Major"] = {48, 50, 52, 55, 57},
["Pentatonic Minor"] = {48, 51, 53, 55, 58},
["Phrygian Dominant"] = {48, 51, 52, 55, 57, 59, 61},
["Locrian Major"] = {48, 50, 52, 53, 55, 57, 59},
["Super Locrian"] = {48, 50, 51, 53, 54, 56, 58},
["Neapolitan Major"] = {48, 49, 52, 53, 55, 57, 59},
["Neapolitan Minor"] = {48, 49, 52, 53, 55, 56, 59},
["Romanian Minor"] = {48, 50, 52, 53, 55, 57, 60},
["Spanish Gypsy"] = {48, 50, 51, 53, 55, 57, 60},
["Hungarian Gypsy"] = {48, 50, 52, 54, 55, 57, 60},
["Enigmatic"] = {48, 49, 52, 53, 56, 57, 59},
["Overtone"] = {48, 50, 52, 54, 56, 58, 60},
["Japanese In Sen"] = {48, 50, 53, 55, 60},
["Hirajoshi"] = {48, 50, 52, 55, 58},
["Yo Scale"] = {48, 50, 53, 55, 60},
["Pelog"] = {48, 49, 51, 52, 54},
["Balinese"] = {48, 49, 51, 53, 55},
["Pentatonic Egyptian"] = {48, 50, 53, 55, 58},
["Blues Major"] = {48, 50, 51, 52, 55, 57},
["Blues Minor"] = {48, 51, 53, 54, 55, 58},
["Whole Tone"] = {48, 50, 52, 54, 56, 58},
["Augmented"] = {48, 52, 56, 60},
["Prometheus"] = {48, 50, 52, 54, 55, 58},
["Tritone"] = {48, 50, 53, 54, 57, 58},
["Harmonic Major"] = {48, 50, 52, 53, 55, 56, 59},
["Harmonic Minor"] = {48, 50, 51, 53, 55, 56, 59},
["Melodic Minor"] = {48, 50, 51, 53, 55, 57, 59},
["All Minor"] = {48, 50, 51, 53, 55, 56, 58, 59},
["Dorian"] = {48, 50, 51, 53, 55, 57, 58},
["Phrygian"] = {48, 49, 51, 53, 55, 56, 58},
["Diminished Half"] = {48, 50, 51, 53, 54, 56, 57, 59},
["Diminished Whole"] = {48, 49, 51, 53, 54, 56, 58, 60},
["Spanish Eight-Tone"] = {48, 49, 51, 52, 53, 55, 56, 58, 59},
["Nine-Tone"] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57},
["Double Harmonic"] = {48, 49, 52, 53, 55, 56, 59},
["Persian"] = {48, 49, 52, 53, 54, 57, 58},
["Byzantine"] = {48, 49, 52, 53, 55, 56, 59},
["Algerian"] = {48, 50, 51, 54, 55, 56, 59, 60},
["Hungarian Major"] = {48, 50, 51, 54, 55, 57, 59},
["Harmonic Minor Inverse"] = {48, 50, 52, 53, 56, 57, 59},
["Japanese"] = {48, 49, 52, 55, 56},
["Chinese"] = {48, 50, 52, 55, 57},
["Indian Todi"] = {48, 49, 52, 53, 55, 56, 58},
["Arabian"] = {48, 49, 52, 53, 55, 57, 58},
["Slovakian"] = {48, 50, 52, 53, 55, 56, 58},
["Messiaen Mode 1"] = {48, 50, 52, 54, 56, 58, 60},
["Messiaen Mode 2"] = {48, 50, 51, 53, 54, 56, 57, 59},
["Messiaen Mode 3"] = {48, 49, 50, 52, 53, 54, 56, 57, 58, 60},
["Tritone Dominant"] = {48, 50, 52, 54, 56, 57, 58},
["Lydian Dominant"] = {48, 50, 52, 54, 56, 57, 59},
["Altered Dominant"] = {48, 49, 51, 53, 54, 56, 58},
["Spanish Phrygian"] = {48, 49, 51, 52, 55, 57, 58},
["Balinese Pelog Selisir"] = {48, 49, 52, 53, 55},
["Pelog Bem"] = {48, 50, 52, 53, 55},
["Iwato"] = {48, 49, 52, 54, 57},
["Ryukyu"] = {48, 50, 53, 55, 58},
["Arabian Hijaz"] = {48, 50, 51, 54, 55, 57, 58},
["Kumoi"] = {48, 50, 51, 55, 57},
["Maqam Rast"] = {48, 50, 52, 53, 55, 57, 59},
["Maqam Bayati"] = {48, 49, 51, 53, 55, 57, 58},
["Maqam Saba"] = {48, 49, 51, 52, 55, 57, 58},
["Maqam Nahawand"] = {48, 50, 51, 53, 55, 56, 58},
["Maqam Sikah"] = {48, 49, 52, 53, 56, 57, 60},
["Mixolydian"] = {48, 50, 52, 53, 55, 57, 58},
["Lydian Augmented"] = {48, 50, 52, 54, 56, 57, 59},
["Lydian"] = {48, 50, 52, 54, 55, 57, 59},
-- Add more scales as needed
}
-- Select scales
local selected_scale1 = scales[context.parameter.scale1] or scales["Chromatic"]
local selected_scale2 = scales[context.parameter.scale2] or scales["Chromatic"]
-- Random generators
local rand1 = math.randomstate(math.floor(context.parameter.seed) + context.parameter.variation1)
local rand2 = math.randomstate(math.floor(context.parameter.seed) + context.parameter.variation2)
-- Create note sequences
local note_sequence1 = pulse.new(context.parameter.steps1):map(function(_)
return selected_scale1[rand1(#selected_scale1)]
end)
local note_sequence2 = pulse.new(context.parameter.steps2):map(function(_)
return selected_scale2[rand2(#selected_scale2)]
end)
-- Return combined notes
local step_in_sequence1 = math.imod(context.step, #note_sequence1) + 1
local step_in_sequence2 = math.imod(context.step, #note_sequence2) + 1
return {
{
key = note_sequence1[step_in_sequence1] or 48,
volume = rand1(80, 100) / 100,
panning = rand1(-50, 50) / 100,
delay = rand1(0, 10) / 100,
},
{
key = note_sequence2[step_in_sequence2] or 48,
volume = rand2(80, 100) / 100,
panning = rand2(-50, 50) / 100,
delay = rand2(0, 10) / 100,
},
}
end,
}
In your tool window it says;
syntax error: [string "Phrase Script"]:168: unexpected symbol near '<eof>'