GenExpr for SublimeText

    Oct 15 2013 | 8:04 pm
    If you are a SublimeText user who like to write GenExpr code, GenExprForSublime might interest you. Any feedback is welcome. I'll had more snippets along the way, feel free to contribute as well by sending me pull request on github.
    Have fun.

    • Oct 16 2013 | 2:18 pm
      Awesome !
    • Oct 17 2013 | 12:08 pm
      I'm a sublimetext AND genexpr newb; can you tell me a bit about how to use this? I'd love to know more.
    • Oct 17 2013 | 6:13 pm
      Well it's nothing but a syntax highlighting theme and a bunch of snippets. So after installing it (I would recommend using package control for that), you can just set the syntax to GenExpr and take advantage of the color scheme and the snippets (you can explore them with the command palette). You can see it in action in the demo video.
    • Nov 02 2013 | 2:28 pm
      thanks ej, this is really brilliant. and typical ej.
      i spend almost all my max time in genexpr these days, so this is going to potentially help a great deal.
      some questions:
      firstly, whilst this is great and all, why can't we get support for .genexpr natively in max?!! writing code in max text is not so cool, and still i cannot double-click on a .genexpr file in the finder and have it open in the max text editor. maybe i'll try and set all .genexpr files to open in sublime text from now on?...
      secondly, if i do not like all of your snippets formatting decisions, would i be able to create alternate .sublime-snippet files and somehow be able to switch between them whilst retaining the global syntax part of your code?
      thirdly, genexpr for textwrangler possible?!
    • Nov 03 2013 | 10:06 pm
      I guess it would make sense that Max opens genexpr files ;-) I'll add a request for that.
      Why wouldn't you like my snippets? ;-) Well you are free to just download the syntax highlighting file it's on my github, and any of your snippets.
      TextWrangler… well I had one of those, but it's not really useful, I used to use the C syntax, and that was good enough. Snippets, among other features, convinced me to switch to sublime.
    • Nov 20 2013 | 12:04 pm
    • Dec 20 2013 | 2:31 pm
      If anyone's interested, I made a small python script that converts .genexpr files to .gendsp, which can be opened directly in Max. Essentially it generates a new patcher file with the correct number of inlets and outlets, which are pre-connected to a codebox object containing the code from the .genexpr file. I mention it in this thread because 1) it makes external editing of GenExpr much easier/more powerful and 2) because there is a simple build system for Sublime Text included as well.
    • Dec 24 2013 | 1:16 pm
      i'm interested to use the python-script to convert genexpr to gendsp. but it doesnt works - on osx with python 2.6.1. i get this error:
      Traceback (most recent call last): File "./makegendsp", line 29, in if 'in{}'.format(i) in genexpr_string and i > in_num : ValueError: zero length field name in format
    • Dec 24 2013 | 3:34 pm
      According to google this is because of a difference between python 2.6 and 2.7 (I'm running Mavericks so I have 2.7.5). Should be no trouble to fix, I'll give it a shot later today!
    • Dec 24 2013 | 3:44 pm
      Ok, should be fixed now! Try giving it a shot.
    • Dec 24 2013 | 11:54 pm
      thank you very much ... ... now it works fine