Coder Social home page Coder Social logo

lisongx / atom-tidal Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 35.0 34 KB

Atom Editor plugin for tidalcycles(Since tidal version 0.8, the offical atom plugin atom-tidalcycles should be used)

Home Page: https://github.com/tidalcycles/atom-tidalcycles

License: MIT License

CoffeeScript 80.66% Haskell 5.49% CSS 13.85%

atom-tidal's Introduction

【Moved】

Since tidal version 0.8, the offical atom plugin atom-tidalcycles should be used.

Tidal for Atom

tidal is a live-coding pattern language

Setup

  1. Install Tidal

  2. Install tidal package in atom editor

  3. The default ghci path is in /usr/local/bin/ghci, you can change this in the package setting view.

  4. running dirt

  5. Open a .tidal file, and select Boot in the submenu Tidal

  6. Then, you can:

  • shift+enter to evaluate current line or selection

  • cmd+enter to evaluate multi-lines or selection

You can customize if you want, see atom's doc

atom-tidal's People

Contributors

gmuller avatar lisongx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atom-tidal's Issues

Uncaught Error: write EPIPE

[Enter steps to reproduce below:]

  1. Boot Tidal

Atom Version: 1.0.19
System: Microsoft Windows 10 Home
Thrown From: tidal package, v2.1.0

Stack Trace

Uncaught Error: write EPIPE

At events.js:141

Error: write EPIPE
  at exports._errnoException (util.js:814:11)
  at Socket._writeGeneric (net.js:672:26)
  at Socket._write (net.js:691:8)
  at doWrite (_stream_writable.js:291:12)
  at writeOrBuffer (_stream_writable.js:277:5)
  at Socket.Writable.write (_stream_writable.js:206:11)
  at Socket.write (net.js:615:40)
  at REPL.module.exports.REPL.stdinWrite (C:\Users\Matthew_Tan\.atom\packages\tidal\lib\repl.coffee:56:17)
  at REPL.module.exports.REPL.tidalSendLine (C:\Users\Matthew_Tan\.atom\packages\tidal\lib\repl.coffee:59:6)
  at REPL.module.exports.REPL.initTidal (C:\Users\Matthew_Tan\.atom\packages\tidal\lib\repl.coffee:53:7)
  at REPL.module.exports.REPL.start (C:\Users\Matthew_Tan\.atom\packages\tidal\lib\repl.coffee:70:6)
  at atom-workspace.REPL.atom.commands.add.tidal:boot (C:\Users\Matthew_Tan\.atom\packages\tidal\lib\repl.coffee:23:10)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Matthew_Tan\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (C:\Users\Matthew_Tan\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Matthew_Tan\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:145:19)
  at EventEmitter.<anonymous> (C:\Users\Matthew_Tan\AppData\Local\atom\app-1.0.19\resources\app.asar\src\window-event-handler.js:70:30)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:169:7)

Commands

     -0:17.5.0 settings-view:open (atom-text-editor.editor.is-focused)
     -0:03.1.0 tidal:boot (atom-text-editor.editor.is-focused)

Config

{
  "core": {},
  "tidal": {
    "ghciPath": "C:\\Program Files\\Haskell Platform\\7.10.2-a\\bin"
  }
}

Installed Packages

# User
tidal, v2.1.0

# Dev
No dev packages

Miscalculated evals from wrapping text

If you shrink the window so that a line of code wraps, then try to evaluate a pattern after it, it miscounts the line you're on and evaluates the line after it.

For example if you were to try to evaluate d2 here then d3 would be evaluated:

d1 $ very long pattern goes here alwiejf awleijga wleigja welgi jwaegliwa jeglwa ijegalwei jglwaeigjawel gijawelgi jawelgi j

d2 $ sound "bd sn"
d3 $ sound "glitch glitch:2"

Uncaught Your ghci path: '/cygdrive/c/Program Files/Haskell Platform/2014.2.0.0/bin/ghci' is invalid

[Enter steps to reproduce below:]

  1. Opened test.tidal
  2. Packages --> Tidal -- > Boot Tidal

Atom Version: 0.190.0
System: Windows 7
Thrown From: tidal package, v0.6.6

Stack Trace

