Skip to content

mimium-org/mimium

Repository files navigation

mimium

a programming language as an infrastructure for sound and music

stable: build status(master) dev: build status(dev) Codacy Badge

website badge Gitter License Badge-MPL2.0

mimium_logo_slanted

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 syntax and semantics are technically inspired from several modern programming languages for sound such as Faust and Extempore.

You can write various expression from low-level signal processing to note-level processing with a simple syntax and high-performance. Since all the code is executed with JIT compilation using LLVM which has an equivalent performance as the dsp code written in general purpose languages such as C++.

A minimal example below generates a sinewave of 440Hz.

// minimal.mmm
twopi = 3.141595*2
sr = 48000
fn dsp(){
    out = sin(now * 440 * twopi / sr)
    return (out,out)
}

To run the code, type mimium path/minimal.mmm on your terminal application.

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:float,fb:float){    
    return (1-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.

freq = 440
fn noteloop()->void{
    freq = (freq+1200)%4000
    noteloop()@(now + 48000)
}

More specific infos about the language are on mimium Website.

Installation

mimium can be run on macOS(x86), Linux(ALSA backend), Windows(WASAPI backend). WebAssemby backend will be supported for future.

An easiest way to getting started is to use Visual Studio Code extension. Search "mimium" in extension tab and install it. When you create & open the file with the file extension .mmm, you will be asked to install the latest binary. The extension also contains syntax highlights for .mmm files.

On macOS and Linux, installation via Homebrew is recommended.

You can install mimium with a command as follows.

brew install mimium-org/mimium/mimium

Also, you can get a built binary from release section.

Build from Source

To build on Windows, you need to use MSYS2. For details, check GitHub Action Workflow and documentations on official website (Installation and Setting up development environment).

Installing Dependencies

  • cmake
  • bison >= 3.3
  • flex
  • llvm >= 11
  • Libsndfile
  • RtAudio(cmake will automatically download)

macOS

Install homebrew and XCode Commandline Tools beforehand.

brew install cmake flex bison libsndfile llvm ninja

Linux(Ubuntu)

On Linux(Ubuntu), we recommend to install llvm using an automatic installation script in https://apt.llvm.org/ because llvm package in apt does not contain some libs required by llvm-config --libs

pushd /tmp && wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh && popd
sudo apt-get install libalsa-ocaml-dev libfl-dev libbison-dev libz-dev libvorbis-dev libsndfile-dev libopus-dev gcc-9 ninja-build

Windows(MSYS2,mingw64)

Install msys2 by following instruction on the website. Launch Mingw64 terminal.

pacman -Syu git flex bison mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-libsndfile mingw64/mingw-w64-x86_64-opus mingw-w64-x86_64-ninja mingw-w64-x86_64-llvm

Clone Repository, build and install

git clone --recursive https://github.com/mimium-org/mimium
cd mimium
# configure. if you want to install to specific directory, add -DCMAKE_INSTALL_PREFIX=/your/directory
cmake -Bbuild
# build
cmake --build build -j
# install
cmake --build build --target install

Author

Tomoya Matsuura/松浦知也

https://matsuuratomoya.com/en

The source code is lisenced under Mozilla Puclic License 2.0.

The source code contains third party libraries with BSD-like lincenses, see COPYRIGHT.

Acknowledgements

This project is supported by all the contributers, Sponsors, grants and scholarships as follows.

  • 2019 Exploratory IT Human Resources Project (The MITOU Program) by IPA: INFORMATION-TECHNOLOGY PROMOTION AGENCY, Japan.
  • Kakehashi Foundation

Contributors

All Contributors


Shinichi Tanaka

📖 💻

kyo

📖

Baku 麦

💵

Yuichi Yogo

💵

Ayumu Nagamatsu

💵

zigen

💵

Hitoshi Takeuchi

💵

Inqb8tr-jp

💵 🚇