Bork

Spectral Onset & Classification System

bork~ is a unified system for percussive onset detection and sound classification. It features spectral analysis of sounds to discriminate onsets and classification according to a template.

Overview

Bork provides a complete workflow for interactive audio applications:

Workflow for onset Sound analysis to real-time detection

Part 1: bork~ for Max/MSP & Pd

The bork~ external provides spectral onset detection and template matching capabilities within Max/MSP and Pure Data

Installation & Basic Usage

// Basic bork~ object
bork~

// Configure analysis parameters
bork~ 512 128 11    // [npoints hop nfilters]
bork~ 256 64 11     // Faster response
bork~ 1024 256 11   // Higher frequency resolution

Object Structure

Inlets/Outlets:

Core Methods:

sensitivity 0.7     // Detection threshold (0-1, default 0.5)
learn 5            // Learn templates (5 samples per sound)
forget             // Remove last template
write drums.txt    // Save template library
read kicks.txt     // Load templates
debug 1            // Enable debug output
print              // Display current configuration
bang               // Re-arm detector

Template Creation Workflow

  1. Setup Analysis

    bork~ 512 128 11
    sensitivity 0.6
    
  2. Learn Sound Templates

    // Learn drum kit sounds
    learn 4
    Play: kick drum 4 times
    // bork~ automatically advances to next template
    Play: snare drum 4 times
    etc
    
  3. Export Template Library

    write my_sounds.txt
    

Part 2: Bork Metasound Node for Unreal Engine

The Bork Node brings real-time spectral analysis to Unreal Engine's Metasounds system, using the templates created in Max/MSP.

Input Configuration

ParameterRangeDescription
Template FileFile pathLocation of .txt template file
Hi Thresh0.0001+High threshold for onset detection
Lo Thresh0.0001+Low threshold for re-arming
Min Vel0.0+Minimum velocity to output
Mask Time0+ msMask time in milliseconds
Mask Decay0.0-1.0Mask decay factor
Debounce Decay0.0-1.0Prevents rapid re-triggering

Output Data

OutputTypeUse Case
Onset TriggerTriggerPrecise timing for sound/events
Onset CounterIntegerSequential onset count
Instrument IDIntegerIdentifies which template matched
VelocityFloatAttack intensity (onset detection)
RT VelocityFloatContinuous energy stream (every frame)
TemperatureFloatSpectral brightness/centroid
Raw SpectrumFloat ArrayPer-band energy values

Gameplay Integration:

Real-time sound detection driving gameplay systems

Core Features

Spectral Analysis Engine

Template Matching System

Performance Characteristics

Template File Format

bork~ uses a simple text-based template format that's portable between Max and Unreal:

12.45 8.91 5.22 3.10 1.80 0.95 0.51 0.28 0.15 0.08 0.04
5.10 10.85 15.20 8.45 4.10 2.05 1.02 0.51 0.25 0.12 0.06  
2.05 15.50 8.20 3.10 1.55 0.80 0.40 0.20 0.10 0.05 0.02

Each line represents one sound template with normalized spectral band values. The number of values per line must match the number of filters configured (default: 11).


Best Practices

Template Creation (Max/MSP)

Performance Tuning (Unreal Engine)

Real-time Applications


Technical Specifications

Analysis Parameters

Max/MSP Configuration

Unreal Engine Implementation

System Requirements


Inspired by the real-time audio analysis techniques described in the article: Puckette, M. S., Apel, T., & Zicarelli, D. D. (1998). Real-time audio analysis tools for Pd and MSP. International Computer Music Conference, ICMC Proceedings.