Open JTriggerFish opened 6 years ago
Cool. Are you OK with the code annotations going away? I've thought about trying to abstract them so that they could be re-implemented for other editors besides CodeMirror but it would be a ton of work...
There might be a few other editor-dependent issues to look at. Did you see this project? https://www.youtube.com/watch?v=SEvG3dqVk18
Great thanks. Yes I saw that, should provide a good starting point.
That's fine for the annotations, I expected that. I'm hopeful that most of them can be done without too much effort using this: https://github.com/Microsoft/vscode-extension-samples/tree/master/decorator-sample or taking inspiration from this: https://github.com/hoovercj/vscode-power-mode
Waveform display will probably be trickier though but that will be a second step.
Cool, I hadn’t seen that decorator example before. Looks promising!
CodeMirror is also getting a dramatic rewrite (which will include support for mobile devices), so I might need to refactor the annotations soon anyways; if so I could try and do a vscode implementation at the same time.
I’m struggling a bit with the window.foo global variables as these don’t work outside the browser, wouls you have a suggestion for a quick workaround ?
I don't know how the global object works in vscode, but I just changed the export method in gibber.js so that it doesn't explicitly call window:
If you change the line in init
that calls export
and pass in whatever the global object is, maybe that will fix your problem?
Thanks ! As far as I can tell so far there isn't a global object that can be freely written to but I'm still digging.
Hmmm... interesting. I guess you could declare an object (maybe even name it window
, or global
) and then execute all code within a with
block? I know it's deprecated but it still seems to work in Chrome at least... might be good enough for now.
You'd need to add the with
blocks in a couple of places:
Thank you! not 100% sure whether this will work yet but I've done this for now to keep moving forward with other issues. I'm getting an error on: genish.gen.memory = genish.gen.createMemory( 88200, Float64Array )
I'm guessing that the genish.js that is on npm is out of date ?
Yep, exactly. I just bumped up the version on npm to fix this. Thanks!
I believe there's an issue with the package's code, it reads: createMemory( amount, type ) { const mem = MemoryHelper.create( mem, type ) },
but it should be: createMemory( amount, type ) { const mem = MemoryHelper.create( amount, type ) return mem },
?
Ugh, I don't know how that even happened. Fixed.
No worries, thank you ! I also resolved the window issue by writing a dummy global module and importing it everywhere: https://github.com/JTriggerFish/vscode-gibberwocky/blob/master/gibber/global.js
hopefully should have at least the communication working soon.
Hi Charlie, Bit of a long shot but would you by any chance have a test websocket server that sends back what ableton is supposed to send back in order to test gibberwocky's communication without running ableton ? Also see my pull request on genish.js Thanks !
I'd like to write a vscode extension to write gibberwocky in there rather than in the browser. Rather than copy the code it would be cleaner if I could require an npm package ( like the atom gibber package does ).