takomusic 2.1.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +107 -185
  2. package/dist/__tests__/evaluator.test.d.ts +2 -0
  3. package/dist/__tests__/evaluator.test.d.ts.map +1 -0
  4. package/dist/__tests__/evaluator.test.js +465 -0
  5. package/dist/__tests__/evaluator.test.js.map +1 -0
  6. package/dist/__tests__/helpers/testUtils.d.ts +64 -0
  7. package/dist/__tests__/helpers/testUtils.d.ts.map +1 -0
  8. package/dist/__tests__/helpers/testUtils.js +178 -0
  9. package/dist/__tests__/helpers/testUtils.js.map +1 -0
  10. package/dist/__tests__/lexer.test.js +403 -78
  11. package/dist/__tests__/lexer.test.js.map +1 -1
  12. package/dist/__tests__/parser.test.js +575 -224
  13. package/dist/__tests__/parser.test.js.map +1 -1
  14. package/dist/__tests__/stdlib.test.d.ts +2 -0
  15. package/dist/__tests__/stdlib.test.d.ts.map +1 -0
  16. package/dist/__tests__/stdlib.test.js +551 -0
  17. package/dist/__tests__/stdlib.test.js.map +1 -0
  18. package/dist/__tests__/typecheck.test.d.ts +2 -0
  19. package/dist/__tests__/typecheck.test.d.ts.map +1 -0
  20. package/dist/__tests__/typecheck.test.js +314 -0
  21. package/dist/__tests__/typecheck.test.js.map +1 -0
  22. package/dist/__tests__/v3.compiler.test.d.ts +2 -0
  23. package/dist/__tests__/v3.compiler.test.d.ts.map +1 -0
  24. package/dist/__tests__/v3.compiler.test.js +192 -0
  25. package/dist/__tests__/v3.compiler.test.js.map +1 -0
  26. package/dist/__tests__/v4.compiler.test.d.ts +2 -0
  27. package/dist/__tests__/v4.compiler.test.d.ts.map +1 -0
  28. package/dist/__tests__/v4.compiler.test.js +192 -0
  29. package/dist/__tests__/v4.compiler.test.js.map +1 -0
  30. package/dist/ast.d.ts +369 -0
  31. package/dist/ast.d.ts.map +1 -0
  32. package/dist/ast.js +2 -0
  33. package/dist/ast.js.map +1 -0
  34. package/dist/browser/index.d.ts +70 -0
  35. package/dist/browser/index.d.ts.map +1 -0
  36. package/dist/browser/index.js +336 -0
  37. package/dist/browser/index.js.map +1 -0
  38. package/dist/browser/virtualFs.d.ts +56 -0
  39. package/dist/browser/virtualFs.d.ts.map +1 -0
  40. package/dist/browser/virtualFs.js +3067 -0
  41. package/dist/browser/virtualFs.js.map +1 -0
  42. package/dist/cli/colors.d.ts +47 -0
  43. package/dist/cli/colors.d.ts.map +1 -0
  44. package/dist/cli/colors.js +92 -0
  45. package/dist/cli/colors.js.map +1 -0
  46. package/dist/cli/commands/build.d.ts.map +1 -1
  47. package/dist/cli/commands/build.js +77 -78
  48. package/dist/cli/commands/build.js.map +1 -1
  49. package/dist/cli/commands/check.d.ts.map +1 -1
  50. package/dist/cli/commands/check.js +33 -30
  51. package/dist/cli/commands/check.js.map +1 -1
  52. package/dist/cli/commands/fmt.d.ts.map +1 -1
  53. package/dist/cli/commands/fmt.js +88 -46
  54. package/dist/cli/commands/fmt.js.map +1 -1
  55. package/dist/cli/commands/init.d.ts.map +1 -1
  56. package/dist/cli/commands/init.js +159 -120
  57. package/dist/cli/commands/init.js.map +1 -1
  58. package/dist/cli/commands/install.d.ts +2 -0
  59. package/dist/cli/commands/install.d.ts.map +1 -0
  60. package/dist/cli/commands/install.js +201 -0
  61. package/dist/cli/commands/install.js.map +1 -0
  62. package/dist/cli/commands/lsp.d.ts +2 -0
  63. package/dist/cli/commands/lsp.d.ts.map +1 -0
  64. package/dist/cli/commands/lsp.js +15 -0
  65. package/dist/cli/commands/lsp.js.map +1 -0
  66. package/dist/cli/commands/render.d.ts.map +1 -1
  67. package/dist/cli/commands/render.js +181 -272
  68. package/dist/cli/commands/render.js.map +1 -1
  69. package/dist/cli/commands/repl.d.ts +2 -0
  70. package/dist/cli/commands/repl.d.ts.map +1 -0
  71. package/dist/cli/commands/repl.js +338 -0
  72. package/dist/cli/commands/repl.js.map +1 -0
  73. package/dist/cli/commands/watch.d.ts +2 -0
  74. package/dist/cli/commands/watch.d.ts.map +1 -0
  75. package/dist/cli/commands/watch.js +220 -0
  76. package/dist/cli/commands/watch.js.map +1 -0
  77. package/dist/cli/errorHandler.d.ts +16 -0
  78. package/dist/cli/errorHandler.d.ts.map +1 -1
  79. package/dist/cli/errorHandler.js +50 -3
  80. package/dist/cli/errorHandler.js.map +1 -1
  81. package/dist/cli/index.js +32 -29
  82. package/dist/cli/index.js.map +1 -1
  83. package/dist/cli/richFormatter.d.ts +29 -0
  84. package/dist/cli/richFormatter.d.ts.map +1 -0
  85. package/dist/cli/richFormatter.js +136 -0
  86. package/dist/cli/richFormatter.js.map +1 -0
  87. package/dist/cli/sourceSnippet.d.ts +45 -0
  88. package/dist/cli/sourceSnippet.d.ts.map +1 -0
  89. package/dist/cli/sourceSnippet.js +162 -0
  90. package/dist/cli/sourceSnippet.js.map +1 -0
  91. package/dist/compiler.d.ts +19 -0
  92. package/dist/compiler.d.ts.map +1 -0
  93. package/dist/compiler.js +230 -0
  94. package/dist/compiler.js.map +1 -0
  95. package/dist/config/config.d.ts +0 -24
  96. package/dist/config/config.d.ts.map +1 -1
  97. package/dist/config/config.js +11 -134
  98. package/dist/config/config.js.map +1 -1
  99. package/dist/diagnostics.d.ts +73 -0
  100. package/dist/diagnostics.d.ts.map +1 -0
  101. package/dist/diagnostics.js +73 -0
  102. package/dist/diagnostics.js.map +1 -0
  103. package/dist/errors.d.ts +60 -19
  104. package/dist/errors.d.ts.map +1 -1
  105. package/dist/errors.js +157 -48
  106. package/dist/errors.js.map +1 -1
  107. package/dist/evaluator.d.ts +65 -0
  108. package/dist/evaluator.d.ts.map +1 -0
  109. package/dist/evaluator.js +1951 -0
  110. package/dist/evaluator.js.map +1 -0
  111. package/dist/formatter.d.ts +17 -0
  112. package/dist/formatter.d.ts.map +1 -0
  113. package/dist/formatter.js +426 -0
  114. package/dist/formatter.js.map +1 -0
  115. package/dist/index.d.ts +11 -8
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +11 -8
  118. package/dist/index.js.map +1 -1
  119. package/dist/ir.d.ts +156 -0
  120. package/dist/ir.d.ts.map +1 -0
  121. package/dist/ir.js +2 -0
  122. package/dist/ir.js.map +1 -0
  123. package/dist/{lexer/lexer.d.ts → lexer.d.ts} +19 -17
  124. package/dist/lexer.d.ts.map +1 -0
  125. package/dist/lexer.js +392 -0
  126. package/dist/lexer.js.map +1 -0
  127. package/dist/lsp/server.d.ts +11 -0
  128. package/dist/lsp/server.d.ts.map +1 -0
  129. package/dist/lsp/server.js +595 -0
  130. package/dist/lsp/server.js.map +1 -0
  131. package/dist/normalize.d.ts +5 -0
  132. package/dist/normalize.d.ts.map +1 -0
  133. package/dist/normalize.js +277 -0
  134. package/dist/normalize.js.map +1 -0
  135. package/dist/package/manager.d.ts +87 -0
  136. package/dist/package/manager.d.ts.map +1 -0
  137. package/dist/package/manager.js +267 -0
  138. package/dist/package/manager.js.map +1 -0
  139. package/dist/parser.d.ts +73 -0
  140. package/dist/parser.d.ts.map +1 -0
  141. package/dist/parser.js +1237 -0
  142. package/dist/parser.js.map +1 -0
  143. package/dist/pitch.d.ts +11 -0
  144. package/dist/pitch.d.ts.map +1 -0
  145. package/dist/pitch.js +40 -0
  146. package/dist/pitch.js.map +1 -0
  147. package/dist/rat.d.ts +14 -0
  148. package/dist/rat.d.ts.map +1 -0
  149. package/dist/rat.js +52 -0
  150. package/dist/rat.js.map +1 -0
  151. package/dist/renderer-plugin.d.ts +70 -0
  152. package/dist/renderer-plugin.d.ts.map +1 -0
  153. package/dist/renderer-plugin.js +141 -0
  154. package/dist/renderer-plugin.js.map +1 -0
  155. package/dist/runtime.d.ts +270 -0
  156. package/dist/runtime.d.ts.map +1 -0
  157. package/dist/runtime.js +67 -0
  158. package/dist/runtime.js.map +1 -0
  159. package/dist/schema/validator.d.ts +3 -0
  160. package/dist/schema/validator.d.ts.map +1 -0
  161. package/dist/schema/validator.js +71 -0
  162. package/dist/schema/validator.js.map +1 -0
  163. package/dist/scope.d.ts +17 -0
  164. package/dist/scope.d.ts.map +1 -0
  165. package/dist/scope.js +87 -0
  166. package/dist/scope.js.map +1 -0
  167. package/dist/suggestions.d.ts +37 -0
  168. package/dist/suggestions.d.ts.map +1 -0
  169. package/dist/suggestions.js +129 -0
  170. package/dist/suggestions.js.map +1 -0
  171. package/dist/temp_render.tako.score.json +11655 -0
  172. package/dist/token.d.ts +85 -0
  173. package/dist/token.d.ts.map +1 -0
  174. package/dist/token.js +105 -0
  175. package/dist/token.js.map +1 -0
  176. package/dist/typecheck.d.ts +4 -0
  177. package/dist/typecheck.d.ts.map +1 -0
  178. package/dist/typecheck.js +1069 -0
  179. package/dist/typecheck.js.map +1 -0
  180. package/dist/utils/stdlib.d.ts +1 -1
  181. package/dist/utils/stdlib.d.ts.map +1 -1
  182. package/dist/utils/stdlib.js +8 -11
  183. package/dist/utils/stdlib.js.map +1 -1
  184. package/dist/validation.d.ts +12 -0
  185. package/dist/validation.d.ts.map +1 -0
  186. package/dist/validation.js +444 -0
  187. package/dist/validation.js.map +1 -0
  188. package/dist/value-codec.d.ts +9 -0
  189. package/dist/value-codec.d.ts.map +1 -0
  190. package/dist/value-codec.js +788 -0
  191. package/dist/value-codec.js.map +1 -0
  192. package/docs/schemas/IR_V3.schema.json +727 -0
  193. package/docs/schemas/IR_V4.schema.json +734 -0
  194. package/docs/schemas/PROFILE_V3.schema.json +100 -0
  195. package/lib/core.mf +763 -0
  196. package/lib/curves.mf +34 -169
  197. package/lib/drums.mf +188 -0
  198. package/lib/random.mf +33 -0
  199. package/lib/result.mf +78 -0
  200. package/lib/rhythm.mf +288 -219
  201. package/lib/theory.mf +965 -155
  202. package/lib/time.mf +111 -0
  203. package/lib/transform.mf +319 -0
  204. package/lib/vocal.mf +490 -0
  205. package/package.json +13 -7
  206. package/dist/__tests__/checker.test.d.ts +0 -2
  207. package/dist/__tests__/checker.test.d.ts.map +0 -1
  208. package/dist/__tests__/checker.test.js +0 -160
  209. package/dist/__tests__/checker.test.js.map +0 -1
  210. package/dist/__tests__/compiler.test.d.ts +0 -2
  211. package/dist/__tests__/compiler.test.d.ts.map +0 -1
  212. package/dist/__tests__/compiler.test.js +0 -145
  213. package/dist/__tests__/compiler.test.js.map +0 -1
  214. package/dist/__tests__/generators.test.d.ts +0 -2
  215. package/dist/__tests__/generators.test.d.ts.map +0 -1
  216. package/dist/__tests__/generators.test.js +0 -307
  217. package/dist/__tests__/generators.test.js.map +0 -1
  218. package/dist/__tests__/interpreter.test.d.ts +0 -2
  219. package/dist/__tests__/interpreter.test.d.ts.map +0 -1
  220. package/dist/__tests__/interpreter.test.js +0 -281
  221. package/dist/__tests__/interpreter.test.js.map +0 -1
  222. package/dist/__tests__/language-spec.test.d.ts +0 -2
  223. package/dist/__tests__/language-spec.test.d.ts.map +0 -1
  224. package/dist/__tests__/language-spec.test.js +0 -408
  225. package/dist/__tests__/language-spec.test.js.map +0 -1
  226. package/dist/checker/checker.d.ts +0 -43
  227. package/dist/checker/checker.d.ts.map +0 -1
  228. package/dist/checker/checker.js +0 -628
  229. package/dist/checker/checker.js.map +0 -1
  230. package/dist/checker/index.d.ts +0 -3
  231. package/dist/checker/index.d.ts.map +0 -1
  232. package/dist/checker/index.js +0 -2
  233. package/dist/checker/index.js.map +0 -1
  234. package/dist/cli/commands/doctor.d.ts +0 -2
  235. package/dist/cli/commands/doctor.d.ts.map +0 -1
  236. package/dist/cli/commands/doctor.js +0 -191
  237. package/dist/cli/commands/doctor.js.map +0 -1
  238. package/dist/cli/commands/import.d.ts +0 -2
  239. package/dist/cli/commands/import.d.ts.map +0 -1
  240. package/dist/cli/commands/import.js +0 -111
  241. package/dist/cli/commands/import.js.map +0 -1
  242. package/dist/cli/commands/play.d.ts +0 -2
  243. package/dist/cli/commands/play.d.ts.map +0 -1
  244. package/dist/cli/commands/play.js +0 -225
  245. package/dist/cli/commands/play.js.map +0 -1
  246. package/dist/cli/commands/record.d.ts +0 -2
  247. package/dist/cli/commands/record.d.ts.map +0 -1
  248. package/dist/cli/commands/record.js +0 -443
  249. package/dist/cli/commands/record.js.map +0 -1
  250. package/dist/compiler/compiler.d.ts +0 -11
  251. package/dist/compiler/compiler.d.ts.map +0 -1
  252. package/dist/compiler/compiler.js +0 -213
  253. package/dist/compiler/compiler.js.map +0 -1
  254. package/dist/compiler/index.d.ts +0 -2
  255. package/dist/compiler/index.d.ts.map +0 -1
  256. package/dist/compiler/index.js +0 -2
  257. package/dist/compiler/index.js.map +0 -1
  258. package/dist/formatter/formatter.d.ts +0 -20
  259. package/dist/formatter/formatter.d.ts.map +0 -1
  260. package/dist/formatter/formatter.js +0 -436
  261. package/dist/formatter/formatter.js.map +0 -1
  262. package/dist/formatter/index.d.ts +0 -2
  263. package/dist/formatter/index.d.ts.map +0 -1
  264. package/dist/formatter/index.js +0 -2
  265. package/dist/formatter/index.js.map +0 -1
  266. package/dist/generators/index.d.ts +0 -5
  267. package/dist/generators/index.d.ts.map +0 -1
  268. package/dist/generators/index.js +0 -5
  269. package/dist/generators/index.js.map +0 -1
  270. package/dist/generators/midi.d.ts +0 -3
  271. package/dist/generators/midi.d.ts.map +0 -1
  272. package/dist/generators/midi.js +0 -439
  273. package/dist/generators/midi.js.map +0 -1
  274. package/dist/generators/musicxml.d.ts +0 -3
  275. package/dist/generators/musicxml.d.ts.map +0 -1
  276. package/dist/generators/musicxml.js +0 -425
  277. package/dist/generators/musicxml.js.map +0 -1
  278. package/dist/generators/tempo-midi.d.ts +0 -3
  279. package/dist/generators/tempo-midi.d.ts.map +0 -1
  280. package/dist/generators/tempo-midi.js +0 -135
  281. package/dist/generators/tempo-midi.js.map +0 -1
  282. package/dist/generators/vsqx.d.ts +0 -3
  283. package/dist/generators/vsqx.d.ts.map +0 -1
  284. package/dist/generators/vsqx.js +0 -358
  285. package/dist/generators/vsqx.js.map +0 -1
  286. package/dist/importers/index.d.ts +0 -2
  287. package/dist/importers/index.d.ts.map +0 -1
  288. package/dist/importers/index.js +0 -3
  289. package/dist/importers/index.js.map +0 -1
  290. package/dist/importers/musicxml.d.ts +0 -4
  291. package/dist/importers/musicxml.d.ts.map +0 -1
  292. package/dist/importers/musicxml.js +0 -438
  293. package/dist/importers/musicxml.js.map +0 -1
  294. package/dist/interpreter/builtins/algorithmic.d.ts +0 -12
  295. package/dist/interpreter/builtins/algorithmic.d.ts.map +0 -1
  296. package/dist/interpreter/builtins/algorithmic.js +0 -244
  297. package/dist/interpreter/builtins/algorithmic.js.map +0 -1
  298. package/dist/interpreter/builtins/audio.d.ts +0 -10
  299. package/dist/interpreter/builtins/audio.d.ts.map +0 -1
  300. package/dist/interpreter/builtins/audio.js +0 -169
  301. package/dist/interpreter/builtins/audio.js.map +0 -1
  302. package/dist/interpreter/builtins/core.d.ts +0 -16
  303. package/dist/interpreter/builtins/core.d.ts.map +0 -1
  304. package/dist/interpreter/builtins/core.js +0 -267
  305. package/dist/interpreter/builtins/core.js.map +0 -1
  306. package/dist/interpreter/builtins/dynamics.d.ts +0 -8
  307. package/dist/interpreter/builtins/dynamics.d.ts.map +0 -1
  308. package/dist/interpreter/builtins/dynamics.js +0 -86
  309. package/dist/interpreter/builtins/dynamics.js.map +0 -1
  310. package/dist/interpreter/builtins/effects.d.ts +0 -16
  311. package/dist/interpreter/builtins/effects.d.ts.map +0 -1
  312. package/dist/interpreter/builtins/effects.js +0 -220
  313. package/dist/interpreter/builtins/effects.js.map +0 -1
  314. package/dist/interpreter/builtins/index.d.ts +0 -16
  315. package/dist/interpreter/builtins/index.d.ts.map +0 -1
  316. package/dist/interpreter/builtins/index.js +0 -17
  317. package/dist/interpreter/builtins/index.js.map +0 -1
  318. package/dist/interpreter/builtins/layout.d.ts +0 -12
  319. package/dist/interpreter/builtins/layout.d.ts.map +0 -1
  320. package/dist/interpreter/builtins/layout.js +0 -175
  321. package/dist/interpreter/builtins/layout.js.map +0 -1
  322. package/dist/interpreter/builtins/live.d.ts +0 -11
  323. package/dist/interpreter/builtins/live.d.ts.map +0 -1
  324. package/dist/interpreter/builtins/live.js +0 -125
  325. package/dist/interpreter/builtins/live.js.map +0 -1
  326. package/dist/interpreter/builtins/midi.d.ts +0 -17
  327. package/dist/interpreter/builtins/midi.d.ts.map +0 -1
  328. package/dist/interpreter/builtins/midi.js +0 -308
  329. package/dist/interpreter/builtins/midi.js.map +0 -1
  330. package/dist/interpreter/builtins/mixing.d.ts +0 -6
  331. package/dist/interpreter/builtins/mixing.d.ts.map +0 -1
  332. package/dist/interpreter/builtins/mixing.js +0 -62
  333. package/dist/interpreter/builtins/mixing.js.map +0 -1
  334. package/dist/interpreter/builtins/notation.d.ts +0 -24
  335. package/dist/interpreter/builtins/notation.d.ts.map +0 -1
  336. package/dist/interpreter/builtins/notation.js +0 -251
  337. package/dist/interpreter/builtins/notation.js.map +0 -1
  338. package/dist/interpreter/builtins/ornaments.d.ts +0 -8
  339. package/dist/interpreter/builtins/ornaments.d.ts.map +0 -1
  340. package/dist/interpreter/builtins/ornaments.js +0 -155
  341. package/dist/interpreter/builtins/ornaments.js.map +0 -1
  342. package/dist/interpreter/builtins/techniques.d.ts +0 -11
  343. package/dist/interpreter/builtins/techniques.d.ts.map +0 -1
  344. package/dist/interpreter/builtins/techniques.js +0 -234
  345. package/dist/interpreter/builtins/techniques.js.map +0 -1
  346. package/dist/interpreter/builtins/tuning.d.ts +0 -7
  347. package/dist/interpreter/builtins/tuning.d.ts.map +0 -1
  348. package/dist/interpreter/builtins/tuning.js +0 -52
  349. package/dist/interpreter/builtins/tuning.js.map +0 -1
  350. package/dist/interpreter/builtins/types.d.ts +0 -24
  351. package/dist/interpreter/builtins/types.d.ts.map +0 -1
  352. package/dist/interpreter/builtins/types.js +0 -3
  353. package/dist/interpreter/builtins/types.js.map +0 -1
  354. package/dist/interpreter/builtins/vocaloid.d.ts +0 -10
  355. package/dist/interpreter/builtins/vocaloid.d.ts.map +0 -1
  356. package/dist/interpreter/builtins/vocaloid.js +0 -165
  357. package/dist/interpreter/builtins/vocaloid.js.map +0 -1
  358. package/dist/interpreter/index.d.ts +0 -4
  359. package/dist/interpreter/index.d.ts.map +0 -1
  360. package/dist/interpreter/index.js +0 -4
  361. package/dist/interpreter/index.js.map +0 -1
  362. package/dist/interpreter/interpreter.d.ts +0 -318
  363. package/dist/interpreter/interpreter.d.ts.map +0 -1
  364. package/dist/interpreter/interpreter.js +0 -9069
  365. package/dist/interpreter/interpreter.js.map +0 -1
  366. package/dist/interpreter/runtime.d.ts +0 -78
  367. package/dist/interpreter/runtime.d.ts.map +0 -1
  368. package/dist/interpreter/runtime.js +0 -126
  369. package/dist/interpreter/runtime.js.map +0 -1
  370. package/dist/interpreter/scope.d.ts +0 -21
  371. package/dist/interpreter/scope.d.ts.map +0 -1
  372. package/dist/interpreter/scope.js +0 -61
  373. package/dist/interpreter/scope.js.map +0 -1
  374. package/dist/interpreter/trackState.d.ts +0 -206
  375. package/dist/interpreter/trackState.d.ts.map +0 -1
  376. package/dist/interpreter/trackState.js +0 -12
  377. package/dist/interpreter/trackState.js.map +0 -1
  378. package/dist/interpreter/validators.d.ts +0 -32
  379. package/dist/interpreter/validators.d.ts.map +0 -1
  380. package/dist/interpreter/validators.js +0 -64
  381. package/dist/interpreter/validators.js.map +0 -1
  382. package/dist/lexer/index.d.ts +0 -2
  383. package/dist/lexer/index.d.ts.map +0 -1
  384. package/dist/lexer/index.js +0 -2
  385. package/dist/lexer/index.js.map +0 -1
  386. package/dist/lexer/lexer.d.ts.map +0 -1
  387. package/dist/lexer/lexer.js +0 -646
  388. package/dist/lexer/lexer.js.map +0 -1
  389. package/dist/parser/index.d.ts +0 -2
  390. package/dist/parser/index.d.ts.map +0 -1
  391. package/dist/parser/index.js +0 -2
  392. package/dist/parser/index.js.map +0 -1
  393. package/dist/parser/parser.d.ts +0 -101
  394. package/dist/parser/parser.d.ts.map +0 -1
  395. package/dist/parser/parser.js +0 -2006
  396. package/dist/parser/parser.js.map +0 -1
  397. package/dist/types/ast.d.ts +0 -362
  398. package/dist/types/ast.d.ts.map +0 -1
  399. package/dist/types/ast.js +0 -3
  400. package/dist/types/ast.js.map +0 -1
  401. package/dist/types/index.d.ts +0 -4
  402. package/dist/types/index.d.ts.map +0 -1
  403. package/dist/types/index.js +0 -4
  404. package/dist/types/index.js.map +0 -1
  405. package/dist/types/ir/advanced.d.ts +0 -491
  406. package/dist/types/ir/advanced.d.ts.map +0 -1
  407. package/dist/types/ir/advanced.js +0 -3
  408. package/dist/types/ir/advanced.js.map +0 -1
  409. package/dist/types/ir/algorithmic.d.ts +0 -48
  410. package/dist/types/ir/algorithmic.d.ts.map +0 -1
  411. package/dist/types/ir/algorithmic.js +0 -3
  412. package/dist/types/ir/algorithmic.js.map +0 -1
  413. package/dist/types/ir/analysis.d.ts +0 -34
  414. package/dist/types/ir/analysis.d.ts.map +0 -1
  415. package/dist/types/ir/analysis.js +0 -3
  416. package/dist/types/ir/analysis.js.map +0 -1
  417. package/dist/types/ir/audio.d.ts +0 -249
  418. package/dist/types/ir/audio.d.ts.map +0 -1
  419. package/dist/types/ir/audio.js +0 -3
  420. package/dist/types/ir/audio.js.map +0 -1
  421. package/dist/types/ir/automation.d.ts +0 -46
  422. package/dist/types/ir/automation.d.ts.map +0 -1
  423. package/dist/types/ir/automation.js +0 -3
  424. package/dist/types/ir/automation.js.map +0 -1
  425. package/dist/types/ir/collaboration.d.ts +0 -20
  426. package/dist/types/ir/collaboration.d.ts.map +0 -1
  427. package/dist/types/ir/collaboration.js +0 -3
  428. package/dist/types/ir/collaboration.js.map +0 -1
  429. package/dist/types/ir/core.d.ts +0 -200
  430. package/dist/types/ir/core.d.ts.map +0 -1
  431. package/dist/types/ir/core.js +0 -3
  432. package/dist/types/ir/core.js.map +0 -1
  433. package/dist/types/ir/effects.d.ts +0 -169
  434. package/dist/types/ir/effects.d.ts.map +0 -1
  435. package/dist/types/ir/effects.js +0 -3
  436. package/dist/types/ir/effects.js.map +0 -1
  437. package/dist/types/ir/extended.d.ts +0 -104
  438. package/dist/types/ir/extended.d.ts.map +0 -1
  439. package/dist/types/ir/extended.js +0 -3
  440. package/dist/types/ir/extended.js.map +0 -1
  441. package/dist/types/ir/index.d.ts +0 -16
  442. package/dist/types/ir/index.d.ts.map +0 -1
  443. package/dist/types/ir/index.js +0 -17
  444. package/dist/types/ir/index.js.map +0 -1
  445. package/dist/types/ir/mastering.d.ts +0 -86
  446. package/dist/types/ir/mastering.d.ts.map +0 -1
  447. package/dist/types/ir/mastering.js +0 -3
  448. package/dist/types/ir/mastering.js.map +0 -1
  449. package/dist/types/ir/midi.d.ts +0 -79
  450. package/dist/types/ir/midi.d.ts.map +0 -1
  451. package/dist/types/ir/midi.js +0 -3
  452. package/dist/types/ir/midi.js.map +0 -1
  453. package/dist/types/ir/notation.d.ts +0 -963
  454. package/dist/types/ir/notation.d.ts.map +0 -1
  455. package/dist/types/ir/notation.js +0 -3
  456. package/dist/types/ir/notation.js.map +0 -1
  457. package/dist/types/ir/recording.d.ts +0 -48
  458. package/dist/types/ir/recording.d.ts.map +0 -1
  459. package/dist/types/ir/recording.js +0 -3
  460. package/dist/types/ir/recording.js.map +0 -1
  461. package/dist/types/ir/sampling.d.ts +0 -59
  462. package/dist/types/ir/sampling.d.ts.map +0 -1
  463. package/dist/types/ir/sampling.js +0 -3
  464. package/dist/types/ir/sampling.js.map +0 -1
  465. package/dist/types/ir/sequencing.d.ts +0 -118
  466. package/dist/types/ir/sequencing.d.ts.map +0 -1
  467. package/dist/types/ir/sequencing.js +0 -3
  468. package/dist/types/ir/sequencing.js.map +0 -1
  469. package/dist/types/ir/sync.d.ts +0 -39
  470. package/dist/types/ir/sync.d.ts.map +0 -1
  471. package/dist/types/ir/sync.js +0 -3
  472. package/dist/types/ir/sync.js.map +0 -1
  473. package/dist/types/ir.d.ts +0 -2
  474. package/dist/types/ir.d.ts.map +0 -1
  475. package/dist/types/ir.js +0 -3
  476. package/dist/types/ir.js.map +0 -1
  477. package/dist/types/token.d.ts +0 -120
  478. package/dist/types/token.d.ts.map +0 -1
  479. package/dist/types/token.js +0 -174
  480. package/dist/types/token.js.map +0 -1
  481. package/lib/articulation.mf +0 -46
  482. package/lib/composition.mf +0 -299
  483. package/lib/dynamics.mf +0 -141
  484. package/lib/expression.mf +0 -221
  485. package/lib/genres.mf +0 -348
  486. package/lib/notation.mf +0 -224
  487. package/lib/ornaments.mf +0 -98
  488. package/lib/patterns.mf +0 -170
  489. package/lib/utils.mf +0 -140
package/README.md CHANGED
@@ -1,229 +1,151 @@
1
- # TakoMusic
1
+ # TakoMusic (v4)
2
2
 
3
- A domain-specific language (DSL) for music composition that generates VSQX, MusicXML, and MIDI files.
3
+ TakoMusic is a music composition DSL that evaluates to a neutral `Score` IR and renders via external plugins.
4
+ The language core is backend-agnostic and pushes sound binding to Render Profiles.
4
5
 
5
- ## Features
6
+ ## Highlights
6
7
 
7
- - **MFS Language**: Write music using a simple, readable syntax
8
- - **Multi-format Export**: Generate VSQX (Vocaloid), MusicXML (notation), and MIDI (instruments)
9
- - **Advanced MIDI**: CC, pitch bend, aftertouch, NRPN, SysEx, MPE support
10
- - **Extended Notation**: Tuplets, grace notes, articulations, dynamics, ornaments
11
- - **Vocaloid Support**: Full parameter control, vibrato, growl, cross-synthesis
12
- - **Algorithmic Composition**: Euclidean rhythms, Markov chains, pattern generation
13
- - **Module System**: Organize code with imports/exports
14
- - **CLI Tools**: Build, check, format, play, import, record, and render
8
+ - `score`/`clip` DSL with deterministic evaluation (`export fn main() -> Score`)
9
+ - Rational time model (Dur/Pos) without ticks
10
+ - Abstract sounds + render profiles decouple composition from output
11
+ - Renderer Plugin protocol: `capabilities` / `validate` / `render`
12
+ - Web Playground with real-time audio preview
15
13
 
16
- ## Installation
14
+ ## Quick Start
17
15
 
18
16
  ```bash
19
- npm install
20
- npm run build
21
- ```
17
+ # Install
18
+ npm install -g takomusic
22
19
 
23
- ## Quick Start
20
+ # Build a single file (no config needed)
21
+ mf build song.mf
24
22
 
25
- ### 1. Create a new project
26
-
27
- ```bash
28
- mf init myproject # Default template
29
- mf init myproject -t piano # Piano template
30
- mf init --list # List all templates
23
+ # Or initialize a project
24
+ mf init
25
+ mf build
26
+ mf render
31
27
  ```
32
28
 
33
- ### 2. Edit src/main.mf
34
-
35
- ```mfs
36
- export proc main() {
37
- title("My First Song");
38
- ppq(480);
39
- timeSig(4, 4);
40
- tempo(120);
41
-
42
- track(midi, piano, { ch: 1, program: 0 }) {
43
- at(1:1);
44
- chord([C4, E4, G4], 1n);
45
- }
46
-
47
- track(midi, drums, { ch: 10, vel: 100 }) {
48
- at(1:1);
49
- drum(kick, 4n); drum(hhc, 4n);
50
- drum(snare, 4n); drum(hhc, 4n);
51
- }
52
- }
53
- ```
29
+ ## Demo Song
54
30
 
55
- ### 3. Build and play
31
+ Check out `examples/cyberpunk_drive.mf` - a complete synthwave track demonstrating TakoMusic's capabilities:
32
+
33
+ - 64 bars, 8 tracks, 128 BPM
34
+ - Drums, bass, arpeggios, pads, and lead melody
35
+ - Uses std:core, std:transform, std:theory, std:drums
56
36
 
57
37
  ```bash
58
- mf check # Check for errors
59
- mf build # Generate MIDI, MusicXML, VSQX
60
- mf play # Live preview with FluidSynth
61
- mf render -p cli # Render audio
38
+ # Build and render the demo
39
+ mf build examples/cyberpunk_drive.mf
40
+ mf render examples/cyberpunk_drive.mf.score.json -p profiles/midi.mf.profile.json
62
41
  ```
63
42
 
64
- ## CLI Commands
65
-
66
- | Command | Description |
67
- |---------|-------------|
68
- | `mf init [dir]` | Initialize new project |
69
- | `mf build` | Compile to IR and output formats |
70
- | `mf check` | Static analysis |
71
- | `mf fmt` | Format source files |
72
- | `mf play [file]` | Live preview with FluidSynth |
73
- | `mf import <file>` | Import MusicXML to MFS |
74
- | `mf record` | Record MIDI input |
75
- | `mf render -p <profile>` | Render audio |
76
- | `mf doctor` | Check dependencies |
77
-
78
- **Available Templates:** `default`, `piano`, `orchestral`, `edm`, `chiptune`, `jazz`, `vocaloid`, `minimal`
79
-
80
43
  ## Documentation
