Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hlolli/csound-mode

Emacs major mode for coding in Csound
https://github.com/hlolli/csound-mode

csound emacs

Last synced: 3 months ago
JSON representation

Emacs major mode for coding in Csound

Awesome Lists containing this project

README

        

[![License GPL 3][badge-license]][copying]
[![MELPA Stable](https://stable.melpa.org/packages/csound-mode-badge.svg)](https://stable.melpa.org/#/csound-mode)
[![Melpa Status](http://melpa.milkbox.net/packages/csound-mode-badge.svg)](http://melpa.milkbox.net/#/csound-mode)

# csound-mode
This package provides both a basic major mode for editing Csound files,
as well as a REPL for fast feedback when composing/sound-designing using Csound.

`csound-mode` provides a set of essential features for interactive development:
* REPL
* Interactive code evaluation
* Code completion
* ElDoc
* Indentation rules
* Syntax highlighting and rainbow delimited score parameters

## Installation

You can install `csound-mode` from `MELPA` using the following command:

M-x package-install [RET] csound-mode [RET]

Alternatively, [download latest release.](https://github.com/hlolli/csound-mode/releases/download/v9.2.0/csound-mode-0.2.0.zip)
and add it manually to load-path like shown here:

```el
;; Change directory path according to csound-mode dir location.
(add-to-list 'load-path "~/.emacs.d/csound-mode/")
(require 'csound-mode)
```

## Requirements

- Emacs 25+
- Csound 6.10+ (any release/compilation after 1. December 2017)

## Usage

`csound-mode` comes with major-mode-hooks, meaning that every time a csound file(.csd/.orc/.sco) is opened in emacs, `csound-mode` will be automatically loaded as major mode. While making it easier to install, this could potentially overwrite other major-mode you have set for csound files.

If you're using `csound-mode` directly from the git repo, and you happen to use the `use-package` macro. Then this could be used in your init.el file.

```Clojure
(use-package csound-mode
:mode (("\\.csd\\'" . csound-mode)
("\\.orc\\'" . csound-mode)
("\\.sco\\'" . csound-mode)
("\\.udo\\'" . csound-mode))
:load-path "packages/csound-mode/")
```
With more options
```emacs-lisp
(use-package csound-mode
:ensure t
:custom
(csound-skeleton-default-sr 96000)
(csound-skeleton-default-ksmps 16)
(csound-skeleton-default-options "-d -oadc -W -3")
(csound-skeleton-default-additional-header "#include \"PATH/TO/YOU/UDOs.udo\"")
:mode (("\\.csd\\'" . csound-mode)
("\\.orc\\'" . csound-mode)
("\\.sco\\'" . csound-mode)
("\\.udo\\'" . csound-mode))
:load-path "~/.emacs.d/elpa/csound-mode/")
```

## Keybindings
C-c C-p `csound-play` Same as doing `csound filename -odac`

C-c C-r `csound-render` Same as doing `csound filename -o filename.wav`

C-c C-z `csound-repl-start`

C-c C-k `csound-abort-compilation` abort compilation (e.g. playback)

C-M-x/C-c C-c `csound-evaluate-region`

C-x C-e `csound-evaluate-line`

C-c C-l `csound-repl-interaction-evaluate-last-expression`

C-c C-s `csound-score-align-block` cursor needs to be within a score block

M-. `csound-score-find-instr-def` cursor needs to be within a score block

C-c C-d h `csound-manual-lookup` searches for a function definition in the Csound-manual

## Run the tests

The tests depend on the package _test-simple.el_.
Run the tests locally from the command line

```
emacs --batch --no-site-file --no-splash --load test/csound-mode-tests.el
```

[badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg
[COPYING]: http://www.gnu.org/copyleft/gpl.html