Mod Archive Forums
Music Production => MilkyTracker => Tracking => MilkyTracker Community => Topic started by: LokiClock on December 18, 2010, 19:56:41
-
Does anyone know the functions involved in drawing the waveform? I need to know how Milky collects the data from the clicks up and how it uses that data to alter the waveform.
-
I don't know the mt sources too deeply, but read a little in it from time to time: have a look into "src/tracker/SampleEditorControl.cpp/h".
search for "drawMode", will lead you to the point, where mouse events are handled & the function are called (in "SampleEditorControl::dispatchEvent").
further down it leads to "SampleEditorControl::drawSample", where it seems the coordinates are translated, pushing them to the sample editor. change source file to "src/tracker/SampleEditor.cpp" (without "Control", now leaving gui/drawing code & entering the "guts"). "void SampleEditor::drawSample" does some more wrapping/interpolation, but go on yourself...
hope that helps, what do you want to do to the code (question out of curiosity)?
-
Thank you very much! I'm seeing if I could hack together some frequency space input.
-
nice idea!
but I'd say, best would be to place it into some sub-menu/popup of it's own, like the other "generators". I imagine it hard to integrate into the current drawing code & the like.
but wait, maybe just a function to warp an existing hand-drawn sample with an fft, treating the existing samples as bin magnitudes? that'd require least gui hacking.
maybe you'll find open-source libs like "kissfft" (small code size, works well) or "fftw" (large code size, but optimized like....for realtime) interesting for you project.
-
Thanks for the info. GUI hacking has been a bit of a show-stopper, but only because I got sidetracked into trying to get multisample editing, which would require overhaul of the fundamental, singleton-based method of sample editing. Would you recommend creating a new FFT object or trying to extend the EQ feature?