Mod Archive Forums

Music Production => MilkyTracker => Tracking => MilkyTracker Community => Topic started by: LokiClock on December 18, 2010, 19:56:41

Title: Mod help - Waveform info
Post 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.
Title: Re: Mod help - Waveform info
Post by: TraumFlug on December 18, 2010, 21:54:26
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)?

Title: Re: Mod help - Waveform info
Post by: LokiClock on December 19, 2010, 01:35:06
Thank you very much! I'm seeing if I could hack together some frequency space input.
Title: Re: Mod help - Waveform info
Post by: TraumFlug on December 19, 2010, 17:10:51
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.
Title: Re: Mod help - Waveform info
Post by: LokiClock on February 13, 2011, 21:10:14
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?