Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wirebang

A node graph for one-shot SFX, written in Odin. The graph is the editor. The Odin it emits is the sound.

Preview in the editor runs the graph through Wirebang's interpreter. Live export writes a play_* procedure that talks to miniaudio — the same vendor package an Odin game already has. The game does not import Wirebang. WAV is a fallback if you would rather ship a sample.

License

The editor is MIT.

You own what you make. Copied or downloaded Odin and WAV files are yours. You may copyright them, keep them closed-source, and ship them in a commercial game. There is no attribution requirement.

Build

Requires Odin with vendor:miniaudio and vendor:raylib.

odin test wirebang
odin run cmd/sync_sounds
odin build cmd/play -out:bin/play.exe
odin build cmd/editor -out:bin/editor.exe

Use the editor

bin/editor

The editor draws with raylib and plays through miniaudio. It does not call raylib's InitAudioDevice.

  1. Add nodes from the left palette (oscillator, noise, filter, gain, shaper, panner).
  2. Click an output jack, then an input jack, to cable them. Right-click a cable to cut it.
  3. Select a node and drag its knobs (Shift = fine). Space plays the patch.
  4. Live writes a play_* procedure to export/. Bake writes a WAV if you would rather drop a sample on an existing loader.

The current graph is saved to wirebang-patch.json (editor only). Drop an exported .odin in sounds/ and pick it from the library to reopen the graph from the code.

Play from the command line

bin/play zap
bin/play thump
bin/play whoosh
bin/play click
bin/play hit
bin/play pickup

Use in a game

Copy the exported file into your tree. It depends on vendor:miniaudio and the Odin core library — not Wirebang.

import ma "vendor:miniaudio"
import sfx "export" // or paste play_zap into your package

eng: ma.engine
ma.engine_init(nil, &eng)
defer ma.engine_uninit(&eng)

sfx.play_zap(&eng)

If you already have a ma.engine, pass that. Keep the engine alive until the one-shot finishes; play_* copies PCM into a miniaudio sound and returns.

Handwritten files in the same dialect (ma.waveform_config_init, ma.noise_config_init, biquad_sweep, gain_env, …) reopen as graphs. Arbitrary Odin that wanders off-dialect will not.

sounds/ is the example library (Zap, Thump, Whoosh, Click, Hit, Pickup). Treat those files the same way as anything you export: use them, change them, or ignore them.

WAV is optional. If you do not want to run the DSP, Bake and play the file with whatever you already use (ma_decoder, raylib LoadSound).

Scope

In: short procedural SFX, live preview, miniaudio play-proc export, optional WAV bake.

Out: a DAW, sample playback engine, or a shipped mixer.

About

Node graph for one-shot SFX in Odin. Live preview through miniaudio; export a Patch you can play or bake in-game.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages