Post 1482 wavetable discussion

User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Post 1482 wavetable discussion

Post by mantratronic »

Ok, so we fixed a bunch of bugs and normalized a lot of the code underneath, which means its time to go on to new bugs and features. Feel free to ask for things I've missed.

HIGH PRIORITY
  • Refactor Code to remove WaveformVM.cs entirely, according to discussion with oskari (see personal notes)
Bugs
  • snap to zero crossings doesn't work if selection start == 0 or selection end == samplecount
  • snap to zero crossings sometimes only adjusts the start but not the end
  • (COMMITED TO SVN but not understood) when you scroll back the waveform there are drawing artefacts at the end of the waveform (especially when zoomed in)
  • actually find out why the above fix works..
  • set loop command resets the zoom, why ? (because of invalidatedata, all commands that need to use this have this problem because we now re-set the layerindex after they executed)
  • strange behaviour of the scrollpane, scrolling with the middle grip scrolls the waveform, clicking the left and right parts scrolls the cursor. this is a bit inconsistent.
  • waveLayerVM doesn't exist on an empty slot so clicks on the layer buttons do nothing
  • (NOFIX) copy paste to clipboard for 32bit float wavs doesn't work (this seems to be a waveosaurus limitation, can somebody test other editors ?)
  • If you edit a .mp3 sample by either deleting / trimming or silencing a portion of the sample, the name of the sample gets blanked out in the wavetable. The sample is still available and accessible however.
Basic features:
  • Optimization: make restorlayer take a selection (for trim and so on) ? only back up this selection ?
  • NOTE FOR ABOVE FEATURE: the names and path of layers don't seem to be saves in the bmx sadly
  • layers seem to get ordered by root note when the drop down is rebuilt, this is just confusing. we should also disable the reordering of the layergrid entirely imho as its very confusing. it also possibly interferes with our new logic to select a layer after editing.
  • the wav path being displayed as text somewhere (if available)
  • rethink if we need so many DrawVisuals calls
  • load layer: this should really replace the selected layer and then add (or rather insert) subsequent layers and push layer beyond the inserted ones down ?
  • add new layer
  • rename/edit layer names
  • rename/edit slot names
  • right arrow key in slot should play the sample like in the browser (just play layer 0)
  • Position Text in Wave Editor should also show time not just samples
  • smooth loop command
  • applying gain command to wave can cause them to clip if they are not 32bit floats, should probaly convert the layer to that prior to gaining. (note that you must convert the whole slot!)
  • play selection/layer/loop
  • additional command version of snap to 0 crossings that is able to select half-wavecycles instead of whole wave cycles
  • Option to Ignore Root Note when loading wav (like sticky)
  • don't use reflection to get the layer index in GetLayerIndex(IWaveformBase layer), there must be a better way
  • "Del" key should delete the selected audio (same as the "Delete" context menu). Other hotkeys?
  • The black area in the envelope editor should represent the entire length of the sample, so that the left edge is "sample beginning" and the right edge is "sample end".
  • When replacing a sample with a new .wav file, the envelope should stay. Same with sample edits.
  • drag waveslot off screen to clear
  • drag other waveslot to current waveslot-layer to add
  • right click on sample length (wavelayer pane, bottom left) should switch to mm:ss:ms
