-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
- Mezzo
Mezzo 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a very strict spell-checker for music.
import Mezzo
comp = defScore $ start $ melody :| c :| d :| e :| f :>> g
main :: IO ()
main = renderScore "comp.mid" "First composition" compSave, build and execute. You should get a .mid file in the project directory which looks something like this:
To test the correctness checking, change the d note in comp to a b. You should see the following when you save the file:
• Major sevenths are not permitted in melody: C and B
• In the first argument of ‘(:|)’, namely ‘melody :| c :| b’
In the first argument of ‘(:|)’, namely ‘melody :| c :| b :| e’
In the first argument of ‘(:>>)’, namely
‘melody :| c :| b :| e :| f_’
Mezzo has two ways of composing music: sequential (melodic) and parallel (harmonic) composition ...
- 使用 Haskell 编程语言探索计算机音乐和函数式编程的基础。
-
其他的框架和库:
-
csound-expression - 专注于电子音乐的创作
-
th.composer - 由 raptazure@λ-magic 创建
th.composer的一个视频演示:https://github.com/raptazure/presentations/blob/master/haskell-music/music.mp4 -
raptazure and alissa-tungraptazure
