Skip to content

Instantly share code, notes, and snippets.

@kaneel
Created December 30, 2013 12:42
Show Gist options
  • Select an option

  • Save kaneel/8181692 to your computer and use it in GitHub Desktop.

Select an option

Save kaneel/8181692 to your computer and use it in GitHub Desktop.
kawai k1m synth definition for renoise guru tool
-- no I didn't type it... I got it from an old C program found at a kawai synth yahoo group
local waveList = {
"Sine 1st",
"Sine 2nd",
"Sine 3rd",
"Sine 4th",
"Sine 5th",
"Sine 6th",
"Sine 7th",
"Sine 8th",
"Sine 9th",
"Sine 10th",
"Sine 11th",
"Sine 12th",
"Sine 16th",
"Saw 1",
"Saw 2",
"Saw 3",
"Saw 4",
"Saw 5",
"Saw 6",
"Saw 7",
"Saw 8",
"Saw 9",
"Saw 10",
"Saw 11",
"Saw 12",
"Saw 13",
"Saw 14",
"Saw 15",
"Saw 16",
"Saw 17",
"Saw 18",
"Saw 19",
"Square 1",
"Square 2",
"Square 3",
"Square 4",
"Square 5",
"Inverse",
"Triangle",
"Random",
"French Horn",
"String 1",
"String 2",
"String Pad",
"Piano 1",
"El Grand 1",
"El Piano 1",
"El Piano 2",
"El Piano 3",
"Clavinet 1",
"Vibe 1",
"A Guitar 1",
"F Guitar 1",
"F Guitar 2",
"Ac Bass 1",
"Ac Bass 2",
"Digi Bass 1",
"Pick Bass 1",
"Digi Bass 2",
"Round Bass 1",
"Fretless 1",
"Fretless 2",
"Flute 1",
"PanFlute",
"Harmonica 1",
"Glocken",
"Tine 1",
"Harp 1",
"Marimba 1",
"El TomTom 1",
"Log Drum",
"Jazz Organ 1",
"Mello Pad",
"Synth Solo 1",
"Synth 2",
"French Horn",
"French Horn",
"Brass 1",
"Brass 2",
"Brass 3",
"Brass 4",
"Trumpet 1",
"Trumpet 2",
"Violin",
"String 3",
"Piano 2",
"Piano 3",
"Piano 4",
"Piano 5",
"Piano 6",
"Piano 7",
"Piano 8",
"El Grand 2",
"El Piano 4",
"El Piano 5",
"El Piano 6",
"Clavinet 2",
"Harpsicrd 1",
"Vibe 2",
"A Guitar 2",
"F Guitar 3",
"Strat 1",
"Strat 2",
"Ac Bass",
"Pull Bass",
"Pull Bass 2",
"Round Bass 2",
"Slap Bass",
"Slap Bass 2",
"Slap Bass 3",
"Fretless 3",
"Fretless 4",
"Synth Bass 1",
"Synth Bass 2",
"Harmonica 2",
"Clarinet 1",
"Clarinet 2",
"Oboe 1",
"Oboe 2",
"ShakuHachi",
"Orient Bell 1",
"Orient Bell 2",
"Bell",
"Koto 1",
"Sitar",
"El TomTom 2",
"Log Drum 1",
"Log Drum 2",
"Steel Drum 1",
"Steel Drum 2",
"Voice 1",
"Voice 2",
"Accordion 1",
"Accordion 2",
"Jazz Organ 2",
"Rock Organ 1",
"Draw Bar 1",
"Draw Bar 2",
"Pipe Organ 1",
"Pipe Organ 2",
"Rock Organ 2",
"Synth Solo 2",
"Synth Solo 3",
"Synth 2",
"Synth 3",
"Synth 4",
"Brass",
"Brass 2",
"Orchestra",
"Piano 9",
"Piano 10",
"El Piano 7",
"El Piano 8",
"El Piano 9",
"El Piano 10",
"Clavinet 3",
"Harpsichd 2",
"Harpsichd 3",
"Vibe 3",
"Digi Bass 3",
"Digi Bass 4",
"Digi Bass 5",
"Pick Bass 2",
"Glocken",
"Glocken 2",
"Tine 2",
"Tine 3",
"Tine 4",
"Tube Bell 1",
"Tube Bell 2",
"Tube Bell 3",
"Xylophone 1",
"Xylophone 2",
"Harp 2",
"Koto 2",
"Sitar 2",
"Sitar 3",
"Kalimba 1",
"Kalimba 2",
"Kalimba 3",
"Log Drum",
"Steel Drum",
"Pipe Organ 3",
"Pipe Organ 4",
"Synth 5",
"Synth 6",
"Synth 7",
"Synth 8",
"Synth 9",
"Synth 10",
"Clavinet 4",
"Digi Bass 6",
"Digi Bass 7",
"Pick Bass 3",
"Pick Bass 4",
"Round Bass 3",
"Round Bass 4",
"Harmonica 3",
"Harmonica 4",
"Harp 3",
"Koto 3",
"Sitar 1",
"Marimba 2",
"Synth 11",
"Bass Drum",
"Ac Snare",
"Tight Snare",
"E. Snare",
"Rim",
"Ac Tom",
"High Hat",
"Crash",
"Ride",
"Strat Guitar",
"fuzz mute",
"A Guitar 3",
"F guitar 4",
"Guitar Harmonic",
"Pull Bass",
"Bass Harmonic",
"Bowed String",
"String Attack",
"String Sustain",
"Pizzacato",
"Piano PCM",
"Electric Grand",
"Piano Noise",
"Trumpet",
"Shakuhachi Attack",
"Shakuhachi Sustain",
"Pan flute attack",
"Pan flute sustain",
"Voice 3",
"White Noise",
"String Loop",
"Shakuhachi Loop",
"Pan flute Loop",
"Voice Loop",
"White Noise Loop",
"Ac Snare Loop",
"F. Guitar loop",
"Pull Bass Loop",
"Omnibus Loop 1",
"Omnibus Loop 2",
"Omnibus Loop 3",
"Omnibus Loop 4",
"Omnibus Loop 5",
"Omnibus Loop 6",
"Omnibus Loop 7",
"Omnibus Loop 8",
"Ac Snare Reverse",
"Ac Tom Reverse",
"F Guitar Reverse",
"High Hat Alternate",
"Crash Alternate",
"Piano Noise Alternate"
}
local sysex_common = {0xF0, 0x40, "cc", 0x10, 0x00, 0x03, "nn", 0x00, "vv", 0xF7}
local sysex = {
{0xF0, 0x40, "cc", 0x10, 0x00, 0x03, "nn", 0x00, "vv", 0xF7},
{0xF0, 0x40, "cc", 0x10, 0x00, 0x03, "nn", 0x02, "vv", 0xF7},
{0xF0, 0x40, "cc", 0x10, 0x00, 0x03, "nn", 0x04, "vv", 0xF7},
{0xF0, 0x40, "cc", 0x10, 0x00, 0x03, "nn", 0x06, "vv", 0xF7}
}
function copy(n)
local newT = {}
for k, v in pairs(sysex[n]) do
newT[k] = v
end
return newT
end
function makeWave(n)
return Group {
id = "wave_" .. n,
name = "WAVE",
Parameter {
id = "wave_".. n .."_select",
name = "Wave Select",
items = waveList,
default_value = 1,
number = 35,
sysex_message_template = copy(n),
value_callback = function(p)
local newSex = copy(n)[8]
local value = p.value
if p.value > 127 then
newSex = newSex + 1
value = bit.band(value, 0x7f)
end
p.synth_definition.parameters["wave_".. n .."_select"].sysex_message_template[8] = newSex
return value
end
}
}
end
function makeFreq(n)
return Group {
id = "freq_" .. n,
name = "FREQ",
Parameter {
id = "freq_key_track_" .. n,
name = "Key track",
items = {"Off","On"},
default_value = 2,
number = 31
},
Parameter {
id = "freq_coarse_" .. n,
name = "Coarse",
min_value = 60,
max_value = 108,
display_min_value = -24,
display_max_value = 24,
default_value = 84,
number = 28
},
Parameter {
id = "freq_fixed_" .. n,
name = "Fixed Freq",
min_value = 0,
max_value = 127,
default_value = 64,
number = 29
},
Parameter {
id = "freq_fine_" .. n,
name = "Fine",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 30
},
Parameter {
id = "freq_vibrato_autobend_" .. n,
name = "Vibrato / Auto bend",
items = {"Off","On"},
default_value = 2,
number = 32
},
Parameter {
id = "freq_prs_freq_" .. n,
name = "Prs->Freq",
items = {"Off","On"},
default_value = 2,
number = 33
},
Parameter {
id = "freq_ks_freq_" .. n,
name = "Ks->Freq",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 34
}
}
end
function makeEnv(n)
return Group {
id = "env_" .. n,
name = "ENV",
Parameter {
id = "env_level_" .. n,
name = "Level",
min_value = 0,
max_value = 100,
default_value = 100,
number = 41
},
Parameter {
id = "env_delay_" .. n,
name = "Delay",
min_value = 0,
max_value = 100,
default_value = 0,
number = 42
},
Parameter {
id = "env_attack_" .. n,
name = "Attack",
min_value = 0,
max_value = 100,
default_value = 10,
number = 43
},
Parameter {
id = "env_decay_" .. n,
name = "Decay",
min_value = 0,
max_value = 100,
default_value = 20,
number = 44
},
Parameter {
id = "env_sustain_" .. n,
name = "Sustain",
min_value = 0,
max_value = 100,
default_value = 100,
number = 45
},
Parameter {
id = "env_release_" .. n,
name = "Release",
min_value = 0,
max_value = 100,
default_value = 20,
number = 46
},
Parameter {
id = "env_vel_curve_" .. n,
name = "Velocity curve",
min_value = 0,
max_value = 7,
default_value = 0,
number = 47
}
},
Group {
id = "level_mod_" .. n,
name = "Level MOD",
Parameter {
id = "env_level_mod_vel_env_" .. n,
name = "Velocity->Env",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 48
},
Parameter {
id = "env_level_mod_prs_env_" .. n,
name = "Prs->Env",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 49
},
Parameter {
id = "env_level_mod_ks_env_" .. n,
name = "Ks->Env",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 50
}
},
Group {
id = "time_mod_" .. n,
name = "Time MOD",
Parameter {
id = "env_time_mod_vel_env_" .. n,
name = "Vel->Env time",
display_min_value = -50,
display_max_value = 50,
default_value = 0,
number = 51
},
Parameter {
id = "env_time_mod_ks_env_" .. n,
name = "Ks->Env time",
display_min_value = -50,
display_max_value = 50,
default_value = 0,
number = 52
}
}
end
local wave_group_1 = makeWave(1)
local wave_group_2 = makeWave(2)
local wave_group_3 = makeWave(3)
local wave_group_4 = makeWave(4)
local freq_group_1 = makeFreq(1)
local freq_group_2 = makeFreq(2)
local freq_group_3 = makeFreq(3)
local freq_group_4 = makeFreq(4)
local env_group_1 = makeEnv(1)
local env_group_2 = makeEnv(2)
local env_group_3 = makeEnv(3)
local env_group_4 = makeEnv(4)
local common_section = Section {
id = "common",
name = "Common",
sysex_message_template = sysex_common,
Group {
name = "Volume",
Parameter {
id = "common_volume",
name = "Volume",
min_value = 0,
max_value = 99,
default_value = 99,
number = 3
}
},
Group {
name = "Voice",
Parameter {
id = "common_poly_mode",
name = "Poly mode",
items = {"PL1","PL2","SOLO"},
default_value = 1,
number = 27
},
Parameter {
id = "common_sources",
name = "Source 2/4",
items = {"2","4"},
default_value = 1,
number = 14
},
Parameter {
id = "common_am_1",
name = "AM S1.S2",
items = {"Off","2->1","REV"},
default_value = 1,
number = 36
},
Parameter {
id = "common_am_2",
name = "AM S3.S4",
items = {"Off","4->3","REV"},
default_value = 1,
number = 37
},
Parameter {
id = "common_ks_curve",
name = "KS curve",
min_value = 0,
max_value = 4,
default_value = 0,
display_min_value = 1,
display_max_value = 5,
number = 26
}
},
Group {
name = "MODs",
Parameter {
id = "common_prs_freq",
name = "Prs->Freq",
display_min_value = -50,
display_max_value = 50,
min_value = 0,
max_value = 100,
default_value = 50,
number = 24
},
Parameter {
id = "common_pitch_bend",
name = "Pitch bend",
min_value = 0,
max_value = 12,
default_value = 2,
number = 25
},
Parameter {
id = "common_auto_bend_depth",
name = "Auto bend depth",
display_min_value = -50,
display_max_value = 50,
min_value = 0,
max_value = 100,
default_value = 50,
number = 20
},
Parameter {
id = "common_auto_bend_time",
name = "Auto bend time",
min_value = 0,
max_value = 100,
default_value = 0,
number = 21
},
Parameter {
id = "common_auto_vel_dep",
name = "Auto bend Vel->Depth",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 22
},
Parameter {
id = "common_auto_ks_time",
name = "Auto bend ks->time",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 23
}
},
Group {
name = "Vibrato",
Parameter {
id = "common_vibrato_depth",
name = "Vibrato depth",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 15
},
Parameter {
id = "common_vibrato_speed",
name = "Vibrato speed",
min_value = 0,
max_value = 100,
default_value = 0,
number = 16
},
Parameter {
id = "common_vibrato_shape",
name = "Vibrato shape",
items = {"tri", "saw", "square", "random"},
default_value = 1,
number = 17
},
Parameter {
id = "common_vibrato_prs_depth",
name = "Vibrato prs->depth",
min_value = 0,
max_value = 100,
display_min_value = -50,
display_max_value = 50,
default_value = 50,
number = 18
},
Parameter {
id = "common_vibrato_wheel",
name = "Vibrato wheel",
items = {"depth", "speed"},
default_value = 1,
number = 19
}
}
}
return SynthDefinition {
id = "kawai_k1m",
name = "Kawai k1m",
author = "kaneel [mynameiskaneel@gmail.com]",
beta = true,
content_height = 400,
delay_between_midi_messages = 55,
common_section,
Section {
name = "S1",
sysex_message_template = sysex[1],
wave_group_1,
freq_group_1,
env_group_1
},
Section {
name = "S2",
sysex_message_template = sysex[2],
wave_group_2,
freq_group_2,
env_group_2
},
Section {
name = "S3",
sysex_message_template = sysex[3],
wave_group_3,
freq_group_3,
env_group_3
},
Section {
name = "S4",
sysex_message_template = sysex[4],
wave_group_4,
freq_group_4,
env_group_4
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment