Colored¶
Auto-generated documentation for musicalgestures._colored module.
- Mgt-python / Modules / Musicalgestures / Colored
MgAudioProcessor¶
class MgAudioProcessor(object):
def __init__(
filename,
n_fft,
fmin,
fmax=None,
window_function=np.hanning,
):
MgAudioProcessor().peaks¶
Read all samples between start_seek and end_seek, then find the minimum and maximum peak in that range. Returns that pair in the order they were found. So if min was found first, it returns (min, max) else the other way around.
MgAudioProcessor().read_samples¶
Read size samples starting at start, if resize_if_less is True and less than size samples are read, resize the array to size and fill with zeros
MgAudioProcessor().spectral_centroid¶
Starting at seek_point to read n_fft samples and calculate the spectral centroid
MgWaveformImage¶
MgWaveformImage().draw_peaks¶
Draw 2 peaks at x using the spectral_centroid for color
MgWaveformImage().interpolate_colors¶
Given a list of colors, create a larger list of colors linearly interpolating the first one. If flatten is True a list of numbers will be returned. If False, a list of (r,g,b) tuples. num_colors is the number of colors wanted in the final list