Uncaught Your ghci path: '/cygdrive/c/Program Files/Haskell Platform/2014.2.0.0/bin/ghci' is invalid

At C:\Users\user\.atom\packages\tidal\lib\repl.coffee:41

undefined

Commands

     -0:13.2 tidal:boot (atom-text-editor.editor)

Config

{
  "core": {},
  "tidal": {
    "ghciPath": "/cygdrive/c/Program Files/Haskell Platform/2014.2.0.0/bin/ghci"
  }
}

Installed Packages

# User
tidal, v0.6.6

# Dev
No dev packages

I want to use Tidal and followed instructions for Windows from here: http://tidal.lurk.org/getting_started.html
Installed Cygwin, Portaudio, Liblo, Dirt, Haskell platform and Atom as instructed. GHCi path was generated by typing 'which ghci' in Cygwin. In Atom's Tidal package settings also tried these GHCi paths:

Default path
/cygdrive/c/Program Files/Haskell Platform/2014.2.0.0/bin/
/cygdrive/c/Program Files/Haskell Platform/2014.2.0.0/bin/ghci.exe

Deprecated Atom APIs will be removed June 1st

Atom will no longer load this package after June 1st without changes. There are a couple deprecations on the latest version (0.6.6) of this package:

  1. Call ::getActiveTextEditor instead
  2. Use Decoration::setProperties instead
  3. Use editor.getCursorScreenPosition().row instead
  4. Use TextEditor::lineTextForBufferRow(bufferRow) instead

Visit https://gist.github.com/benogle/6d09e295c84b717ef9b4 and search for your package name to see up-to-date deprecations.

If this package has been replaced by another package or functionality in core, please reply with this information.

See atom/atom#6867 for more info. Thanks!

'Paragraph' eval not including punctuation

As mentioned on another issue..

I noticed that with multiline evals, some characters aren't counted, for example the trailing square bracket here isn't included, and the pattern doesn't evaluate:

d1 $ weave 16 (speed (scale 1 1.4 sine1)) [jux (iter 8) $ sound "sd8:4*4",
                                           jux (iter 4) $ sound "bd*2",
                                           jux (iter 3) $ sound "sd8:3*4"
                                          ]

It seems to be caused by the use of \w in regex here:
https://github.com/atom/atom/blob/f7bb8aab9e33090cc8455cfdf045efe6257568d9/src/app/language-mode.coffee#L183
I'll raise an issue over there.

Uncaught TypeError: Cannot read property 'stdin' of undefined

The plugin crashes if you try to evaluate something without first booting tidal.

To reproduce:

  1. Open a tidal file
  2. Try to evaluate something without booting tidal first..

Maybe a little error should pop up, or maybe it should just boot tidal if it's not already running?

Atom Version: 0.176.0
System: linux 3.13.0-37-generic
Thrown From: tidal package, v0.4.0

Stack Trace

Uncaught TypeError: Cannot read property 'stdin' of undefined

At /home/alex/.atom/packages/tidal/lib/repl.coffee:38

TypeError: Cannot read property 'stdin' of undefined
  at REPL.module.exports.REPL.stdinWrite (/home/alex/.atom/packages/tidal/lib/repl.coffee:38:10)
  at REPL.module.exports.REPL.tidalSendLine (/home/alex/.atom/packages/tidal/lib/repl.coffee:41:6)
  at REPL.module.exports.REPL.tidalSendExpression (/home/alex/.atom/packages/tidal/lib/repl.coffee:45:6)
  at /home/alex/.atom/packages/tidal/lib/repl.coffee:82:8
  at REPL.module.exports.REPL.evalWithRepl (/home/alex/.atom/packages/tidal/lib/repl.coffee:84:5)
  at REPL.module.exports.REPL.eval (/home/alex/.atom/packages/tidal/lib/repl.coffee:59:6)
  at atom-text-editor.REPL.atom.commands.add.tidal:eval-multi-line (/home/alex/.atom/packages/tidal/lib/repl.coffee:21:35)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:170:20)

Commands

  2x -0:01.8 core:move-up (atom-text-editor.editor.is-focused)
     -0:01.2 tidal:eval-multi-line (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "graphite-ui",
      "adventurous-syntax"
    ]
  }
}

Installed Packages

# User
adventurous-syntax, v0.1.2
autocomplete-plus, v2.0.3
graphite-ui, v0.13.2
ide-haskell, v0.3.0
language-haskell, v1.0.0
linter-hlint, v0.3.1
tidal, v0.4.0

# Dev
No dev packages

/cc @atom/core

Workspace.getActiveEditor is deprecated.

Hey Sean, any interest in trying to clean up atom-tidal so that we don't get deprecated calls?

Just a thought!

-Robbie Jacobs

Call ::getActiveTextEditor instead

Workspace.getActiveEditor (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:1022:12)
REPL.getEditor (/Users/robjac/.atom/packages/tidal/lib/repl.coffee:67:19)
REPL.editorIsTidal (/Users/robjac/.atom/packages/tidal/lib/repl.coffee:29:13)
atom-workspace.REPL.atom.commands.add.tidal:boot (/Users/robjac/.atom/packages/tidal/lib/repl.coffee:22:23)

Support for ghci installed by stack

The issue is that the ghci executable does does not have the paths set to load the stack installed libraries (i.e. tidal if it was installed via stack). You have to use stack exec ghci or stack ghci.

I mainly created this issue to post a workaround I created. You can create the following bash script, and set it as the ghci path in the plugin settings.

#!/usr/bin/env bash

stack exec ghci -- "$@"

Uncaught Your ghci path is not valid

[Enter steps to reproduce below:]

  1. opening file from desktop (named test.tidal)
  2. booting Tidal

Atom Version: 0.186.0
System: Mac OS X 10.10.2
Thrown From: tidal package, v0.6.5

Stack Trace

Uncaught Your ghci path is not valid

At /Users/alagg/.atom/packages/tidal/lib/repl.coffee:41

undefined

Commands

     -3:29.8 settings-view:open (ul.list-inline.tab-bar.inset-panel)
     -0:39.7 tidal:eval (atom-text-editor.editor.is-focused)
     -0:28.0 settings-view:open (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:02.0 tidal:eval (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "tidal": {}
}

Installed Packages

# User
tidal, v0.6.5

# Dev
No dev packages

Uncaught Error: spawn EACCES

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.187.0
System: Mac OS X 10.10.2
Thrown From: tidal package, v0.6.6

Stack Trace

Uncaught Error: spawn EACCES

At child_process.js:1160

Error: spawn EACCES
    at exports._errnoException (util.js:753:11)
    at ChildProcess.spawn (child_process.js:1160:11)
    at exports.spawn (child_process.js:993:9)
    at REPL.module.exports.REPL.doSpawn (/Users/jay/.atom/packages/tidal/lib/repl.coffee:58:19)
    at REPL.module.exports.REPL.start (/Users/jay/.atom/packages/tidal/lib/repl.coffee:113:12)
    at atom-workspace.REPL.atom.commands.add.tidal:boot (/Users/jay/.atom/packages/tidal/lib/repl.coffee:33:26)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:246:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:159:19)
    at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:75:30)

Commands

     -0:16.4 core:save (atom-text-editor.editor.is-focused)
     -0:00.8 tidal:boot (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "tidal": {
    "ghciPath": "/usr/bin/"
  }
}

Installed Packages

# User
tidal, v0.6.6

# Dev
No dev packages

Location of ghci

The location is set to /usr/local/bin/ghci but in a lot of systems it will be /usr/bin/ghci. Maybe the plugin could try both? It could also be an option.

Thanks!

'cmd-enter' keybinding does not work on Windows or Linux

The cmd-enter keybinding to evaluate multiple lines does not work on Windows or Linux because there is no cmd key.

An additional ctrl-enter keybinding should work. Any concerns about adding this? I have a fix ready to go.

Not in scope: 'd1'

I have Jack and Dirt running, but none of the Tidal functions are in scope. I can eval regular ghci stuff just fine from Atom, and Tidal is working for me outside of Atom.

Handle things a bit better when cursor not on code

If I rest my cursor above some code and do option-enter, the console pops up and I get this:
Uncaught TypeError: Cannot read property 'start' of undefined /usr/share/atom/resources/app/node_modules/text-buffer/lib/range.js:26

Mind you it's handy to have the console open to see error messages..

Workspace.getActiveEditor is deprecated.

Call ::getActiveTextEditor instead

Workspace.getActiveEditor (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:999:12)
REPL.getEditor (/Users/sean/.atom/packages/tidal/lib/repl.coffee:67:19)

Multi-line patterns

Works great here! Would be good to be able to eval multiple lines, as with the emacs version and ctrl-c ctrl-e (or ctrl-enter)

Search system path for ghci

Finding the path to ghci is pretty difficult in windows, and confusing for new users.. It would be great if the default value of the ghci path was just ghci and it searched the system path.

How to view Tidal warnings?

As I mentioned on issue #2, there doesn't seem to be a way to see tidal's error output. I managed to get a console up showing haskell output on the previous version, but can't find a way to do that now.

Changes required for upcoming CoffeeScript upgrade

Hi! Thanks for maintaining the tidal package!

In Atom v1.12, we are going to upgrade CoffeeScript to the latest version. This upgrade entails one potentially breaking change to the language:

Changed strategy for the generation of internal compiler variable names. Note that this means that @example function parameters are no longer available as naked example variables within the function body.

We think your package may be affected by this upgrade, in the following places:

  • The path variable here
  • The path variable here

These findings are based on linting packages with coffeescope. We could be wrong about some of them. When we release v1.12 beta, please test your package against it to make sure that it works. Let me know if you have any further questions; I will be happy to help!

Uncaught Your ghci path: '/usr/local/bin/ghci' is invalid

I have incredibly minimal experience with installing things like this, so apologies if this is some really easy problem I missed. I installed everything as it said to on tidal.lurk.org. I had to use the JackOSX Installer if that makes any difference.

Any advice on what to do here?

[Enter steps to reproduce below:]

  1. Open empty document
  2. Save As "test.tidal"
  3. Attempt to boot Tidal from Packages menu

Atom Version: 0.194.0
System: Mac OS X 10.10
Thrown From: tidal package, v0.6.6

Stack Trace

Uncaught Your ghci path: '/usr/local/bin/ghci' is invalid

At /Users/Zavras/.atom/packages/tidal/lib/repl.coffee:41

undefined

Commands

     -0:00.3.0 tidal:boot (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {}
}

Installed Packages

# User
tidal, v0.6.6

# Dev
No dev packages

Missing GHCI path setting

According to the readme:

  1. The default ghci path is in /usr/local/bin/ghci, you can change this in the package setting view.

However, this setting is nowhere to be found in the Atom/Tidal package settings screen.

image

image

image

Using 64 bit Atom 1.4.0 on Windows 10 with Tidal package 2.1.0

ghci config path still not visible

After upgrading to 0.6.1, the ghci path still does not show up in the Tidal package settings. This is on Windows 8.1, Atom 0.182.0, I see no issue with the package code as-is, so I don't know what the problem is. I'm able to add/modify settings in other packages without issue. Curious if anyone besides me cannot see the ghci setting either.

image

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. Packages --> Tidal -- > Boot Tidal

Atom Version: 0.196.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.9.5
Thrown From: tidal package, v0.6.6

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/kqvc/.atom/packages/tidal/lib/repl.coffee:67

TypeError: undefined is not a function
  at REPL.module.exports.REPL.getEditor (/Users/kqvc/.atom/packages/tidal/lib/repl.coffee:67:20)
  at REPL.module.exports.REPL.editorIsTidal (/Users/kqvc/.atom/packages/tidal/lib/repl.coffee:29:14)
  at atom-workspace.REPL.atom.commands.add.tidal:boot (/Users/kqvc/.atom/packages/tidal/lib/repl.coffee:22:24)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:153:19)
  at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:71:30)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:166:7)

Commands

     -4:06.9.0 tidal:boot (atom-text-editor.editor)
     -2:29.9.0 core:copy (atom-text-editor#tidal.ghciPath.editor.mini)
  3x -0:45.2.0 tidal:boot (atom-text-editor#tidal.ghciPath.editor.mini)

Config

{
  "core": {},
  "tidal": {
    "ghciPath": "/usr/bin/ghci"
  }
}

Installed Packages

# User
tidal, v0.6.6

# Dev
No dev packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.