Skip to content

Instantly share code, notes, and snippets.

View fennecdjay's full-sized avatar
🎵
Star Gwion, You'll make my day

Jérémie Astor fennecdjay

🎵
Star Gwion, You'll make my day
  • France
View GitHub Profile
@fennecdjay
fennecdjay / soundpipe.h
Last active February 7, 2017 00:11
use this to compile ff2spa without soundpipe
#ifndef SPFLOAT
#define SPFLOAT double
#endif
@fennecdjay
fennecdjay / doc.c
Last active November 22, 2017 00:29
Base for Stat and Snfile plugin.
#include <string.h>
#include "defs.h"
#include "map.h"
#include "context.h"
#include "func.h"
#include "err_msg.h"
#ifndef GWION_DOC_DIR
#define GWION_DOC_DIR "/usr/lib/Gwion/doc/"
#endif
@fennecdjay
fennecdjay / rissetbeats.ck
Last active March 23, 2017 01:21
Reworked from electro-music.
5.0 => float songlength;
[660.0, 587.0, 440.0, 392.0, 370.0, 392.0] @=> float freqs[];
[0.5, 1.5, 2.5, 3.0, 3.5, 4.0] @=> float soundtimes[];
[0.5, 0.5, 1.0, 1.0, 1.0, 1.0] @=> float amps[];
[20, 20, 20, 20, 20, 20] @=> int num[];
for (0 => int i; i < freqs.size(); 1 +=> i) {
SinOsc s[num[i]];//Hold all of the oscillators for this note
0.5 / num[i] => float scale;
for (0 => int j; j < num[i]; 1 +=> j) {
#include <string.h>
#include "defs.h"
#include "map.h"
#include "context.h"
#include "func.h"
#include "err_msg.h"
#ifndef GWION_DOC_DIR
#define GWION_DOC_DIR "/usr/lib/Gwion/doc/"
#endif

Tests

test.sh requires valgrind there are two kinds of tests:

Gwion tests

those tests are just gwion (.gw) files, handling special comments:

  • // [skip] (optionally followed by reason to skip)

Overview

Gwion is a musical programming language, similar to chuck.
It also provides high-level features, like templating and function pointers.
The main difference being an emphasis on performance.
This page is just a quick overview of the language.

Comments

Since block bock comments are a bad idea, only lines comments are enabled.

// this is a one line comment
set nocompatible
set mouse=a
filetype plugin indent on
set foldenable
set foldmethod=marker
au FileType sh let g:sh_fold_enabled=5
#include "swigmod.h"
static const char *usage = "\
Gwion Options (available with -gwion)\n\
[no additional options]\n\
\n";
class GWION : public Language {
enum Wrap_mode {
NO_CPP,