tidalcycles / pulsar-tidalcycles

Pulsar plugin for TidalCycles
https://web.pulsar-edit.dev/packages/tidalcycles
GNU General Public License v3.0
50 stars 28 forks source link

bring tidal-listener option back #200

Open polymorphicengine opened 1 year ago

polymorphicengine commented 1 year ago

hey! I just updated the tidal listener (https://github.com/tidalcycles/Tidal/pull/996) and it is now much more like ghci, i think it would be great to be able to choose it as an interpreter (hopefully in the future it will be runnable without an installed haskell environment).

currently you can send it haskell statements to evaluate, ask for types and load haskell files containing definitions. to do this you send it messages like /eval <code> or /type <code>.

what i am wondering is if i should make it even more ghci like and just have it receiv one type of message that is either an expression to evaluate or starts with :t or :load.

on the other hand this could also be handled on the editor side of things, which do you think would be better?

ndr-brt commented 1 year ago

Hey, that's great to hear! In fact tidal-listener option is still available on the plugin, but it needs to be updated to the new behavior. The problem is that currently we're not able to release a new plugin version because of this: https://github.com/pulsar-edit/package-backend/issues/63

But in general can't wait for this!

rlafuente commented 1 year ago

I was trying to get the tidal-listener mode to work (i need flashing numbers!), but after updating everything and reinstalling tidal + tidal-listener, I get this when evaluating a block in Pulsar:

Unhandled message: Message {messageAddress = "/code", messageDatum = [AsciiString {d_ascii_string = "d0"},AsciiString {d_ascii_string = "jux rev $\nn (scale \"minor\" (\n struct \"t([9|13]*16,16,[1|3])\"\n $ rot \"<[5|4|3] 2 [1|2|3] 0>\"\n $ \"[0 2 3 4 [6|9] 7 6 [8|10]]*2\")\n |+ \"[-12|-12|0|12]*16\"\n |+ \"<3 -2 1 1 0 0 0 0>\"\n )\n# sound \"superpiano\"\n# velocity \"[0.5|0.55]*16\"\n# sustain \"[4|7]*16\"\nhush"}]}

(this appears in the tidal-listener prompt, btw, not Pulsar)

Is this expected? I remember asking @ndr-brt about this on Discord and hearing tidal-listener should be working, but I'm a bit lost after reading this issue and the comments :)

polymorphicengine commented 1 year ago

it will take some time to reintegrate the current updated version of the listener with the editor plugins since the API slightly changed, it shouldn't be much work though since the listener is now quite ghci-like

rlafuente commented 1 year ago

Thank you for such a quick reply -- I was hoping I could use this on a showcase tomorrow, and it's useful to know I shouldn't try further for now :) and thank you for being on top of this

ndr-brt commented 1 year ago

hey @polymorphicengine is the new api described somewhere? I looked at the tidal-listener readme but it seems not changed

polymorphicengine commented 1 year ago

yes, it should be exactly how it is described in the link you posted. /code messages are deprecated and replaced with /eval

rlafuente commented 10 months ago

Ok I really really want this feature to happen and want to help make it real.

I have some experience building pulsar plugins, but need some hand-holding on what needs changing. I expect it's more than replacing /code calls with /eval?

ndr-brt commented 10 months ago

Ok I really really want this feature to happen and want to help make it real.

I have some experience building pulsar plugins, but need some hand-holding on what needs changing. I expect it's more than replacing /code calls with /eval?

hey! all the logic for handling tidal-listener should be located in the tidal-listener-repl.js file, IIRC there still was some duplication with the repl.js (the standard one), but it worked with the old tidal-listener version. Last time I tried I wasn't able to make tidal-listener work but I guess it was something on my side

yaxu commented 10 months ago

Hey just to add that I'm not sure if anyone has got highlighting working via tidal-listener yet! The mechanics are there but it might need a bit more work.