hereās some lua code to generate such tables. which i guess i consider better then just the tables.
i think you could use these functions on crow (if crow has access to lua math lib which i assume it does.)
note that the output is voltage offsets from fundamental.
of course to make more octaves, just add 1v per octave.
require 'math'
function log2(x)
-- math lib doesn't have base-2 log.
-- so this just uses precomputed log(2) to save some cycles
return math.log(x) / 0.69314718055995
end
function ratio_semi(ratio)
return 12.0 * log2(ratio)
end
function semi_voct(semi)
return semi / 12.0
end
--- that's all you really need, but here are some convenience functions
-- given a table of semitones from tonic, return table of voltage offsets
function semitone_scale_voct(scale)
local n = #scale
local volts = {}
for i=1,n do
volts[i] = semi_voct(scale[i])
end
return volts
end
-- given a table of ratios, return table of voltage offsets
function ratio_scale_voct(scale)
local n = #scale
local semi_scale = {}
for i=1,n do
semi_scale[i] = ratio_semi(scale[i])
end
return semitone_scale_voct(semi_scale)
end
---- test / demo
-- 12tet ionian scale, specified in semitones
local ionian_12tet_semi = {0, 2, 4, 5, 7, 9, 11}
local ionian_12tet_voct = semitone_scale_voct(ionian_12tet_semi)
print("ionian_12tet_volts:")
for _,v in pairs(ionian_12tet_voct) do print(v) end
-- 5-limit just-intoned ionian, specified as ratios
local ionian_ji5_ratios = {1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8}
local ionian_ji5_voct = ratio_scale_voct(ionian_ji5_ratios)
print("ionian_ji5_volts:")
for _,v in pairs(ionian_ji5_voct) do print(v) end
output
ionian_12tet_volts:
0
0.16666666666667
0.33333333333333
0.41666666666667
0.58333333333333
0.75
0.91666666666667
ionian_ji5_volts:
0
0.16992500144231
0.32192809488736
0.41503749927884
0.58496250072115
0.7369655941662
0.90689059560851