1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
|
# env.rb -- snd/env.scm
# Translator/Author: Michael Scholz <mi-scholz@users.sourceforge.net>
# Created: Sat Sep 20 23:24:17 CEST 2003
# Changed: Mon Dec 14 16:08:26 CET 2009
# Commentary:
#
# module Env (see env.scm)
# envelope_interp(x, en, base)
# window_envelope(beg, dur, en)
# map_envelopes(en1, en2, &func)
# multiply_envelopes(en1, en2)
# add_envelopes(en1, en2)
# max_envelope(en)
# min_envelope(en)
# integrate_envelope(en)
# envelope_last_x(en)
# stretch_envelope(fn, old_att, new_att, old_dec, new_dec)
# scale_envelope(en, scale, offset)
# reverse_envelope(en) alias envelope_reverse
# concatenate_envelopes(*envs) alias envelope_concatenate
# repeat_envelope(ur_env, repeats, reflect, x_normalized) alias envelope_repeat
#
# class Power_env
# initialize(*rest)
# power_env
# power_env_channel(beg, dur, snd, chn, edpos, edname)
#
# make_power_env(*rest)
# power_env(pe)
# power_env_channel(pe, beg, dur, snd, chn, edpos)
# powenv_channel(envelope, beg, dur, snd, chn, edpos)
#
# envelope_exp(en, power, xgrid)
# rms_envelope(file, *rest)
#
# envelope_length(en)
# normalize_envelope(en, new_max)
# x_norm(en, xmax)
#
# exp_envelope(env, *args) [by Fernando Lopez-Lezcano (nando@ccrma.stanford.edu)]
# db_envelope(env, cutoff, error)
# make_db_env(env, *args)
# semitones_envelope(env, around, error)
# make_semitones_env(env, *args)
# octaves_envelope(env, around, error)
# make_octaves_env(env, *args)
# Code:
require "clm"
module Env
add_help(:envelope_interp,
"envelope_interp(*args)
envelope_interp(x, env, base = 1.0) -> value of env at x; \
base controls connecting segment type: envelope_interp(0.3, [0, 0, 0.5, 1, 1, 0]) -> 0.6")
def envelope_interp(x, en, base = 1.0)
en.map! do |y| y.to_f end unless en.empty?
if en.empty?
0.0
else
if x <= en[0] or en[2..-1].empty?
en[1]
else
if en[2] > x
if en[1] == en[3] or base.zero?
en[1]
else
if base == 1.0
en[1] +
(x - en[0]) *
((en[3] - en[1]) / (en[2] - en[0]))
else
en[1] +
((en[3] - en[1]) / (base - 1.0)) *
((base ** ((x - en[0]) / (en[2] - en[0]))) - 1.0)
end
end
else
envelope_interp(x, en[2..-1], base)
end
end
end
end
add_help(:window_envelope,
"window_envelope(beg, dur, env) \
portion of env lying between x axis values beg and end: \
window_envelope(1.0, 3.0, [0.0, 0.0, 5.0, 1.0]) -> [1.0, 0.2, 3.0, 0.6]")
def window_envelope(beg, dur, en)
en.map! do |x| x.to_f end unless en.empty?
nenv = []
lasty = en.empty? ? 0.0 : en[1]
len = en.length
0.step(len - 1, 2) do |i|
x = en[i]
y = lasty = en[i + 1]
if nenv.empty?
if x >= beg
nenv.push(beg, envelope_interp(beg, en))
unless x == beg
if x >= dur
return nenv.push(dur, envelope_interp(dur, en))
else
nenv.push(x, y)
end
end
end
else
if x <= dur
nenv.push(x, y)
return nenv if x == dur
else
if x > dur
return nenv.push(dur, envelope_interp(dur, en))
end
end
end
end
nenv.push(dur, lasty)
end
add_help(:map_envelopes,
"map_envelopes(env1, env2, &func) \
maps func over the breakpoints in env1 and env2 returning a new envelope")
def map_envelopes(en1, en2, &func)
en1.map! do |x| x.to_f end unless en1.empty?
en2.map! do |x| x.to_f end if array?(en2) and (not en2.empty?)
xs = []
at0 = lambda do |e|
diff = e.first
lastx = e[-2]
0.step(e.length - 1, 2) do |i|
x = (e[i] - diff) / lastx
xs.push(x)
e[i] = x
end
e
end
if en1.empty?
at0.call(en2)
else
if en2.empty?
at0.call(en1)
else
ee1 = at0.call(en1)
ee2 = at0.call(en2)
newe = []
xs.uniq.sort.each do |x|
newe.push(x, func.call(envelope_interp(x, ee1), envelope_interp(x, ee2)))
end
newe
end
end
end
add_help(:multiply_envelopes,
"multiply_envelopes(env1, env2) \
multiplies break-points of env1 and env2 returning a new envelope: \
multiply_envelopes([0, 0, 2, 0.5], [0, 0, 1, 2, 2, 1]) -> [0.0, 0.0, 0.5, 0.5, 1.0, 0.5]")
def multiply_envelopes(en1, en2)
map_envelopes(en1, en2) do |x, y| x * y end
end
add_help(:add_envelopes,
"add_envelopes(env1, env2) adds break-points of env1 and env2 returning a new envelope")
def add_envelopes(en1, en2)
map_envelopes(en1, en2) do |x, y| x + y end
end
add_help(:max_envelope, "max_envelope(env) -> max y value in env")
def max_envelope(en)
mx = en[1].to_f
1.step(en.length - 1, 2) do |i| mx = [mx, en[i]].max.to_f end
mx
end
add_help(:min_envelope, "min_envelope(env) -> min y value in env")
def min_envelope(en)
mn = en[1].to_f
1.step(en.length - 1, 2) do |i| mn = [mn, en[i]].min.to_f end
mn
end
add_help(:integrate_envelope, "integrate_envelope(env) -> area under env")
def integrate_envelope(en)
sum = 0.0
0.step(en.length - 3, 2) do |i| sum += (en[i + 1] + en[i + 3]) * (en[i + 2] - en[i]) * 0.5 end
sum
end
add_help(:envelope_last_x, "envelope_last_x(env) -> max x axis break point position")
def envelope_last_x(en)
en.empty? ? 0.0 : en[-2]
end
add_help(:stretch_envelope,
"stretch_envelope(fn, old_att, new_att, old_dec, new_dec) \
takes FN and returns a new envelope based on it but with the attack \
and optionally decay portions stretched or squeezed; \
OLD_ATT is the original x axis attack end point, \
NEW_ATT is where that section should end in the new envelope. \
Similarly for OLD_DEC and NEW_DEC. \
This mimics divseg in early versions of CLM and its antecedents in Sambox and Mus10 (linen).
stretch_envelope([0, 0, 1, 1], 0.1, 0.2) -> [0, 0, 0.2, 0.1, 1.0, 1]
stretch_envelope([0, 0, 1, 1, 2, 0], 0.1, 0.2, 1.5, 1.6)
-> [0, 0, 0.2, 0.1, 1.1, 1, 1.6, 0.5, 2.0, 0]")
def stretch_envelope(fn, old_att = false, new_att = false, old_dec = false, new_dec = false)
unless array?(fn)
error("%s: need an envelope, %s", get_func_name, fn.inspect)
end
fn.map! do |x| x.to_f end unless fn.empty?
if old_att and (not new_att)
Snd.raise(:wrong_number_of_args, old_att.inspect, "old_att but no new_att?")
else
if (not new_att)
fn
else
if old_dec and (not new_dec)
Snd.raise(:wrong_number_of_args,
format("%s %s %s", old_att, new_att, old_dec), "old_dec but no new_dec?")
else
new_x = x0 = fn[0]
last_x = fn[-2]
y0 = fn[1]
new_fn = [x0, y0]
scl = (new_att - x0) / [0.0001, old_att - x0].max
old_dec += 0.000001 * last_x if old_dec and old_dec == old_att
fn[2..-1].each_pair do |x1, y1|
if x0 < old_att and x1 >= old_att
y0 = if x1 == old_att
y1
else
y0 + (y1 - y0) * ((old_att - x0) / (x1 - x0))
end
x0 = old_att
new_x = new_att
new_fn.push(new_x, y0)
scl = if old_dec
(new_dec - new_att) / (old_dec - old_att)
else
(last_x - new_att) / (last_x - old_att)
end
end
if old_dec and x0 < old_dec and x1 >= old_dec
y0 = if x1 == old_dec
y1
else
y0 + (y1 - y0) * ((old_dec - x0) / (x1 - x0))
end
x0 = old_dec
new_x = new_dec
new_fn.push(new_x, y0)
scl = (last_x - new_dec) / (last_x - old_dec)
end
if x0 != x1
new_x += scl * (x1 - x0)
new_fn.push(new_x, y1)
x0, y0 = x1, y1
end
end
new_fn
end
end
end
end
add_help(:scale_envelope,
"scale_envelope(env, scale, offset = 0.0) \
scales y axis values by SCALER and optionally adds OFFSET")
def scale_envelope(en, scale, offset = 0.0)
1.step(en.length - 1, 2) do |i| en[i] = en[i] * scale + offset end
en
end
add_help(:reverse_envelope, "reverse_envelope(env) reverses the breakpoints in ENV")
def reverse_envelope(en1)
len = en1.length
if len.zero? or len == 2
en1
else
en2 = en1.dup
xmax = en1[-2]
0.step(len - 2, 2) do |i|
en2[-(i + 2)], en2[-(i + 1)] = xmax - en1[i], en1[i + 1]
end
en2
end
end
alias envelope_reverse reverse_envelope
add_help(:concatenate_envelopes,
"concatenate_envelopes(*envs) concatenates its arguments into a new envelope")
def concatenate_envelopes(*envs)
if envs.length == 1
envs.first
else
xoff = 0.0
ren = []
envs.each do |en|
(en or []).map! do |x| x.to_f end
firstx = en.first
if ren[-1] == en[1]
xoff -= 0.01
en = en[2..-1]
end
0.step(en.length - 1, 2) do |i| ren.push(xoff + (en[i] - firstx), en[i + 1]) end
xoff += 0.01 + ren[-2]
end
ren
end
end
alias envelope_concatenate concatenate_envelopes
add_help(:repeat_envelope,
"repeat_envelope(ur_env, repeats, reflected = false, x_normalized = false) \
repeats ENV REPEATS times.
repeat_envelope([0, 0, 100, 1] 2) -> [0, 0, 100, 1, 101, 0, 201, 1]
If the final y value is different from the first y value, \
a quick ramp is inserted between repeats. \
X_NORMALIZED causes the new envelope's x axis to have the same extent as the original's. \
REFLECTED causes every other repetition to be in reverse.")
def repeat_envelope(ur_env, repeats, reflected = false, x_normalized = false)
(ur_env or []).map! do |x| x.to_f end
tms = (reflected ? (repeats / 2).floor : repeats)
en = if reflected
lastx = ur_env[-2]
new_env = ur_env.dup
rev_env = ur_env[0..-3].reverse
0.step(rev_env.length - 1, 2) do |i|
new_env.push(lastx + (lastx - rev_env[i + 1]), rev_env[i])
end
new_env
else
ur_env
end
(en or []).map! do |x| x.to_f end
first_y = en[1]
x_max = en[-2]
x = en.first
first_y_is_last_y = (first_y == en.last)
new_env = [first_y, x]
len = en.length
tms.times do |i|
2.step(len - 1, 2) do |j|
x += en[j] - en[j - 2]
new_env.push(x, en[j + 1])
end
if (i < tms - 1) and (not first_y_is_last_y)
x += x_max / 100.0
new_env.push(x, first_y)
end
end
if x_normalized
scl = x_max / x
0.step(new_env.length - 1, 2) do |i| new_env[i] *= scl end
end
new_env
end
alias envelope_repeat repeat_envelope
class Power_env
def initialize(*rest)
envelope, scaler, offset, duration = nil
optkey(rest, binding,
[:envelope, [0, 0, 1, 100, 1, 1]],
[:scaler, 1.0],
[:offset, 0.0],
[:duration, 0.0])
envelope.map! do |val| Float(val) end
xext = envelope[-3] - envelope.first
j = 0
@envs = make_array(envelope.length / 3 - 1) do |i|
x0 = envelope[j]
x1 = envelope[j + 3]
y0 = envelope[j + 1]
y1 = envelope[j + 4]
base = envelope[j + 2]
j += 3
make_env(:envelope, [0.0, y0, 1.0, y1],
:base, base,
:scaler, scaler,
:offset, offset,
:duration, duration * ((x1 - x0) / xext))
end
@current_pass = mus_length(@envs.first)
@current_env = 0
end
def power_env
val = env(@envs[@current_env])
@current_pass -= 1
if @current_pass.zero? and @current_env < (@envs.length - 1)
@current_env += 1
@current_pass = mus_length(@envs[@current_env])
end
val
end
def power_env_channel(beg, dur, snd, chn, edpos, edname)
curbeg = beg
as_one_edit_rb(edname) do | |
@envs.each do |en|
len = mus_length(en) + 1
env_channel(en, curbeg, len, snd, chn, edpos)
curbeg += len
end
end
end
end
# Power envelope
def make_power_env(*rest)
Power_env.new(*rest)
end
def power_env(pe)
pe.power_env
end
def power_env_channel(pe, beg = 0, dur = false, snd = false, chn = false, edpos = false)
pe.power_env_channel(beg, dur, snd, chn, edpos, get_func_name)
end
def powenv_channel(envelope, beg = 0, dur = false, snd = false, chn = false, edpos = false)
curbeg = beg
fulldur = (dur or frames(snd, chn, edpos))
len = envelope.length
x1 = envelope[0]
xrange = envelope[len - 3] - x1
y1 = envelope[1]
base = envelope[2]
x0 = y0 = 0.0
if len == 3
scale_channel(y1, beg, dur, snd, chn, edpos)
else
as_one_edit_rb(get_func_name) do | |
3.step(len - 1, 3) do |i|
x0, x1 = x1, envelope[i]
y0, y1 = y1, envelope[i + 1]
curdur = (fulldur * ((x1 - x0) / xrange)).round
xramp_channel(y0, y1, base, curbeg, curdur, snd, chn, edpos)
curbeg += curdur
base = envelope[i + 2]
end
end
end
end
# by Anders Vinjar:
#
# envelope-exp can be used to create exponential segments to include in
# envelopes. Given 2 or more breakpoints, it approximates the
# curve between them using 'xgrid linesegments and 'power as the
# exponent.
#
# env is a list of x-y-breakpoint-pairs,
# power applies to whole envelope,
# xgrid is how fine a solution to sample our new envelope with.
def envelope_exp(en, power = 1.0, xgrid = 100)
en.map! do |x| x.to_f end unless en.empty?
mn = min_envelope(en)
largest_diff = max_envelope(en) - mn
x_min = en.first
x_max = en[-2]
x_incr = (x_max - x_min) / xgrid.to_f
new_en = []
x_min.step(x_max, x_incr) do |x|
y = envelope_interp(x, en)
new_en.push(x, (largest_diff.zero? ?
y :
(mn + largest_diff * (((y - mn) / largest_diff) ** power))))
end
new_en
end
def rms_envelope(file, *rest)
beg, dur, rfreq, db = nil
optkey(rest, binding,
[:beg, 0.0],
:dur,
[:rfreq, 30.0],
:db)
e = []
incr = 1.0 / rfreq
fsr = mus_sound_srate(file)
incrsamps = (incr * sfr).round
start = (beg * fsr).round
reader = make_sampler(start, file)
fin = dur ? [start + (fsr * dur).round, mus_sound_frames(file)].min : mus_sound_frames(file)
rms = make_moving_average(incrsamps)
0.step(fin, incrsamps) do |i|
rms_val = 0.0
incrsamps.times do |j|
val = reader.call
rms_val = moving_average(rms, val * val)
end
e.push(i.to_f / fsr)
rms_val = sqrt(rms_val)
if db
if rms_val < 0.00001
e.push(-100.0)
else
e.push(20.0 * (log(rms_val) / log(10.0)))
end
else
e.push(rms_val)
end
end
end
def envelope_length(en)
en.length / 2
end
def normalize_envelope(en, new_max = 1.0)
mx = en[1].abs.to_f
1.step(en.length - 1, 2) do |i| mx = [mx, en[i].abs].max.to_f end
scale_envelope(en, new_max / mx)
end
def x_norm(en, xmax)
scl = xmax / en[-2].to_f
en.each_pair do |x, y| [x * scl, y.to_f] end.flatten
end
# ;;;=============================================================================
# ;;; Exponential envelopes
# ;;;=============================================================================
#
# ;;; Approximate an exponential envelope with a given base and error bound
# ;;; by Fernando Lopez-Lezcano (nando@ccrma.stanford.edu)
# ;;;
# ;;; base:
# ;;; step size of the exponential envelope
# ;;; error:
# ;;; error band of the approximation
# ;;; scaler:
# ;;; scaling factor for the y coordinates
# ;;; offset:
# ;;; offset for the y coordinates
# ;;; cutoff:
# ;;; lowest value of the exponentially rendered envelope, values lower than
# ;;; this cutoff value will be approximated as cero.
# ;;; out-scaler
# ;;; scaler for the converted values
def exp_envelope(env, *args)
base, error, scaler, offset, cutoff, out_scaler = nil
optkey(args, binding,
[:base, 2 ** (1.0 / 12)],
[:error, 0.01],
[:scaler, 1.0],
[:offset, 0.0],
:cutoff,
[:out_scaler, 1.0])
result = []
ycutoff = (cutoff ? (base ** (offset + cutoff * scaler)) : false)
interpolate = lambda do |xl, yl, xh, yh, xi|
yl + (xi - xl) * ((yh - yl) / (xh - xl))
end
exp_seg = lambda do |xl, yle, xh, yhe, yl, yh, err|
xint = (xl + xh) / 2.0
yint = interpolate.call(xl, yl, xh, yh, xint)
yinte = interpolate.call(xl, yle, xh, yhe, xint)
yexp = base ** yint
yerr = base ** (yint + err) - yexp
if (yexp - yinte).abs > yerr and ((ycutoff and yinte > ycutoff) or true)
xi, yi = exp_seg.call(xl, yle, xint, yexp, yl, yint, err)
xj, yj = exp_seg.call(xint, yexp, xh, yhe, yint, yh, err)
[xi + [xint] + xj, yi + [yexp] + yj]
else
[[], []]
end
end
nx = nyscl = 0.0
0.step(env.length - 4, 2) do |i|
x = env[i]
y = env[i + 1]
nx = env[i + 2]
ny = env[i + 3]
yscl = offset + y * scaler
nyscl = offset + ny * scaler
result.push(x)
result.push((((not ycutoff) or base ** yscl >= ycutoff) ? (out_scaler * base ** yscl) : 0.0))
xs, ys = exp_seg.call(x, base ** yscl, nx, base ** nyscl, yscl, nyscl, error)
unless xs.empty?
ys_scaled = vct_scale!(list2vct(ys), out_scaler)
xs.each_with_index do |xx, ii|
result.push(xx)
result.push(ys_scaled[ii])
end
end
end
result.push(nx)
result.push((((not ycutoff) or base ** nyscl >= ycutoff) ? (out_scaler * base ** nyscl) : 0.0))
end
# ;;; Amplitude envelope in dBs
# ;;;
# ;;; The db scale is defined as:
# ;;; value(db)=(* 20 (log10 (/ vin vref)))
# ;;; where:
# ;;; vref=1.0 reference value = digital clipping
def db_envelope(env, cutoff = -70, error = 0.01)
exp_envelope(env, :base, 10.0, :scaler, 1.0 / 20, :cutoff, cutoff, :error, error)
end
def make_db_env(env, *args)
scaler, offset, base, duration, len, cutoff, error = nil
optkey(args, binding,
[:scaler, 1.0],
[:offset, 0.0],
[:base, 1.0],
[:duration, 0.0],
[:len, 0],
[:cutoff, -70],
[:error, 0.01])
make_env(:envelope, db_envelope(env, cutoff, error), :scaler, scaler, :offset, offset,
:base, base, :duration, dur, :length, len)
end
# ;;; Pitch envelopes (y units are semitone and octave intervals)
def semitones_envelope(env, around = 1.0, error = 0.01)
exp_envelope(env, :error, error, :out_scaler, around)
end
def make_semitones_env(env, *args)
around, scaler, offset, base, dur, len, error = nil
optkey(args, binding,
[:around, 1.0],
[:scaler, 1.0],
[:offset, 0.0],
[:base, 1.0],
[:duration, 0.0],
[:len, 0],
[:error, 0.01])
make_env(:envelope, semitones_envelope(env, around, error), :scaler, scaler, :offset, offset,
:base, base, :duration, dur, :length, len)
end
def octaves_envelope(env, around = 1.0, error = 0.01)
exp_envelope(env, :error, error, :base, 2.0, :out_scaler, around)
end
def make_octaves_env(env, *args)
around, scaler, offset, base, dur, len, error = nil
optkey(args, binding,
[:around, 1.0],
[:scaler, 1.0],
[:offset, 0.0],
[:base, 1.0],
[:duration, 0.0],
[:len, 0],
[:error, 0.01])
make_env(:envelope, octaves_envelope(env, around, error), :scaler, scaler, :offset, offset,
:base, base, :duration, dur, :length, len)
end
end
include Env
=begin
# power envelope test (clm/env.lisp)
def test_power_env(start, dur, en)
os = make_oscil()
pe = make_power_env(:envelope, en, :duration, dur, :scaler, 0.5)
beg, len = times2samples(start, dur)
(beg...len).each do |i| outa(i, power_env(pe) * oscil(os), $output) end
end
with_sound(:channels, 1, :play, 1) do | |
test_power_env(0, 1, [0, 0, 0.325, 1, 1, 32, 2, 0, 0])
test_power_env(1.2, 1, [0, 0, 0.325, 1, 1, 32, 2, 0.5, 1, 3, 1, 0.1234, 4, 0, 0])
test_power_env(2.4, 1, [0, 0, 0, 1, 1, 1, 2, 0.5, 0.123, 3, 1, 321, 4, 0, 0])
end
=end
# env.rb ends here
|