PKBeam / Edda

A beatmap editor for the VR rhythm game Ragnarock
GNU General Public License v3.0
34 stars 8 forks source link

Improve editor grid waveform #24

Open PKBeam opened 1 year ago

PKBeam commented 1 year ago

There are a few issues with the existing waveform:

Is there a better way to draw the waveform? Maybe draw it in chunks?

Is there a better way to create the waveform? Maybe FFT the samples in the audio stream and show the waveform only for certain frequencies. Or draw a second waveform over the first that's FFT'd specifically to bass/treble frequencies for drums.

PKBeam commented 1 year ago

The current code for drawing a waveform includes a bitmap format conversion that's probably quite slow and really shouldn't be there.

// VorbisWaveformVisualiser.cs 
private ImageSource _Draw(double height, double width, CancellationToken ct) {
  // ...
  return RenderTargetToImage(bmp); // <---
}

however, simply returning bmp causes the window to freeze with a bizarre low level exception (UCEERR_RENDERTHREADFAILURE) and I have no idea why it's happening.

PKBeam commented 1 year ago

added an option to display a spectrogram of the audio file. need to add a toggle in settings to enable/disable it.

PKBeam commented 1 year ago

toggle added. performance issues (mem usage) should be investigated later

Brollyy commented 1 year ago

Spectrogram released in 1.2.0