Major features:
  • show both waveforms if the wav is stereo
  • allow multiple draw modes for waveform, so we can show left and right overlayed, because this takes up less space.
  • each slot and layer should have its own selection and cursor
  • CopySelection and PasteSelection Commands. (pasting a at the cursor position, moving other samples forward or mix-paste-with-original or replace-original-paste etc). Should work across slots and layers too.
  • per sample drawing tool
  • timeline above wave (for showing loop points and markers, for setting the cursor without loosing selection
  • loop and selection markers for timeline
  • reset the zoom level to a proper value after delete and trim (it changes to max zoom now which is irritating)
  • fix up envelop viewer/editor
  • .wav marker support (see Stream CreateSubSection(string name); to save more stuff into the bmx: http://svn.jeskola.net/buzzgui/BuzzGUI. ... aveSong.cs)
  • undo/redo on wave edit commands
  • bitdepth and samplerate conversion of waveslots/layers
  • multiselect slots and layers for operations
  • recycle instrument (rex/rx2) support
  • load options to ignore data (ie: midinote, loop points)
  • toolbar/menu for wave edit commands
  • export selected slots (or layers) to a template, make it importable
  • Drag a Wave onto the editor to load it but without loading it into a slot/layer
  • zoom in further then one-pixel-per-sample
  • record directly in the wave editor
  • multi-select in the left-hand pane to delete multiple slots at one etc (probably not so easy since everything in the code expects a single selected item)
Problematic features:
  • looptype and volume should also be saved/restored on destructive commands / copy paste etc. The problem is that looptype, volume are per-SLOT and not per-LAYER. There's certainly occasions where you want one layer to loop but not the other, this is currently not possible.
User avatar
magmavander
Posts: 688
Joined: Tue Nov 22, 2011 5:22 pm
Location: France
Contact:

Re: Post 1482 wavetable discussion

Post by magmavander »

OUCH!! :shock: :D
Thanks a lot.


btw : any shortcuts we should know ?
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

magmavander wrote:OUCH!! :shock: :D
Thanks a lot.


btw : any shortcuts we should know ?
not yet but we'll let you know when there are new ones. still a lot of work to do, documentation: afterwards (might not even need it if the GUI is good enough) ;)
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

question for oskari:

why does this get called twice when you load 1 wave ?

void wavetable_WaveChanged(int i)

in WavetableVM.cs
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Post 1482 wavetable discussion

Post by oskari »

UNZ wrote:question for oskari:

why does this get called twice when you load 1 wave ?

void wavetable_WaveChanged(int i)

in WavetableVM.cs
It's the way LoadWaveEx is implemented. First AllocateWave (change), then write the samples and InvalidateData (change).
User avatar
Joachip
Posts: 352
Joined: Mon Nov 21, 2011 7:21 pm
Contact:

Brilliant work, guys!!

Post by Joachip »

A few suggestions:
* The black area in the envelope editor should represent the entire length of the sample, so that the left edge is "sample beginning" and the right edge is "sample end".
* When replacing a sample with a new .wav file, the envelope should stay.
* Show both left and right (either overlayed, because this takes up less space) or left-above-right.
* "Del" key should delete the selected audio (same as the "Delete" context menu) ... it's such a habit to have that hotkey in a sample editor.
* Retain zoom level after edits.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

oskari wrote:
UNZ wrote:question for oskari:

why does this get called twice when you load 1 wave ?

void wavetable_WaveChanged(int i)

in WavetableVM.cs
It's the way LoadWaveEx is implemented. First AllocateWave (change), then write the samples and InvalidateData (change).
ah, and thats how its supposed to be ? it seems that AllocateWave ignores the bool WaveChanged parameter ?

just so we remember it, here's oskari's answer:
<@UNZOOO> it seems AllocateWave always calls wavechagned handlers, even if i set the flag to false
<@oskari> unz, it means calling machines' wavechanged handler
<@oskari> the flag only affects the MachineInterface.h event hander, not buzzgui
<@oskari> i can change it but not sure if it breaks something yet
<@UNZOOO> i would welcome changing it
<@UNZOOO> because i had to do quite a bit of gynmastics to deal with the fact its called multiple times
<@UNZOOO> maybe after we submit the new patch
<@UNZOOO> because i'm also not sure what will happen hehe
User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: Brilliant work, guys!!

Post by mantratronic »

Joachip wrote:A few suggestions:
* The black area in the envelope editor should represent the entire length of the sample, so that the left edge is "sample beginning" and the right edge is "sample end".
* When replacing a sample with a new .wav file, the envelope should stay.
* Show both left and right (either overlayed, because this takes up less space) or left-above-right.
* "Del" key should delete the selected audio (same as the "Delete" context menu) ... it's such a habit to have that hotkey in a sample editor.
* Retain zoom level after edits.
merged :)
Shro0m
Posts: 46
Joined: Tue Nov 22, 2011 7:34 am

Re: wavetable stuff

Post by Shro0m »

I found a minor bug, sometimes there's a gap on the right side of the wave when its drawn. Try trimming a wave and it becomes more prominent (see attached file).
Also, not sure if this is a bug or intentional, but when you copy a sample to next available slot, the volume slider in the param tab is set to default 0 db for the copied wave (it doesn't copy the set volume of the wave)
Attachments
wavetable.PNG
wavetable.PNG (8.59 KiB) Viewed 20353 times
User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: Post 1482 wavetable discussion

Post by mantratronic »

For Build 1483

bugs fixed:
  • 0.5 sample bug in WaveformElement (keyboard)
  • wrong layer selected after edit command
  • related to wrong-layer-after-edit-command: selected index of the datagrid still needs to be set!
  • its still possible to end up in a situation where the layerGrid has no selected element, steps to reproduce: add 2 layers, select the second, apply delete command, clear slot, load new wav
  • clearing the slot makes the waveform stay
  • 0 line gets black when you use left/right keys on keyboard (not cleared and overdrawn?)
  • nudging the selection with arrow keys while fully zoomed in moves the start/end when crossing over from one side to the other
  • don't allow cursor and selection to go out of range when moving with arrow keys
  • when you scroll back the waveform there are drawing artefacts at the end of the waveform (especially when zoomed in)
Basic features added:
  • show selection length as text, not just start and end
  • cursor and selection should be movable independantly, do not reset selection just because cursor moves etc
  • auto-convert all layers to a common format (all float if bitdepth differs, all stereo if channel count differs)
  • click the start and end of selection to decide which one to move with shift-arrowkeys
  • visualize the AdjustmentTarget with a line
  • insert silence command
  • gain command
  • double click to select all of wave
  • refactor backuplayers class to use temporarywave class, get rid of backuplayers class
User avatar
Joachip
Posts: 352
Joined: Mon Nov 21, 2011 7:21 pm
Contact:

Re: Post 1482 wavetable discussion

Post by Joachip »

Hotkey change request:
The Home and End keys currently scrolls the visible view, but in most wave editors i remember, they work something like this, and I think this would be awesome for Buzz' sample editor too:

HOME does this:

Code: Select all

If cursor_position > selection_start
{
    cursor_position = selection_start;
}
else
{
    cursor_position = 0;
}
scroll_so_cursor_becomes_visible();
END does this:

Code: Select all

If cursor_position < selection_end
{
    cursor_position = selection_end;
}
else
{
    cursor_position = sample_end;
}
scroll_so_cursor_becomes_visible();
Or in english: Pressing Home will bring the cursor to the beginning of the selection or, if we're already past that point, to the beginning of the sample. End does the same in the other direction.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Post 1482 wavetable discussion

Post by IXix »

The buttons between the wave editor and the layers pane don't do anything yet, is that right?
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Post 1482 wavetable discussion

Post by IXix »

Most editors assume that if there's no selection then you want to process the whole file. Could we get that?
User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: Post 1482 wavetable discussion

Post by mantratronic »

IXix wrote:The buttons between the wave editor and the layers pane don't do anything yet, is that right?
Yes, we'll make them functional as we go.
IXix wrote:Most editors assume that if there's no selection then you want to process the whole file. Could we get that?
It might be better to wait for undo/redo to be implemented here, as you could delete your layer by accident. Also some of the commands (insert silence, trim, etc) wouldn't make sense, so we'd have think about how to split them up or something.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Post 1482 wavetable discussion

Post by IXix »

Jolly good. Splendid work. As you were.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

questions for oskari:
-does the name and path of a wave layer get saved into the bmx ? (it seems that it doesn't even tough i specify it when i use allocatewave(). for wave slots it works.
-is there a way to access the name of a wave layer in buzz gui ? i see the path, but not the name. and even the layer path doesn't seem to get saved into the bmx ?
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Post 1482 wavetable discussion

Post by oskari »

UNZ wrote:questions for oskari:
-does the name and path of a wave layer get saved into the bmx ? (it seems that it doesn't even tough i specify it when i use allocatewave(). for wave slots it works.
-is there a way to access the name of a wave layer in buzz gui ? i see the path, but not the name. and even the layer path doesn't seem to get saved into the bmx ?
There's only path and name per wave, not per layer. It's a "feature" of buzz and the file format. Layers don't work at all if you save as .bmw so it's always been a bit broken.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

oskari wrote:
UNZ wrote:questions for oskari:
-does the name and path of a wave layer get saved into the bmx ? (it seems that it doesn't even tough i specify it when i use allocatewave(). for wave slots it works.
-is there a way to access the name of a wave layer in buzz gui ? i see the path, but not the name. and even the layer path doesn't seem to get saved into the bmx ?
There's only path and name per wave, not per layer. It's a "feature" of buzz and the file format. Layers don't work at all if you save as .bmw so it's always been a bit broken.
would it be possible to save name and path for layers without breaking the bmx file format ? would be really really cool, i have everything ready in the GUI to display their names and paths etc.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Post 1482 wavetable discussion

Post by UNZ »

--- Build 1485 - Saturday, 18 May 2013 11:35:24 UTC
- wavetable stuff by antonio and mtronic:
- fixed insert 2 layers, delete from layer 2, then load a new sample into the SLOT, nothing is selected in the layergrid
- fixed copy pasting a slot and then editing without clicking the slot generates an exception
- fixed load a bmx with multiple layers in a slot, go to wavetable, try to edit: exception. (selected slot seems to not be set)
- fixed copy paste slot / layer: loop start is not preserved anymore (loop end works..)
- fixed copy paste to clipboard
- show Sample Format and Channel Count
- preserve the name and path of layers when editing (but not stored in the bmx yet)
- refactored copy/paste of slots to use TemporaryWave so it preserves names of layers
- load layer(s)
- save layer
- delete a layer
- copy from layer
- paste to layer (but not from clipboard yet)
- realign layer text to right
- timeline above wave: set the cursor position when clicking on it without losing selection)
User avatar
thOke
Posts: 343
Joined: Thu Nov 24, 2011 7:14 am

Re: Post 1482 wavetable discussion

Post by thOke »

thx for all the work on the wavetable :D

think i found a bug - don't know if it is related to the latest wavetable modifications:
when i save a file as a template with zipped samples and drop that back into buzz,
the samples are always played back as 32 bit even if they originally had a different bitrate.
Post Reply