Search

Lib.rs

› Multimedia › Audio
#audio-processing #intermediate-representation #daw #parser #cranelift #kasl-ir #translates #playground #re-exports

kasl

Parses and translates the kasl code into KASL-IR, an intermediate representation for KASL

Owned by Hatya-mouse.

  • Install
  • API reference
  • GitHub (hatya-mouse)
  • Home (hatya.dev)

35 releases

Uses new Rust 2024

new 0.2.29 May 5, 2026
0.2.28 May 5, 2026
0.2.24 Apr 25, 2026
0.1.4 Mar 29, 2026

#986 in Audio


Used in kaslc

Apache-2.0

485KB
9K SLoC

kasl

kasl is an umbrella crate that includes re-exports of kasl-core and backends (currently there is only Cranelift backend).

About the KASL language

KASL is a programming language designed for audio processing. The KASL language itself is implemented as a simple numerical calculation language with unique input, output and state variables, and can be used for audio processing with my Knodiq DAW, which is under development.

How to Run the KASL Programs

Currently, there are no hosts that can run KASL program for audio processing. However, you can run KASL code for genuine numerical calculation and there two ways to run it:

  • kaslc — A command-line tool to run KASL programs locally.
  • kasl.hatya.dev — Features online KASL playground where you can run KASL programs without installation.

Examples

Example 1 — Fibonacci

The following program calculates the fibonacci sequence by using state variable to store the last two numbers. I recommend running this program on the online playground, since it can show the outputs for each iterations, while kaslc can only show the output from the last iteration.

import std

state a = 0
state b = 1
output result = 0

func main() {
    result = a
    let next = a + b
    a = b
    b = next
}

Example 2 — Audio Processing

Here's an example KASL code which calculates the value of the sine function. The program outputs an output variable called out.

import std
import math/float

state x = 0.0
output y = 0.0

func main() {
    y = float.sin(x)
    x = x + 0.1
}

Dependencies

~3–15MB
~145K SLoC

  • kasl-core
  • cranelift? kasl-cranelift-backend
  • kasl-ir
Related: kaslc, kasl-core, kasl-cranelift-backend, kasl-ir
See also: webrtc-audio-processing, fundsp, bliss-audio-aubio-rs, audio-processor-traits, sonora, webrtc-audio-processing-sys, audio-processor-testing-helpers, audio-processor-metronome, audio-processor-bitcrusher, audio-processor-utility, audio-processor-dynamics

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.