Skip to content

Commit

Permalink
Merge pull request #54 from mimium-org/release/0.3.1
Browse files Browse the repository at this point in the history
release/0.3.1
  • Loading branch information
tomoyanonymous authored Feb 25, 2021
2 parents ea6f763 + 0907fd2 commit ff9b237
Show file tree
Hide file tree
Showing 45 changed files with 610 additions and 272 deletions.
87 changes: 87 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"contributorsPerLine": 7,
"skipCi": true,
"contributors": [
{
"login": "t-sin",
"name": "Shinichi Tanaka",
"avatar_url": "https://avatars.githubusercontent.com/u/4403863?v=4",
"profile": "https://t-sin.github.io",
"contributions": [
"doc"
]
},
{
"login": "syougikakugenn",
"name": "kyo",
"avatar_url": "https://avatars.githubusercontent.com/u/74606612?v=4",
"profile": "http://deepdrilledwell.secret.jp/ddw/",
"contributions": [
"doc"
]
},
{
"login": "baku89",
"name": "Baku 麦",
"avatar_url": "https://avatars.githubusercontent.com/u/2124392?v=4",
"profile": "http://baku89.com",
"contributions": [
"financial"
]
},
{
"login": "yuichkun",
"name": "Yuichi Yogo",
"avatar_url": "https://avatars.githubusercontent.com/u/14039540?v=4",
"profile": "https://github.com/yuichkun",
"contributions": [
"financial"
]
},
{
"login": "nama-gatsuo",
"name": "Ayumu Nagamatsu",
"avatar_url": "https://avatars.githubusercontent.com/u/7838131?v=4",
"profile": "http://ayumu-nagamatsu.com",
"contributions": [
"financial"
]
},
{
"login": "zigen",
"name": "zigen",
"avatar_url": "https://avatars.githubusercontent.com/u/3610296?v=4",
"profile": "https://horol.org",
"contributions": [
"financial"
]
},
{
"login": "hitoshitakeuchi",
"name": "Hitoshi Takeuchi",
"avatar_url": "https://avatars.githubusercontent.com/u/6305267?v=4",
"profile": "http://hitoshitakeuchi.com",
"contributions": [
"financial"
]
},
{
"login": "Inqb8tr-jp",
"name": "Inqb8tr-jp",
"avatar_url": "https://avatars.githubusercontent.com/u/79005925?v=4",
"profile": "https://github.com/Inqb8tr-jp",
"contributions": [
"financial",
"infra"
]
}
],
"projectName": "mimium",
"projectOwner": "mimium-org",
"repoType": "github",
"repoHost": "https://github.com"
}
9 changes: 6 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
build:
needs: prebuild
if: "!contains( needs.prebuild.outputs.lastmessage , '[ci skip]')"
if: "!contains( needs.prebuild.outputs.lastmessage , '[skip ci]')"
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
Expand Down Expand Up @@ -70,8 +70,11 @@ jobs:
HOMEBREW_NO_AUTO_UPDATE=1 brew install flex bison libsndfile llvm ninja
- if: contains(matrix.os, 'ubuntu')
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm
sudo apt-get update
brew update
brew info llvm@11
- if: contains(matrix.os, 'ubuntu')
run: |
brew install llvm@11
sudo apt-get install libalsa-ocaml-dev libfl-dev libbison-dev libz-dev libsndfile-dev libopus-dev gcc-9 ninja-build
- uses: actions/checkout@v2
with:
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# CHANGELOG

## v0.3.1(2021-02-25)
### Bugfixes

- fixed a bug in code generator when if statement has void block(#51)
- added missing `==` and `!=` infix operators (#53)

### Refactoring

- `ExecutionEngine` class has been made by splitting from `Runtime` class toward implementing interpreter backend and environment variables feature.

### New Function

Though this release is a patch release, a subtle new feature is added.

- `mem`, a 1-sample delay function has been added. A simple example of biquad filter using this function is added to `mimium-core/filter.mmm`(#44).

### Other updates

A list of all contributers is added to readme by using [all-contributors](https://allcontributors.org/).
## v0.3.0 (2021-02-03)

### New language features
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
PROJECT(mimium
LANGUAGES CXX
HOMEPAGE_URL "https://mimium.org"
VERSION 0.3.0
VERSION 0.3.1
)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
set(CMAKE_CXX_FLAGS_DEBUG "-g4")
Expand All @@ -29,15 +29,15 @@ set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld)
endif()

if(ENABLE_COVERAGE)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} --coverage)
set(CMAKE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage)
endif()

if((CMAKE_BUILD_TYPE STREQUAL "Debug") AND
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
message("sanitizer activated")
list(APPEND CMAKE_CXX_FLAGS "-fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_LINKER_FLAGS ${CMAKE_LINKER_FLAGS} -fsanitize=address)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_LINKER_FLAGS ${CMAKE_LINKER_FLAGS} "-fsanitize=address")
endif()

set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
Expand Down
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn lpf(input:float,fb:float){
}
```

You can also write a note-level processing by using `@` operator which specifies the time when the function will be executed.
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.

```rust
Expand All @@ -55,26 +55,19 @@ More specific infos about the language are on [mimium Website](https://mimium.or

## Installation

You can get a built binary from [release](https://github.com/mimium-org/mimium/releases) section.
mimium can be run on macOS(x86), Linux(ALSA backend), Windows(WASAPI backend). WebAssemby backend will be supported for future.

mimium can 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](https://marketplace.visualstudio.com/items?itemName=mimium-org.mimium-language). 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](https://brew.sh/) is recommended.

Open your terminal application and type the command to install homebrew itself as follows.

```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```

After installation, you can install mimium with a command as follows.
You can install mimium with a command as follows.

```sh
brew install mimium-org/mimium/mimium
```

Also, [an extension for Visual Studio Code](https://github.com/mimium-org/mimium-language) for a syntax highlighting is available.

Also, you can get a built binary from [release](https://github.com/mimium-org/mimium/releases) section.
## Build from Source

To build on Windows, you need to use MSYS2. For details, check [GitHub Action Workflow](https://github.com/mimium-org/mimium/blob/dev/.github/workflows/build_and_test.yml).
Expand All @@ -83,7 +76,7 @@ To build on Windows, you need to use MSYS2. For details, check [GitHub Action Wo
- cmake
- bison >= 3.3
- flex
- llvm 11
- llvm >= 11
- Libsndfile
- RtAudio(cmake will automatically download)

Expand Down Expand Up @@ -114,4 +107,34 @@ The source code contains third party libraries with BSD-like lincenses, see [COP
This project is supported by all the contributers, [Sponsors](https://github.com/sponsors/tomoyanonymous), grants and scholarships as follows.

- 2019 Exploratory IT Human Resources Project ([The MITOU Program](https://www.ipa.go.jp/jinzai/mitou/portal_index.html)) by IPA: INFORMATION-TECHNOLOGY PROMOTION AGENCY, Japan.
- Kakehashi Foundation
- Kakehashi Foundation

### Contributors

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://t-sin.github.io"><img src="https://avatars.githubusercontent.com/u/4403863?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shinichi Tanaka</b></sub></a><br /><a href="https://github.com/mimium-org/mimium/commits?author=t-sin" title="Documentation">📖</a></td>
<td align="center"><a href="http://deepdrilledwell.secret.jp/ddw/"><img src="https://avatars.githubusercontent.com/u/74606612?v=4?s=100" width="100px;" alt=""/><br /><sub><b>kyo</b></sub></a><br /><a href="https://github.com/mimium-org/mimium/commits?author=syougikakugenn" title="Documentation">📖</a></td>
<td align="center"><a href="http://baku89.com"><img src="https://avatars.githubusercontent.com/u/2124392?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Baku 麦</b></sub></a><br /><a href="#financial-baku89" title="Financial">💵</a></td>
<td align="center"><a href="https://github.com/yuichkun"><img src="https://avatars.githubusercontent.com/u/14039540?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuichi Yogo</b></sub></a><br /><a href="#financial-yuichkun" title="Financial">💵</a></td>
<td align="center"><a href="http://ayumu-nagamatsu.com"><img src="https://avatars.githubusercontent.com/u/7838131?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ayumu Nagamatsu</b></sub></a><br /><a href="#financial-nama-gatsuo" title="Financial">💵</a></td>
<td align="center"><a href="https://horol.org"><img src="https://avatars.githubusercontent.com/u/3610296?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zigen</b></sub></a><br /><a href="#financial-zigen" title="Financial">💵</a></td>
<td align="center"><a href="http://hitoshitakeuchi.com"><img src="https://avatars.githubusercontent.com/u/6305267?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hitoshi Takeuchi</b></sub></a><br /><a href="#financial-hitoshitakeuchi" title="Financial">💵</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Inqb8tr-jp"><img src="https://avatars.githubusercontent.com/u/79005925?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Inqb8tr-jp</b></sub></a><br /><a href="#financial-Inqb8tr-jp" title="Financial">💵</a> <a href="#infra-Inqb8tr-jp" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
14 changes: 11 additions & 3 deletions cmake/FindLlvm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
${HOMEBREW_PATH}/include
${HOMEBREW_PATH}/opt/llvm/include
/usr/local/opt/llvm/include
/usr/local/include
/usr/include
/mingw64/include
C:/tools/msys64/mingw64/include
)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config llvm-config-10 llvm-config10
NAMES llvm-config llvm-config-11 llvm-config11
PATHS
${HOMEBREW_PATH}/bin
${HOMEBREW_PATH}/opt/llvm/bin
/usr/local/bin
/usr/local/opt/llvm/bin
/usr/local/bin
/usr/bin
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"C:/tools/msys64/mingw64/bin"
Expand Down Expand Up @@ -73,7 +76,12 @@ find_program(LLVM_CONFIG_EXE
NEED_TARGET("WebAssembly")
NEED_TARGET("X86")
# NEED_TARGET("XCore")

if((NOT LLVM_INCLUDE_DIRS))
execute_process(
COMMAND ${LLVM_CONFIG_EXE} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(NOT LLVM_LIBRARIES)
execute_process(
Expand Down
2 changes: 1 addition & 1 deletion examples/lpf.mmm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn lpf(input:float,fb:float){
return (1-fb)*input + fb*self
}
freq = 10000
fn dsp(time:float)->float{
fn dsp(){
out = lpf(random(),tau2pole(1/freq))
return (out,out)
}
68 changes: 68 additions & 0 deletions mimium-core/filter.mmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
fn biquad(x,a1,a2,b0,b1,b2){
fn Wbiquad(x,a1,a2){
return x - a1*self -a2*mem(self)
}
W = Wbiquad(x,a1,a2)
W1 = mem(W)
W2 = mem(W1)
return b0*W + b1*W1 + b2*W2
}
fn getGain(gain){
return 10 ^(gain/40.0)
}
fn getOmega(fc,fs){
PI = 3.14159565
return 2*PI*fc/fs
}
fn getAlpha(omega,q){
return sin(omega)/(2*q)
}

fn calcCoeffs(fc,gain,q,fs,paramfn:(float,float,float)->(float,float,float,float,float)){
A = getGain(gain)
omega = getOmega(fc,fs)
alpha =getAlpha(omega,q)
return paramfn(A,omega,alpha)
}

fn peakfilter(x,fc,gain,q,fs){
coeffs = calcCoeffs(fc,gain,q,fs, |A,omega,alpha|{
a0 = 1.0 + alpha / A
a1 = (-2.0 * cos(omega) )/a0
a2 = ( 1.0 - alpha / A )/a0
b0 = ( 1.0 + alpha * A )/a0
b1 = (-2.0 * cos(omega) )/a0
b2 = ( 1.0 - alpha * A )/a0
return (a1,a2,b0,b1,b2)
} )
a1,a2,b0,b1,b2 = coeffs
return biquad(x,a1,a2,b0,b1,b2)
}

// fn lowpass(x,fc,gain,q,fs){
// A = getGain(gain)
// omega = getOmega(fc,fs)
// alpha =getAlpha(omega,q)

// a0 = 1+alpha
// a1 = -2*cos(omega) /a0
// a2 = (1-alpha)/a0
// cosomegatmp = 1-cos(omega)
// b0 = cosomegatmp/(2*a0)
// b1 = b0/2
// b2 = b1
// return biquad(x,a1,a2,b0,b1,b2)
// }

// fn peakfilter(x,fc,gain,q,fs){
// A = getGain(gain)
// omega = getOmega(fc,fs)
// alpha = getAlpha(omega,q)
// a0 = 1.0 + alpha / A
// a1 = (-2.0 * cos(omega) )/a0
// a2 = ( 1.0 - alpha / A )/a0
// b0 = ( 1.0 + alpha * A )/a0
// b1 = (-2.0 * cos(omega) )/a0
// b2 = ( 1.0 - alpha * A )/a0
// return biquad(x,a1,a2,b0,b1,b2)
// }
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ target_link_libraries(mimium
mimium_filereader
mimium_preprocessor
mimium_compiler
mimium_runtime_jit
mimium_llvm_jitengine
mimium_backend_rtaudio
mimium_builtinfn
mimium_utils
Expand All @@ -53,7 +53,8 @@ install (TARGETS
mimium_preprocessor
mimium_compiler
mimium_llvm_codegen
mimium_runtime_jit
mimium_llvm_jitengine
mimium_runtime
mimium_scheduler
mimium_audiodriver
mimium_backend_rtaudio
Expand Down
2 changes: 1 addition & 1 deletion src/basic/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ auto makeStatement(FROM&& ast) {
return std::make_shared<ast::Statement>(ast);
}

} // namespace mimium
} // namespace mimium::ast
Loading

0 comments on commit ff9b237

Please sign in to comment.