Need help to create a livecoding system

Hello everyone, I’m new to atom and so I need help from you.
My project is to create a livecoding system for art creations.
I would like to send a block text after evaluation in atom to Max/Msp via udp.
No syntax highlighting, console or other fancy stuff for the moment. Just write a text, and send a part of it via udp to max, exactly like in TidalCycle for those who knows this package, you can do shift+enter to eval a line, or ctrl+enter to eval a block.
Can Atom is capable to do it by itself ? Can you explain what I need to do to achieve this?

Thank you very much for your answer,

Guillaume

Although I have absolutely no idea what you are trying, will this package help?

hey thank you for your answer :slight_smile: I know this package and is not exactly what I want.

Sorry if it wasn’t clear.

I try to go straight to the point:

Let’s say I have a text in atom, if I put my cursor in this text and press ctrl+enter, this text will be sent via udp to another software.

is it better?

Not having done this in Atom, I would approach the task by writing an external Python script run through process-palette command to capture selected text for passing on.

Hey,
I found a nice package which send all my text as one string to an osc port.

Now, I’m trying to change it a little, instead of sending all the text in one string via getText() I would like to send only the paragraph on which the cursor is.
I’m searching right now in the API, but with no success, can someone help me?

Thank you very much

Guillaume

Okay I have some news :slight_smile:

With editor = atom.workspace.getActiveTextEditor();

and editor.getBuffer().getTextInRange(editor.getCurrentParagraphBufferRange())

It working :slight_smile:

but if I try to eval this on a empty line I have this error :
Uncaught TypeError: Cannot read property ‘start’ of undefined

In my workflow I am passing Atom variables to external scripts. The key is to use the python module argsparse in the external script. Then you can pass any Atom variable as a series of arguments. I use process-palette to run an internal Atom command which simply calls the external script. If you look at the {variables} available for any process-palette custom command you have a rich choice. This is my preferred approach to communicate with external apps from Atom editor. If you wish to pass the entire text block you would use the variable {text} - but then you might also pass {fileAbsPath} as an arg and let the external script lookup the text. Or using argsparse you can pass multiple vars.