Title: 使用 Haskell 创作音乐 · Issue #4 · lambda-forum/lambda-forum.github.io · GitHub
Open Graph Title: 使用 Haskell 创作音乐 · Issue #4 · lambda-forum/lambda-forum.github.io
X Title: 使用 Haskell 创作音乐 · Issue #4 · lambda-forum/lambda-forum.github.io
Description: Mezzo Mezzo 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a very strict spell-checker for music. import Mezzo comp = defScore $ start $ melody :| c :| ...
Open Graph Description: Mezzo Mezzo 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a very strict spell-checker for music. import Mezzo c...
X Description: Mezzo Mezzo 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a very strict spell-checker for music. import Mezzo c...
Opengraph URL: https://github.com/lambda-forum/lambda-forum.github.io/issues/4
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" 使用 Haskell 创作音乐","articleBody":"1. Mezzo\r\n\r\n*Mezzo* 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a **very** strict spell-checker for music.\r\n\r\n ```haskell\r\n import Mezzo\r\n \r\n comp = defScore $ start $ melody :| c :| d :| e :| f :\u003e\u003e g\r\n \r\n main :: IO ()\r\n main = renderScore \"comp.mid\" \"First composition\" comp\r\n ```\r\n\r\n Save, build and execute. You should get a `.mid` file in the project directory which looks something like this:\r\n\r\n\r\n\r\n To test the correctness checking, change the `d` note in `comp` to a `b`. You should see the following when you save the file:\r\n\r\n ```\r\n • Major sevenths are not permitted in melody: C and B\r\n • In the first argument of ‘(:|)’, namely ‘melody :| c :| b’\r\n In the first argument of ‘(:|)’, namely ‘melody :| c :| b :| e’\r\n In the first argument of ‘(:\u003e\u003e)’, namely\r\n ‘melody :| c :| b :| e :| f_’\r\n ```\r\n\r\n Mezzo has two ways of composing music: sequential (melodic) and parallel (harmonic) composition ...\r\n\r\n\t\r\n\t\r\n2. 一本很棒的书: http://euterpea.com/haskell-school-of-music/\r\n\r\n - 使用 Haskell 编程语言探索计算机音乐和函数式编程的基础。\r\n\r\n \r\n\r\n3. 其他的框架和库:\r\n\r\n - [csound-expression](https://github.com/spell-music/csound-expression) - 专注于电子音乐的创作\r\n\r\n - [th.composer](https://github.com/raptazure/th.composer) - 由 raptazure@λ-magic 创建\r\n\r\n `th.composer` 的一个视频演示:https://github.com/raptazure/presentations/blob/master/haskell-music/music.mp4\r\n\r\n","author":{"url":"https://github.com/raptazure","@type":"Person","name":"raptazure"},"datePublished":"2021-05-18T03:24:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4/lambda-forum.github.io/issues/4"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:98f72fbe-5741-ab84-c087-3cc1a7ba8b96 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E604:1E0215:167E0D:1D99C8:6991D696 |
| html-safe-nonce | b5c418ea66c798fb31cc96e897b3a542fc34089fa8b59a85b53eee07a5f525da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjA0OjFFMDIxNToxNjdFMEQ6MUQ5OUM4OjY5OTFENjk2IiwidmlzaXRvcl9pZCI6IjY2MjEzODIwMTQ5MjE3MjU1OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1abd8fe2371c77da454d268231f7dd82cda58133da3ad5bc8caec1bd7eb303b6 |
| hovercard-subject-tag | issue:893908487 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lambda-forum/lambda-forum.github.io/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c1f1618ac3cc074b482532dbd58aed7e7bbae6d91ea5d42848408437f761f1d2/lambda-forum/lambda-forum.github.io/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1f1618ac3cc074b482532dbd58aed7e7bbae6d91ea5d42848408437f761f1d2/lambda-forum/lambda-forum.github.io/issues/4 |
| og:image:alt | Mezzo Mezzo 是一个可以描述音乐的领域内编程语言 / Haskell 库,它可以对不同的音乐创作模式进行静态检查(类似于静态类型检查,这当然也是得益于 Haskell 的类型检查系统),也就是说,如果你创作了“坏”的音乐,你的作曲将不会被编译 – think of it as a very strict spell-checker for music. import Mezzo c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | raptazure |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/lambda-forum/lambda-forum.github.io git https://github.com/lambda-forum/lambda-forum.github.io.git |
| octolytics-dimension-user_id | 83862771 |
| octolytics-dimension-user_login | lambda-forum |
| octolytics-dimension-repository_id | 365469812 |
| octolytics-dimension-repository_nwo | lambda-forum/lambda-forum.github.io |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 365469812 |
| octolytics-dimension-repository_network_root_nwo | lambda-forum/lambda-forum.github.io |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width