omni
所属分类:collect
开发工具:Nim
文件大小:0KB
下载次数:0
上传日期:2022-05-28 14:51:13
上 传 者:
sh-1993
说明: 用于低级音频编程的DSL。,
(DSL for low-level audio programming.,)
文件列表:
CHANGELOG.md (10143, 2022-05-28)
LICENSE (1078, 2022-05-28)
config.nims (343, 2022-05-28)
examples/ (0, 2022-05-28)
examples/Grain.omni (2243, 2022-05-28)
examples/OmniAnalogDelay.omni (712, 2022-05-28)
examples/OmniBuffer.omni (246, 2022-05-28)
examples/OmniGranulatorAsync.omni (1560, 2022-05-28)
examples/OmniGranulatorSync.omni (1245, 2022-05-28)
examples/OmniSVF.omni (772, 2022-05-28)
examples/OmniSaw.omni (560, 2022-05-28)
examples/OmniSine.omni (170, 2022-05-28)
omni.nim (16071, 2022-05-28)
omni.nimble (2258, 2022-05-28)
omni_lang/ (0, 2022-05-28)
omni_lang/omni_lang.nim (2111, 2022-05-28)
omni_lang/omni_lang.nimble (1285, 2022-05-28)
omni_lang/omni_lang/ (0, 2022-05-28)
omni_lang/omni_lang/core/ (0, 2022-05-28)
omni_lang/omni_lang/core/lang/ (0, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_alias.nim (1286, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_call_types.nim (1263, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_def.nim (24739, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_export_io.nim (2704, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_finder.nim (14678, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_init.nim (25869, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_invalid.nim (2105, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_io.nim (106887, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_locks.nim (3016, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_loop.nim (9343, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_macros.nim (1905, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_macros_utilities.nim (1575, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_parser.nim (86523, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_perform.nim (10900, 2022-05-28)
omni_lang/omni_lang/core/lang/omni_struct.nim (41891, 2022-05-28)
... ...
![Build Status (master)](https://github.com/vitreo12/omni/actions/workflows/omni.yml/badge.svg?branch=master)
Omni is a cross-platform DSL (Domain Specific Language) for low level audio programming.
It aims to be a new, expressive and easy to use programming language to code audio algorithms in.
Omni leverages nim and C to compile code to self-contained static or shared libraries that can then be loaded and used anywhere. So far, two wrappers have already been written to compile omni code to [SuperCollider](https://supercollider.github.io/) UGens ([omnicollider](https://github.com/vitreo12/omnicollider)), or [Max 8](https://cycling74.com/) objects ([omnimax](https://github.com/vitreo12/omnimax)).
Also, a basic syntax highlighting [VSCode](https://code.visualstudio.com/) plugin is available by simply looking for [omni](https://github.com/vitreo12/vscode-omni) in the Extensions Marketplace.
## **Requirements**
1) [nim](https://nim-lang.org/)
2) [git](https://git-scm.com/)
### **Linux**
Refer to your distribution's package manager and make sure you've got `nim` and `git` installed.
### **MacOS**
To install dependencies on MacOS it is suggested to use a package manager like [brew](https://brew.sh/).
After `brew` has been installed, run the following command in the `Terminal` app to install `nim`:
brew install nim
Then, make sure that the `~/.nimble/bin` directory is set in your shell `$PATH`.
If using bash (the default shell in MacOS), you can simply run this command:
echo 'export PATH=$PATH:~/.nimble/bin' >> ~/.bash_profile
### **Windows:**
To install dependencies on Windows it is suggested to use a package manager like [chocolatey](https://community.chocolatey.org/).
After `chocolatey` has been installed, open `PowerShell` as administrator and run this command to install `nim` and `git`:
choco install nim git -y
## **Installation**
To install `omni`, simply use the `nimble` package manager (it comes bundled with the `nim` installation):
nimble install omni -y
## **Usage**
Once you've installed omni, the `omni` executable will be placed in your `~/.nimble/bin` folder.
Run `omni -h` to get help on all the available flags.
When running the `omni` compiler, the output is either a static or shared library (depending on the `--lib` flag). Along with it, an `omni.h` file (depending on the `--exportHeader` flag) containing all the callable functions in the shared/static library will be exported.
omni ~/.nimble/pkgs/omni-0.4.1/examples/OmniSaw.omni -o:./
This command will compile an antialiased sawtooth oscillator (part of the examples) to a shared library (`libOmniSaw.so/dylib/dll`), together with a header file (`omni.h`), in the current folder.
## **Sine oscillator example**
`Sine.omni`
```nim
ins: 1
outs: 1
init:
phase = 0.0
sample:
incr = in1 / samplerate
out1 = sin(phase * TWOPI)
phase = (phase + incr) % 1.0
```
To compile it, simply run:
omni Sine.omni
## **Website / Docs**
Check omni's [website](https://vitreo12.github.io/omni).
近期下载者:
相关文件:
收藏者: