flucoma-sc icon indicating copy to clipboard operation
flucoma-sc copied to clipboard

FluidBufNMF argument `resynthMode` is redundant

Open tedmoore opened this issue 3 years ago • 1 comments

FluidBufNMF's argument resynthMode is currently used to specify whether or not the object should perform resynthesis after decomposition and write it into the buffer specified by resynth. Because a buffer needs to be specified by resynth, this is enough to indicate to the object that resynthesis should occur, therefore resynthMode is redundant.

I propose that we remove the resynthMode argument from the class definition in SuperCollider. The class definition can simply check if resynth is a buffer or nil, and if it is a buffer pass "resynthMode = 1" to the client.

I understand that this will break parity with the other CCEs and I still think it makes sense to do. I'm happy to implement if agreement is reached.

tedmoore avatar Jul 13 '22 09:07 tedmoore

Thanks for reporting. An esm loader is needed to be implemented. I'll fix this later.

songkeys avatar Nov 29 '21 06:11 songkeys

After taking another look, I'm not quite sure about how this should be implemented.

ts-node has given a good example https://github.com/TypeStrong/ts-node/blob/3a2848c9968f03f7b05e57e833ca256b52ab4e18/src/esm.ts but it involves many experimental features and immature specs. https://github.com/TypeStrong/ts-node/issues/1007

We should expect TypeScript supporting ESM first then consider what we should follow. This should be covered in TypeScript 4.6 (ideally). https://github.com/microsoft/TypeScript/issues/46452

If anyone has a better solution please let me know :)

songkeys avatar Dec 01 '21 04:12 songkeys