Tone generation tools.
This is the tone representation and rendering engine for the
Harmonical. The Harmonical is an instrument that can play music in any
tuning system, including just intonation, by allowing the music to
specify a precise pitch for each note. Its name is that given by
Helmholtz to his specially tuned harmonium that allowed him to experiment
with just tuning systems.
|
|
| generate_sine_wave(frequency,
duration,
amplitude,
sample_rate) |
source code
|
|
|
|
|
|
|
sum_signals(sigs,
norm=1.0)
Sum two wave signals. |
source code
|
|
|
|
normalize(wave,
level=0.8)
Normalize the amplitude of the wave data. |
source code
|
|
|
|
fade_in_out_envelope(precision=200,
hold_ratio=10)
Generates an envelope that fades in linearly, holds for a time
adjusted by hold_ratio, then fades out linearly. |
source code
|
|
|
|
smooth_fade_in_out_envelope(precision=200,
hold_ratio=10)
Generates an envelope that fades in with a log curve, holds for a
time adjusted by hold_ratio, then fades out similarly. |
source code
|
|
|
|
| fade_in_envelope(precision=200,
hold_ratio=10) |
source code
|
|
|
|
| fade_out_envelope(precision=200,
hold_ratio=10) |
source code
|
|
|
|
adsr_envelope(attack_time,
decay_time,
sustain_time,
release_time,
sustain_level=0.6,
sustain_level_end=0.4,
pause_time=0)
Create an envelope according to ADSR (attack-decay-sustain-release)
specifications. |
source code
|
|
|
|
|
|
|
|
|
ToneMatrix
|
path_to_tones(path,
tempo=120,
chord_types=None,
root_octave=0,
double_root=False,
equal_temperament=False,
timings=False)
Takes a tonal space path, given as a list of coordinates, and
generates the tones of the roots. |
source code
|
|
|
|
render_path_to_file(filename,
path,
*args,
**kwargs)
Convenience function that takes a path and set of timings and uses
the harmonical to render audio from it and writes it to a file. |
source code
|
|