Skip to content

Commit

Permalink
Experiment with added dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Jun 15, 2024
1 parent cba7427 commit ac83ce3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
5 changes: 4 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 13 additions & 3 deletions src/micc/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

// Music Instructions Compiler Collection

import TextReader from "../../libs/rochelle@ltgcgo/textRead.mjs";

let u8Enc = new TextEncoder();

let readVLV = function (buffer) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
};
4 changes: 2 additions & 2 deletions utils/others/asm.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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.`);

0 comments on commit ac83ce3

Please sign in to comment.