Skip to content

Commit 7312306

Browse files
committed
feat: use csound7
1 parent 2939b03 commit 7312306

File tree

3 files changed

+52
-97
lines changed

3 files changed

+52
-97
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@codemirror/lang-python": "^6.1.2",
1616
"@codemirror/language": "^6.6.0",
1717
"@codemirror/view": "^6.9.3",
18-
"@csound/browser": "^6.18.7",
18+
"@csound/browser": "^7.0.0-beta3",
1919
"@emotion/core": "^11.0.0",
2020
"@emotion/react": "^11.10.6",
2121
"@emotion/styled": "^11.10.6",

src/components/Editor/index.js

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const PlayControls = ({ initialEditorState, currentEditorState }) => {
176176
await libcsound.fs.writeFile(fileName, fetchesResources[fileName]);
177177
});
178178
// forcing 2 channel output until I track down the bug
179-
await libcsound.compileCsdText(currentEditorState);
179+
await libcsound.compileCSD(currentEditorState, 1);
180180
await libcsound.start();
181181
}, [
182182
libcsound,
@@ -284,27 +284,35 @@ const CodeElement = ({ data, lang }) => {
284284
python(),
285285
]
286286
: lang === "c"
287-
? [
288-
EditorState.readOnly.of(true),
289-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
290-
language.of(cpp()),
291-
]
292-
: ["orc", "csd", "sco"].includes(lang)
293-
? [
294-
EditorState.readOnly.of(true),
295-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
296-
csoundMode({
297-
fileType: lang,
298-
enableSynopsis: false,
299-
enableCompletion: false,
300-
}),
301-
]
302-
: isCsd
303-
? [basicSetup, csoundMode(), EditorView.updateListener.of(onChange)]
304-
: [
305-
EditorState.readOnly.of(true),
306-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
307-
],
287+
? [
288+
EditorState.readOnly.of(true),
289+
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
290+
language.of(cpp()),
291+
]
292+
: ["orc", "csd", "sco"].includes(lang)
293+
? [
294+
EditorState.readOnly.of(true),
295+
syntaxHighlighting(defaultHighlightStyle, {
296+
fallback: true,
297+
}),
298+
csoundMode({
299+
fileType: lang,
300+
enableSynopsis: false,
301+
enableCompletion: false,
302+
}),
303+
]
304+
: isCsd
305+
? [
306+
basicSetup,
307+
csoundMode(),
308+
EditorView.updateListener.of(onChange),
309+
]
310+
: [
311+
EditorState.readOnly.of(true),
312+
syntaxHighlighting(defaultHighlightStyle, {
313+
fallback: true,
314+
}),
315+
],
308316
parent: editorReference.current,
309317
});
310318
setEditorView(newEditor);

yarn.lock

Lines changed: 21 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,18 +2525,16 @@
25252525
style-mod "^4.0.0"
25262526
w3c-keyname "^2.2.4"
25272527

2528-
"@csound/browser@^6.18.7":
2529-
version "6.18.7"
2530-
resolved "https://registry.yarnpkg.com/@csound/browser/-/browser-6.18.7.tgz#b7980f954997151433fa51ec37dc9cfc2d238a01"
2531-
integrity sha512-pHC83n1fzV9xp7hkFNBTWYsqkBnOS3qNAA9AJNnu3ZCG35a4rMZ5ydOuFi3qqfkLwRTd+frazabxM/lu0+u0qw==
2528+
"@csound/browser@^7.0.0-beta3":
2529+
version "7.0.0-beta3"
2530+
resolved "https://registry.yarnpkg.com/@csound/browser/-/browser-7.0.0-beta3.tgz#749bad570569b00679c94af6f65c77760f36788d"
2531+
integrity sha512-tNC8flrNFQnaYynaOdm9ztkTQkePCs7mUM+y8iEviXUwhKR2d+1RVqwFcaU1B5x6n5SIpxF5MT+saLWclvOKEA==
25322532
dependencies:
2533-
comlink "^4.3.1"
2534-
eslint-plugin-n "^15.5.1"
25352533
eventemitter3 "^4.0.7"
25362534
google-closure-compiler "^20221102.0.1"
25372535
google-closure-library "^20221102.0.0"
2538-
path-browserify "^1.0.1"
2539-
rambda "^7.4.0"
2536+
pako "^2.1.0"
2537+
ramda "^0.28.0"
25402538
rimraf "^3.0.2"
25412539
standardized-audio-context "^25.3.35"
25422540
text-encoding-shim "^1.0.5"
@@ -4741,13 +4739,6 @@ builtin-modules@^3.1.0:
47414739
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484"
47424740
integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==
47434741

4744-
builtins@^5.0.1:
4745-
version "5.0.1"
4746-
resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9"
4747-
integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==
4748-
dependencies:
4749-
semver "^7.0.0"
4750-
47514742
47524743
version "3.0.0"
47534744
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
@@ -5049,11 +5040,6 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
50495040
dependencies:
50505041
delayed-stream "~1.0.0"
50515042

5052-
comlink@^4.3.1:
5053-
version "4.3.1"
5054-
resolved "https://registry.yarnpkg.com/comlink/-/comlink-4.3.1.tgz#0c6b9d69bcd293715c907c33fe8fc45aecad13c5"
5055-
integrity sha512-+YbhUdNrpBZggBAHWcgQMLPLH1KDF3wJpeqrCKieWQ8RL7atmgsgTQko1XEBK6PsecfopWNntopJ+ByYG1lRaA==
5056-
50575043
commander@^2.20.0:
50585044
version "2.20.3"
50595045
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
@@ -6131,14 +6117,6 @@ eslint-module-utils@^2.7.3:
61316117
dependencies:
61326118
debug "^3.2.7"
61336119

6134-
eslint-plugin-es@^4.1.0:
6135-
version "4.1.0"
6136-
resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9"
6137-
integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==
6138-
dependencies:
6139-
eslint-utils "^2.0.0"
6140-
regexpp "^3.0.0"
6141-
61426120
eslint-plugin-flowtype@^8.0.3:
61436121
version "8.0.3"
61446122
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912"
@@ -6192,20 +6170,6 @@ eslint-plugin-jsx-a11y@^6.5.1:
61926170
minimatch "^3.1.2"
61936171
semver "^6.3.0"
61946172

6195-
eslint-plugin-n@^15.5.1:
6196-
version "15.6.1"
6197-
resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.6.1.tgz#f7e77f24abb92a550115cf11e29695da122c398c"
6198-
integrity sha512-R9xw9OtCRxxaxaszTQmQAlPgM+RdGjaL1akWuY/Fv9fRAi8Wj4CUKc6iYVG8QNRjRuo8/BqVYIpfqberJUEacA==
6199-
dependencies:
6200-
builtins "^5.0.1"
6201-
eslint-plugin-es "^4.1.0"
6202-
eslint-utils "^3.0.0"
6203-
ignore "^5.1.1"
6204-
is-core-module "^2.11.0"
6205-
minimatch "^3.1.2"
6206-
resolve "^1.22.1"
6207-
semver "^7.3.8"
6208-
62096173
eslint-plugin-react-hooks@^4.3.0:
62106174
version "4.6.0"
62116175
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"
@@ -6255,25 +6219,13 @@ eslint-scope@^7.1.1:
62556219
esrecurse "^4.3.0"
62566220
estraverse "^5.2.0"
62576221

6258-
eslint-utils@^2.0.0:
6259-
version "2.1.0"
6260-
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
6261-
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
6262-
dependencies:
6263-
eslint-visitor-keys "^1.1.0"
6264-
62656222
eslint-utils@^3.0.0:
62666223
version "3.0.0"
62676224
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
62686225
integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
62696226
dependencies:
62706227
eslint-visitor-keys "^2.0.0"
62716228