81
44
 
82
- - **[Language Specification](docs/LANGUAGE.md)** - Complete language syntax, types, and operators
83
-
84
- - **[Builtin Functions](docs/BUILTINS.md)** - Low-level runtime functions (IR operations, MIDI control)
85
- - **[Standard Library](docs/STDLIB.md)** - High-level music functions (theory, patterns, dynamics, etc.)
86
-
87
- ## Language Basics
88
-
89
- ### Pitch & Duration Literals
90
-
91
- **Pitches:**
92
- - Natural: `C4`, `D4`, `E4`, `F4`, `G4`, `A4`, `B4`
93
- - Sharp: `C#4`, `D#4`, `F#4`, `G#4`, `A#4`
94
- - Flat: `Db4`, `Eb4`, `Gb4`, `Ab4`, `Bb4`
95
-
96
- **Durations:**
97
- - `1n` = whole, `2n` = half, `4n` = quarter
98
- - `8n` = eighth, `16n` = sixteenth, `32n` = thirty-second
99
- - `4n.` = dotted quarter, `8n.` = dotted eighth
100
- - `480t` = 480 ticks
101
-
102
- **Time:**
103
- - `1:1` = bar 1, beat 1
104
- - `2:3` = bar 2, beat 3
105
- - `1:1:240` = bar 1, beat 1, tick 240
106
-
107
- **Drum Names:** `kick`, `snare`, `hhc`, `hho`, `tom1`, `crash`, `ride`
108
-
109
- ### Control Structures
110
-
111
- ```mfs
112
- // Procedures
113
- proc myPattern() {
114
- note(C4, 4n);
45
+ **Web Documentation**: https://takomusic.pages.dev (includes Playground)
46
+
47
+ Local documentation:
48
+ - Language spec: `docs/LANGUAGE.md`
49
+ - Core DSL & built-ins: `docs/BUILTINS.md`
50
+ - Standard library: `docs/STDLIB.md`
51
+ - Rendering and plugins: `docs/RENDERING.md`
52
+ - Schemas: `docs/SCHEMAS.md`
53
+
54
+ ## Example (.mf)
55
+
56
+ ```tako
57
+ import { concat, repeat } from "std:core";
58
+ import { kick, snare, hhc } from "std:drums";
59
+ import { majorTriad, minorTriad } from "std:theory";
60
+
61
+ fn drumPart() -> Clip {
62
+ return clip {
63
+ hit(kick, q, vel: 0.9);
64
+ hit(hhc, e, vel: 0.5);
65
+ hit(hhc, e, vel: 0.5);
66
+ hit(snare, q, vel: 0.85);
67
+ hit(hhc, q, vel: 0.5);
68
+ };
115
69
  }
