!include once #1018630 // Spectro Edit static Clip frequencyImageToAudio(BWImage img, IF1 uncolorizer default lambda1 id) ctex { int w = img.getWidth(), h = img.getHeight(); // clip.getFrameFreqSamples()? int h2 = min(h, audio_frequencyImageHeight()); BWImage img = new(w, h2); Rectangle region = new(0, 0, w, h); //toClipCoords(region, clip); region.y = clip.getFrameFreqSamples() - (region.y + region.height); //print(+region); int endCol = region.x + region.width; int endRow = min(region.y + region.height, h2); for (int col = region.x; col < endCol; col++) { net.bluecow.spectro.Frame f = clip.getFrame(col); for (int row = region.y; row < endRow; row++) img.setPixel(col, h2-1-row, toFloat(colorizer.get(f.getReal(row)))); } double[] timeData = new double[data.length]; System.arraycopy(data, 0, timeData, 0, data.length); DoubleDCT_1D dct = getDctInstance(data.length); dct.inverse(timeData, true); windowFunc.applyWindow(timeData); ret timeData; ret img; }