diff --git a/ABStemPlayer-UI.png b/ABStemPlayer-UI.png new file mode 100644 index 0000000..18e7b44 Binary files /dev/null and b/ABStemPlayer-UI.png differ diff --git a/ABStemPlayer/Converters/PlayPauseGeometryConverter .cs b/ABStemPlayer/Converters/PlayPauseGeometryConverter .cs index 67dc6a9..5a30151 100644 --- a/ABStemPlayer/Converters/PlayPauseGeometryConverter .cs +++ b/ABStemPlayer/Converters/PlayPauseGeometryConverter .cs @@ -12,10 +12,15 @@ public class PlayPauseGeometryConverter : IValueConverter // Pause icon if (isPlaying) - return Geometry.Parse("M 12 8 L 18 8 L 18 32 L 12 32 Z M 22 8 L 28 8 L 28 32 L 22 32 Z"); + return Geometry.Parse(""" + M10 5C10 3.34315 8.65686 2 7 2H5C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H7C8.65686 22 10 20.6569 10 19V5Z + M8 5C8 4.44772 7.55229 4 7 4H5C4.44772 4 4 4.44772 4 5V19C4 19.5523 4.44772 20 5 20H7C7.55229 20 8 19.5523 8 19V5Z + M22 5C22 3.34315 20.6569 2 19 2H17C15.3431 2 14 3.34315 14 5V19C14 20.6569 15.3431 22 17 22H19C20.6569 22 22 20.6569 22 19V5Z + M20 5C20 4.44772 19.5523 4 19 4H17C16.4477 4 16 4.44772 16 5V19C16 19.5523 16.4477 20 17 20H19C19.5523 20 20 19.5523 20 19V5Z + """); // Play icon - return Geometry.Parse("M 10 8 L 32 20 L 10 32 Z"); + return Geometry.Parse("M5.46484 3.92349C4.79896 3.5739 4 4.05683 4 4.80888V19.1911C4 19.9432 4.79896 20.4261 5.46483 20.0765L19.1622 12.8854C19.8758 12.5108 19.8758 11.4892 19.1622 11.1146L5.46484 3.92349ZM2 4.80888C2 2.55271 4.3969 1.10395 6.39451 2.15269L20.0919 9.34382C22.2326 10.4677 22.2325 13.5324 20.0919 14.6562L6.3945 21.8473C4.39689 22.8961 2 21.4473 2 19.1911V4.80888Z"); } public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException(); diff --git a/ABStemPlayer/Views/PlaybackControls.axaml b/ABStemPlayer/Views/PlaybackControls.axaml index 9cc6427..f02eb92 100644 --- a/ABStemPlayer/Views/PlaybackControls.axaml +++ b/ABStemPlayer/Views/PlaybackControls.axaml @@ -37,47 +37,43 @@ - @@ -147,14 +135,14 @@ Foreground="#f0f0f0" VerticalAlignment="Center" Grid.Column="0" - Margin="20,10,8,0"/> + Margin="20,4,8,0"/> + Margin="0,4,8,0"/> diff --git a/README.md b/README.md new file mode 100644 index 0000000..275286e --- /dev/null +++ b/README.md @@ -0,0 +1,195 @@ +# ABStemPlayer + +ABStemPlayer is a Avalonia 12 audio player application built with .NET, designed for +real‑time media processing, modern UI rendering, and cross‑platform deployment. +The project focuses on predictable performance, clean architecture, and production‑grade +engineering practices. + +![ABStemPlayer-UI](ABStemPlayer-UI.png) + +## Features + +- Stem splitting and mixing + - Drums + - Bass + - Other + - Vocals + - Guitar + - Piano +- Turn each stem on and off independently +- Pan stems left or right +- Audio player with A/B looping and speed control + +**Techy stuff:** + +- .NET 10 +- Cross‑platform UI built with Avalonia 12 +- ONNX Runtime integration for ML inference +- htdemucs_6s.onnx for stem splitting + +> YOU HAVE TO DOWNLOAD htdemucs_6s.onnx YOURSELF DUE TO GITHUB SIZE LIMITATIONS +> https://huggingface.co/StemSplitio/htdemucs-6s-onnx/blob/main/htdemucs_6s.onnx + +## Requirements + +- .NET 10 or later +- Avalonia 12 +- ONNX Runtime (CPU or GPU) +- FFmpeg + +# HTDemucs 6‑Stem ONNX Model Guide + +## Overview + +**HTDemucs‑6s** is a state‑of‑the‑art music source separation model capable of splitting a stereo mix into **six distinct stems**: + +- Drums +- Bass +- Vocals +- Guitar +- Piano +- Other + +The model is designed for **high‑fidelity separation**, **low artifacts**, and **robust performance** on modern CPU inference engines. + +--- + +## Required Model File + +``` +File Name: htdemucs_6s.onnx +Placement: Place the model inside your application's data directory: /Data/htdemucs_6s.onnx +``` + +### Why this model +This ONNX export is specifically built for: + +- **CPU inference** +- **float32 audio processing** +- **6‑stem output** +- **44.1 kHz stereo input** + +Using any other Demucs variant (4‑stem, hybrid, GPU‑optimized, etc.) will result in incompatible tensor shapes. + +--- + +## Model Input Specification + +### Input Tensor Name +``` +mix +``` + +### Input Shape +``` +[1, 2, N] +``` + +Where: + +- `1` = batch size +- `2` = stereo channels +- `N` = number of audio samples in the segment + +### Audio Requirements + +- **Sample rate:** 44,100 Hz +- **Channels:** Stereo +- **Format:** float32 PCM +- **Normalization:** Standard waveform scaling + +--- + +## Model Output Specification + +### Output Tensor Name +``` +stems +``` + +### Output Shape +``` +[1, 6, 2, N] +``` + +Where: + +- `1` = batch +- `6` = stems +- `2` = stereo +- `N` = same segment length as input + +Each stem is returned as a stereo float32 waveform. + +--- + +## Technical Details + +HTDemucs‑6s is based on the **Hybrid Demucs architecture**, combining: + +- Convolutional encoder/decoder +- Multi‑band processing +- Transformer blocks for long‑range context +- Overlap‑add reconstruction +- Six‑head output layer + +This design allows the model to preserve transients, maintain stereo imaging, and reduce musical bleed between stems. + +### Supported ONNX Operations + +The model uses only standard ONNX ops, including: + +- Conv / ConvTranspose +- LayerNorm / GroupNorm +- Multi‑Head Attention +- GELU / ReLU +- Reshape / Transpose +- Basic arithmetic ops + +This ensures full compatibility with CPU execution providers. + +--- + +## Downloading the Correct Model + +Make sure you download the **HTDemucs 6‑stem ONNX export**, not: + +- 4‑stem Demucs +- Hybrid Demucs v3/v4 PyTorch checkpoints +- GPU‑optimized ONNX models +- Models with different sample rates + +If you need a verified download link, choose: +- **https://huggingface.co/StemSplitio/htdemucs-6s-onnx/blob/main/htdemucs_6s.onnx** + +--- + +## Verification + +To ensure you have the correct model, check: + +| Property | Expected | +|---------|----------| +| File name | `htdemucs_6s.onnx` | +| Input tensor | `mix` | +| Input shape | `[1, 2, N]` | +| Output tensor | `stems` | +| Output shape | `[1, 6, 2, N]` | +| Sample rate | 44.1 kHz | +| Channels | Stereo | +| Stems | 6 | +| Execution | CPU | + +SHA256: `48F8E84945579F8AB340E083339E9221E03785DBE733A52C388200B6D3CA779A` + +--- + +# Copyright notices + +## Icons + +``` +COLLECTION: Gentlecons Interface Icons +LICENSE: CC Attribution License +AUTHOR: Konstantin Filatov +``` \ No newline at end of file