sigrid/neindaw

Description
# neindaw

Some kind of DAW for 9front?  An ongoing effort.  Each instrument and
filter is a filesystem.  On top of that idea a DAW is supposed to be
built, the UI is optional and is based on the files exposed by each
instrument or filter.

Besides the usual C interfaces, neindaw uses
[Faust](https://faust.grame.fr) to build instruments.  Here, watch
this:

![code](kick.jpg) → ![result](cfg.png)

Wow.

## Installing

Clone the repo, run `mk install`, check out `ls /bin/daw`.

## Testing

`contrib` directory contains a script `o` that provides an easy way to run neindaw with ORCΛ.

More details about [ORCΛ](https://git.sr.ht/~ft/orca) coupled with neindaw as
a live-coding environment under Plan 9:
[piper](https://git.sr.ht/~ft/neindaw/tree/master/piper/README.md).

Here a basic example of using neindaw manually is shown.

So far three instruments are available: a simplified kick drum,
AY-3-8910 and a piano.

```
daw/kick_drum -m /n/kick
cd /n/kick
```

Allocate one instance.

```
cd `{cat clone}
cd K*
```

Check the A oscillator frequency, the order is `type value initial min
max step`.  It's different for different UI elements.

```
cat A/Frequency/ctl
vslider	100	100	10	200	5
```

Raise frequency to 160Hz.

```
echo 160 > A/F*/ctl
```

Pipe sound to /dev/audio in background.

```
audio/pcmconv -i f32c1r44100 < ../data > /dev/audio &
```

Set B oscillator parameters and enable it.

```
echo 400 > B/Frequency/ctl
echo 0.001 > B/Attack/ctl
echo 1 > B/Enable/ctl
```

Do a kick.

```
echo clear > ../ctl
echo 1 > Control/Gate/ctl
```

Run `cfg` to configure the kick drum in a GUI.

```
daw/cfg /n/kick
```

## TODO and random notes

 * add input proccessing
 * buffer computated data if `data` is opened more than once so every reader
   gets the same data at its own pace?
 * use llvm-generated object or asm instead of C? that would be having to
   add Plan 9 target to llc I guess, or some kind of conversion tool for asm
 * renaming/removal of instance IDs and controls via Twstat and Tremove
 * `<fs>/watch` to watch the changes, add frame offset as well to know when
   it actually changed
 * optional frame offsets for all commands, running and stopping computations
   at specific offsets will make it possible to apply changes correctly
 * `reset` command for groups
 * writable `metadata`: allow adding new key/values to `metadata`
 * add some way to read and write the whole configuration of an instance
   in an easy way, so instances can be cloned, or configs saved to disk
   as presets
 * make all of that compile and run on OpenBSD as well?
 * "sampler" that can be used to buffer generated audio in memory/files
   to be reused without running computations every single time
 * slicer
 * `<id>/from` and `<id>/to` to connect all the objects together, should
   be controllable through daw/cfg.
 * mixerfs with channels
 * full MIDI support
 * OSC support
 * changes of controls can be monitored through a 2D plot in GUI
 * every control can be used as an input of another control
Last 5 commits (shortlog)
Date Author Short message Commit hash
2021-01-13 Sigrid fix a warning on 386 8747033fb429a67053e229b30c323ce1c5a25a54
2020-08-07 Sigrid piper: add -r (rate) parameter, rename recording to -t; check -m vs -t 655a5655af3bd3549bd6a8fc22e6b882aae3d533
2020-08-07 Sigrid put rate into common.h, one for every program f1652d3fffe4457db7bf025bdb4ab1201065d923
2020-08-07 Sigrid nanosec: cycles/nsec depending on what we have 57f49b5ea9632be13d0b695a2932fc7e6ed7ac0b
2020-08-07 Sigrid contrib/o: orca → games/orca 6668244f2c4cdd0ad841f40d41057817a44799df
Files (browse)
.gitignore
LICENSE
README.md
a440.txt
ay/
cfg/
cfg.png
common.c
common.h
contrib/
dsp/
fs.c
fs.h
kick.jpg
microui/
mkfile
mkfs
nix/
notegen
osdir
piper/
pull_subtree
repeat/
sample/
ui/
ui.c
ui.h
uiglue.c
uiglue.h
util.c
util.h
waveform/