6272-
eslint-visitor-keys@^1.1.0:
6273-
version "1.3.0"
6274-
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
6275-
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
6276-
62776229
eslint-visitor-keys@^2.0.0:
62786230
version "2.0.0"
62796231
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8"
@@ -7334,7 +7286,7 @@ identity-obj-proxy@^3.0.0:
73347286
dependencies:
73357287
harmony-reflect "^1.4.6"
73367288

7337-
ignore@^5.1.1, ignore@^5.2.0:
7289+
ignore@^5.2.0:
73387290
version "5.2.4"
73397291
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
73407292
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
@@ -7471,7 +7423,7 @@ is-core-module@^2.1.0:
74717423
dependencies:
74727424
has "^1.0.3"
74737425

7474-
is-core-module@^2.11.0, is-core-module@^2.8.1, is-core-module@^2.9.0:
7426+
is-core-module@^2.8.1, is-core-module@^2.9.0:
74757427
version "2.11.0"
74767428
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144"
74777429
integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==
@@ -9157,6 +9109,11 @@ p-try@^2.0.0:
91579109
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
91589110
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
91599111

9112+
pako@^2.1.0:
9113+
version "2.1.0"
9114+
resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86"
9115+
integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==
9116+
91609117
pandoc-filter-promisified@^0.1.0:
91619118
version "0.1.0"
91629119
resolved "https://registry.yarnpkg.com/pandoc-filter-promisified/-/pandoc-filter-promisified-0.1.0.tgz#84efee588ed4d92f293ee23e6849278807a4f2fa"
@@ -9236,11 +9193,6 @@ pascal-case@^3.1.2:
92369193
no-case "^3.0.4"
92379194
tslib "^2.0.3"
92389195

9239-
path-browserify@^1.0.1:
9240-
version "1.0.1"
9241-
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd"
9242-
integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==
9243-
92449196
path-exists@^3.0.0:
92459197
version "3.0.0"
92469198
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
@@ -10061,11 +10013,6 @@ raf@^3.4.1:
1006110013
dependencies:
1006210014
performance-now "^2.1.0"
1006310015

10064-
rambda@^7.4.0:
10065-
version "7.4.0"
10066-
resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.4.0.tgz#61ec9de31d3dd6affe804de3bae04a5b818781e5"
10067-
integrity sha512-A9hihu7dUTLOUCM+I8E61V4kRXnN4DwYeK0DwCBydC1MqNI1PidyAtbtpsJlBBzK4icSctEcCQ1bGcLpBuETUQ==
10068-
1006910016
ramda@^0.28.0:
1007010017
version "0.28.0"
1007110018
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.28.0.tgz#acd785690100337e8b063cab3470019be427cc97"
@@ -10508,7 +10455,7 @@ regexp.prototype.flags@^1.4.3:
1050810455
define-properties "^1.1.3"
1050910456
functions-have-names "^1.2.2"
1051010457

10511-
regexpp@^3.0.0, regexpp@^3.2.0:
10458+
regexpp@^3.2.0:
1051210459
version "3.2.0"
1051310460
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
1051410461
integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
@@ -10869,20 +10816,20 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
1086910816
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
1087010817
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
1087110818

10872-
semver@^7.0.0, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8:
10873-
version "7.3.8"
10874-
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
10875-
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
10876-
dependencies:
10877-
lru-cache "^6.0.0"
10878-
1087910819
semver@^7.3.2:
1088010820
version "7.3.4"
1088110821
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97"
1088210822
integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==
1088310823
dependencies:
1088410824
lru-cache "^6.0.0"
1088510825

10826+
semver@^7.3.5, semver@^7.3.7, semver@^7.3.8:
10827+
version "7.3.8"
10828+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
10829+
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
10830+
dependencies:
10831+
lru-cache "^6.0.0"
10832+
1088610833
1088710834
version "0.18.0"
1088810835
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be"

0 commit comments

Comments
 (0)