diff --git a/deno.json b/deno.json index 0dbb1a07..9959498b 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,9 @@ { "name": "@ltgc/octavia", - "version": "0.0.3", + "version": "0.0.4", + "dependencies": { + "@ltgc/rochelle": "jsr:@ltgcgo/rochelle@^0.2.0" + }, "exports": { "./basic": "./dist/basic.mjs", "./bridge": "./dist/bridge.mjs", diff --git a/src/micc/index.mjs b/src/micc/index.mjs index 052e3692..bea3eac1 100644 --- a/src/micc/index.mjs +++ b/src/micc/index.mjs @@ -2,6 +2,8 @@ // Music Instructions Compiler Collection +import TextReader from "../../libs/rochelle@ltgcgo/textRead.mjs"; + let u8Enc = new TextEncoder(); let readVLV = function (buffer) { @@ -57,7 +59,7 @@ let streamDisassemble = function (source) { intValue = 0; let extLen = 0, startNextSect = false, part = 0; let trackIndex = 0; - let sink = new ReadableStream({ + return new ReadableStream({ "pull": async (controller) => { controller.unsent = true; while (controller.unsent) { @@ -409,9 +411,17 @@ let streamDisassemble = function (source) { //console.info("Data pulled."); } }, new ByteLengthQueuingStrategy({"highWaterMark": 256})); - return sink; +}; + +let streamAssemble = function (source) { + return new ReadableStream({ + "pull": async (controller) => { + // + } + }, new ByteLengthQueuingStrategy({"highWaterMark": 256})); }; export { - streamDisassemble + streamDisassemble, + streamAssemble }; diff --git a/utils/others/asm.js b/utils/others/asm.js index 9c6a4364..177315d6 100644 --- a/utils/others/asm.js +++ b/utils/others/asm.js @@ -1,6 +1,6 @@ "use strict"; -//import {streamAssemble} from "../../src/micc/index.mjs"; +import {streamAssemble} from "../../src/micc/index.mjs"; WritableStream.prototype.from = async function (asyncIt) { let writer = this.getWriter(); @@ -14,5 +14,5 @@ WritableStream.prototype.from = async function (asyncIt) { console.info(`Reading MIDI assembly...`); let stream = (await Deno.open(Deno.args[0])).readable); console.info(`Streaming contents to the assembler...`); -//await (await Deno.open(Deno.args[1], {"write": true, "createNew": true})).writable.from(stream); +await (await Deno.open(Deno.args[1] || `${Deno.args[0]}.mid`, {"write": true, "createNew": true})).writable.from(stream); console.info(`Assembly finished.`);