Crates.io | mimium-lang |
lib.rs | mimium-lang |
version | 2.2.1 |
source | src |
created_at | 2024-11-14 10:15:15.962538 |
updated_at | 2024-12-10 09:22:23.434966 |
description | mimium(minimal-musical-medium) an infrastructural programming language for sound and music. |
homepage | |
repository | https://github.com/tomoyanonymous/mimium-rs/ |
max_upload_size | |
id | 1447616 |
size | 356,443 |
A programming language as an infrastructure for sound and music
https://mimium.org (A documentation for v2 is under preparation!)
mimium(MInimal-Musical-medIUM) is a programming language for sound and music.
mimium is made to be an infrastructure for distributing music in a form of a source code, not only a tool for musicians and programmers.
Its semantics are inspired from several modern programming languages for sound such as Faust, Kronos and Extempore.
A minimal example below generates a sinewave of 440Hz.
// minimal.mmm
let twopi = 3.141595*2.0
fn dsp(){
sin(now * 440.0 * twopi / samplerate)
}
A special keyword self
can be used in function, which is a last return value of the function.
This enables an easy and clean expression of feedback connection of signal chain.
fn lpf(input,fb){
(1.0-fb)*input + fb*self
}
You can also write a note-level processing by using @
operator which specifies the time when the function will be executed. Another special keyword now
can be used for getting current logical time.
An event scheduling is sample-accurate because the scheduler is driven by an audio driver.
let freq = 440.0
fn noteloop(){
freq = (freq+1200.0)%4000.0
noteloop@(now + 1.0*samplerate)
}
Also, the language design is based on the call by value lambda calculus, so the higher-order functions are supported to express generative signal graph like replicatiing multiple oscillators like the code below.
fn replicate(n,gen:()->(float,float)->float){
if (n>0.0){
let c = replicate(n - 1.0,gen)
let g = gen()
|x,rate| g(x,rate) + c(x+100.0,rate+0.1)
}else{
|x,rate| 0
}
}
mimium is a statically typed language but the most of type annotations can be omitted by the type inference system. If you are interested in the theoritical background of mimium, see the paper about mimium.
This repository is for a mimium version 2, all the code base is rewritten in Rust while the original was in C++, and semantics of the language was re-designed. The codes are still very under development.
An easy way to start mimium is using Visual Studio Code Extension. You can run opening .mmm
file from the command palette.
Also you can download the latest CLI tool mimium-cli from GitHub Release.
If you are Rust developer, you can install mimium-cli by cargo install mimium-cli
as well.
See Development section.
There's no concrete way for contributing to the mimium project for now but any type of contribution (bugfix, code refactoring, documentation, showing the usecases, etc).
(However, because the mimium is still early stage of the development and there's much things to do, the proposal or request for new feature without Pull Request will not be accepted.)
Take a look at Code of Conduct before you make contribution.
©️ the mimium development community.
The source code is licensed under the Mozilla Puclic License 2.0 (MPL2.0).
Tomoya Matsuura/松浦知也 https://matsuuratomoya.com/en
This project is supported grants and scholarships as follows.
This list contains the contributers from v1 development, documentation and financial sponsors(via github sponsor).
See GitHub Issues with "bug" tag.