VSE waveform drawing in sound strip #115274

Closed
opened 2023-11-22 16:39:47 +01:00 by Francesco Siddi · 3 comments

Currently the rendering of waveforms in the VSE looks as follows:

image

In this proposal, we represent the wave as "vertical bars". The bars have fixed width, and increase or decrease in number depending on the horizontal zoom level. Once we reach a certain zoom level, we can optionally draw only the outline of the bars.

Furthermore, depending on the zoom level (or even a view setting) we represent the waveform as an actual oscillating wave, or we mirror the negative values in order to create a symmetric representation of the wave. In the case of symmetric representation, the wave can also be displayed as "half", to show more detail.

image

Currently the rendering of waveforms in the VSE looks as follows: ![image](/attachments/5c2a0245-46c2-4e67-8f66-102aec7ff8c5) In this proposal, we represent the wave as "vertical bars". The bars have fixed width, and increase or decrease in number depending on the horizontal zoom level. Once we reach a certain zoom level, we can optionally draw only the outline of the bars. Furthermore, depending on the zoom level (or even a view setting) we represent the waveform as an actual oscillating wave, or we mirror the negative values in order to create a symmetric representation of the wave. In the case of symmetric representation, the wave can also be displayed as "half", to show more detail. ![image](/attachments/6e984ecc-da7e-4aa2-98ed-64e1be147dce)
142 KiB
458 KiB
Francesco Siddi added the
Type
Design
label 2023-11-22 16:39:47 +01:00
Francesco Siddi added this to the Video Sequencer project 2023-11-22 16:39:49 +01:00

Some notes so they don't get lost in the chat:

  • Blender only samples sounds at 250 Hz for display, current code literally can't display more detail. This is deemed acceptable for now, primarily because VSE does not allow sub-frame audio placement anyway, so sample-level precision for display is not really needed.
  • Blender does not only display the waveform, but also displays RMS level (whiter part; similar is done in Audacity just there is lighter blue part) and indicates "clipped" parts in vertical red line.

As part of trying to optimize VSE timeline drawing performance, I've looked at waveform drawing. Doing the "square" like proposed above is actually a bit faster compared to current code. Here's what I have now in a local change; current blender vs modified code that displays "square" shape:

wave1.png

wave2.png

You can notice that the squares do not reach as high peaks as the "current" code. That is actually a bug in current code; it often overshoots the actual sample values when trying to interpolate them (which is partially why when zoomed in the wave looks kinda weird). It also results in sometimes the waveform display showing red "clipped" parts when in fact there aren't any (again due to same issue; it interpolates the samples wrong).

Some notes so they don't get lost in the chat: - Blender only samples sounds at 250 Hz for display, current code literally can't display more detail. This is deemed acceptable for now, primarily because VSE does not allow sub-frame audio placement anyway, so sample-level precision for display is not really needed. - Blender does not only display the waveform, but also displays RMS level (whiter part; similar is done in Audacity just there is lighter blue part) and indicates "clipped" parts in vertical red line. As part of trying to optimize VSE timeline drawing performance, I've looked at waveform drawing. Doing the "square" like proposed above is actually a bit faster compared to current code. Here's what I have now in a local change; current blender vs modified code that displays "square" shape: ![wave1.png](/attachments/78f60794-d13d-4b55-8a52-7f1a5270ecac) ![wave2.png](/attachments/fa7558a1-be2a-47d9-b45c-4f70fd2761bc) You can notice that the squares do not reach as high peaks as the "current" code. That is actually _a bug_ in current code; it often overshoots the actual sample values when trying to interpolate them (which is partially why when zoomed in the wave looks kinda weird). It also results in sometimes the waveform display showing red "clipped" parts when in fact there aren't any (again due to same issue; it interpolates the samples wrong).
Author
Member

As a follow up to this implementation, here is a proposal for how handle waveforms display in the VSE Overlays popover.

image

This mockup addressed three topics:

  • use a more consistent radio selection for waveform display, not an enum-radio hybrid
  • enable waveform display (on) by default, as performance should now be good enough.
  • add a new "Waveform Style" radio

Each topic should be addressed in its own commit.
Informally reviewed with Sergey and @dfelinto.

As a follow up to this implementation, here is a proposal for how handle waveforms display in the VSE Overlays popover. ![image](/attachments/33476068-c341-4eb9-9d90-dfbf2b4a0bf2) This mockup addressed three topics: - use a more consistent radio selection for waveform display, not an enum-radio hybrid - enable waveform display (on) by default, as performance should now be good enough. - add a new "Waveform Style" radio Each topic should be addressed in its own commit. Informally reviewed with Sergey and @dfelinto.
Aras Pranckevicius self-assigned this 2023-12-19 06:04:14 +01:00

All the items are done, I think!

All the items are done, I think!
Blender Bot added the
Status
Archived
label 2023-12-20 19:52:42 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#115274
No description provided.