Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: Mod help - Waveform info  (Read 7081 times)

0 Members and 2 Guests are viewing this topic.

LokiClock

  • New User
  • Offline Offline
  • Posts: 21
    • View Profile
    • Loki Clock's Inflammatory Internet Homepage
Mod help - Waveform info
« 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.
Logged

TraumFlug

  • New User
  • Offline Offline
  • Posts: 24
    • View Profile
Re: Mod help - Waveform info
« Reply #1 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)?

Logged

LokiClock

  • New User
  • Offline Offline
  • Posts: 21
    • View Profile
    • Loki Clock's Inflammatory Internet Homepage
Re: Mod help - Waveform info
« Reply #2 on: December 19, 2010, 01:35:06 »

Thank you very much! I'm seeing if I could hack together some frequency space input.
Logged

TraumFlug

  • New User
  • Offline Offline
  • Posts: 24
    • View Profile
Re: Mod help - Waveform info
« Reply #3 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.
Logged

LokiClock

  • New User
  • Offline Offline
  • Posts: 21
    • View Profile
    • Loki Clock's Inflammatory Internet Homepage
Re: Mod help - Waveform info
« Reply #4 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?
« Last Edit: February 13, 2011, 21:12:05 by LokiClock »
Logged
Pages: [1]   Go Up