116
70
 
117
- // Loops
118
- for (i in 1..=4) {
119
- myPattern();
71
+ fn chords() -> Clip {
72
+ return clip {
73
+ chord(majorTriad(C4), w, vel: 0.6);
74
+ chord(minorTriad(A3), w, vel: 0.6);
75
+ chord(majorTriad(F3), w, vel: 0.6);
76
+ chord(majorTriad(G3), w, vel: 0.6);
77
+ };
120
78
  }
121
79
 
122
- // Conditionals
123
- if (x > 0) {
124
- note(C4, 4n);
125
- } else {
126
- rest(4n);
127
- }
128
- ```
80
+ export fn main() -> Score {
81
+ return score {
82
+ meta { title "Simple Song"; }
129
83
 
130
- ### Modules
84
+ meter { 1:1 -> 4/4; }
85
+ tempo { 1:1 -> 120bpm; }
131
86
 
132
- ```mfs
133
- // phrases/drums.mf
134
- export proc BEAT_8() {
135
- drum(kick, 8n);
136
- drum(hhc, 8n);
137
- }
87
+ sound "piano" kind instrument { range A0..C8; }
88
+ sound "kit" kind drumKit {
89
+ drumKeys { kick; snare; hhc; }
90
+ }
138
91
 
139
- // main.mf
140
- import { BEAT_8 } from "./phrases/drums.mf";
92
+ track "Piano" role Instrument sound "piano" {
93
+ place 1:1 repeat(chords(), 2);
94
+ }
141
95
 
142
- export proc main() {
143
- track(midi, drums, { ch: 10 }) {
144
- for (bar in 1..=4) {
145
- BEAT_8();
96
+ track "Drums" role Drums sound "kit" {
97
+ place 1:1 repeat(drumPart(), 8);
146
98
  }
147
- }
99
+ };
148
100
  }
149
101
  ```
150
102
 
151
- ### Standard Library Import
103
+ ## Pipeline
152
104
 
153
- ```mfs
154
- import { major, minor } from "std:theory";
155
- import { euclidean } from "std:patterns";
156
- import { crescendo } from "std:dynamics";
157
- ```
105
+ 1. Parse `.mf` -> AST
106
+ 2. Resolve/import + typecheck (Pos/Dur separation)
107
+ 3. Evaluate `main()` -> `Score`
108
+ 4. Normalize IR (bar:beat -> absolute Pos)
109
+ 5. Emit `score.json` (IR v4)
110
+ 6. Render via profile + renderer plugin
158
111
 
159
- ## Configuration (mfconfig.toml)
160
-
161
- ```toml
162
- [project]
163
- name = "my-song"
164
- version = "1.0.0"
165
- entry = "src/main.mf"
166
- dist = "dist"
167
- out = "out"
168
-
169
- [profiles.cli]
170
- backend = "headless"
171
- musicxml_out = "dist/vocal.musicxml"
172
- band_mid_out = "dist/band.mid"
173
- render_out = "out/mix.mp3"
174
- vocal_cmd = ["neutrino", "{musicxml}", "{vocal_wav}"]
175
- midi_cmd = ["fluidsynth", "-ni", "soundfont.sf2", "{mid}", "-F", "{band_wav}"]
176
- mix_cmd = ["ffmpeg", "-i", "{vocal_wav}", "-i", "{band_wav}", "-y", "{mix_wav}"]
177
- ```
178
-
179
- ## External Tools
180
-
181
- ### FluidSynth (Live Preview & MIDI Rendering)
112
+ ## CLI
182
113
 
183
114
  ```bash
184
- # Windows
185
- winget install FluidSynth.FluidSynth
186
-
187
- # macOS
188
- brew install fluid-synth
115
+ # Check syntax and types
116
+ mf check song.mf
189
117
 
190
- # Linux
191
- apt install fluidsynth
192
- ```
118
+ # Build single file (no config required)
119
+ mf build song.mf
120
+ mf build song.mf -o output.json
193
121
 
194
- ### NEUTRINO (Vocal Synthesis)
122
+ # Build project with mfconfig.toml
123
+ mf build
124
+ mf build -w # Watch mode
195
125
 
196
- 1. Download from official site
197
- 2. Set `NEUTRINO_DIR` environment variable
198
- 3. Configure `vocal_cmd` in mfconfig.toml
126
+ # Render to output format
127
+ mf render score.json -p profile.json
128
+ ```
199
129
 
200
- ### FFmpeg (Audio Mixing)
130
+ Renderer plugins are external executables; use `--plugin` to override the resolver if needed.
201
131
 
202
- ```bash
203
- # Windows
204
- winget install FFmpeg
132
+ ## Standard Library
205
133
 
206
- # macOS
207
- brew install ffmpeg
134
+ | Module | Description |
135
+ |--------|-------------|
136
+ | `std:core` | `concat`, `repeat`, `overlay`, `padTo`, `slice`, `shift` |
137
+ | `std:transform` | `transpose`, `stretch`, `quantize`, `swing`, `humanize` |
138
+ | `std:theory` | Chords, scales, intervals, progressions |
139
+ | `std:curves` | `linear`, `easeInOut`, `piecewise` |
140
+ | `std:drums` | Drum keys and patterns |
141
+ | `std:vocal` | `text`, `align`, `vibrato`, `autoBreath` |
208
142
 
209
- # Linux
210
- apt install ffmpeg
211
- ```
143
+ ## Versioning
212
144
 
213
- ## Error Codes
214
-
215
- | Code | Description |
216
- |------|-------------|
217
- | E050 | Global function called after track started |
218
- | E110 | Pitch out of range (0-127) |
219
- | E200 | Vocal note overlap |
220
- | E210 | Invalid/empty lyric in vocal track |
221
- | E220 | drum() used in vocal track |
222
- | E221 | chord() used in vocal track |
223
- | E300 | Top-level execution in imported module |
224
- | E310 | Recursion detected |
225
- | E400 | Import not found / undefined symbol / no main() |
226
- | E401 | For range bounds must be compile-time constants |
145
+ - Language: v4
146
+ - IR schema: `tako.irVersion = 4`
147
+ - Profile schema: `tako.profileVersion = 1`
148
+ - Plugin protocol: `tako.pluginProtocolVersion = 1`
227
149
 
228
150
  ## License
229
151
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=evaluator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluator.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/evaluator.test.ts"],"names":[],"mappings":""}