git ssb

0+

cel / foostudio



Commit db045b1947e80c781f4eeea1af988c701e56d196

Update readme and arguments

- Make latency an argument
- Default to no midi device
cel committed on 11/5/2016, 1:27:14 AM
Parent: 1d67f693f364e55fe7c4f752a49923bb51c6875b

Files changed

README.mdchanged
foostudio.cchanged
README.mdView
@@ -1,18 +1,19 @@
11 # foostudio
22
3-Foo Studio is an environment for live-coding algorithmic music in C. Inspired
4-by [code-music-studio][]. Currently Linux-only, as it depends on ALSA and
3 +Foo Studio is an environment for live-coding low-latency algorithmic music in
4 +C. Inspired by [code-music-studio][]. Linux-only, it depends on ALSA and
55 inotify.
66
77 ## Usage
88
99 ```
10-# Compile the program
10 +# Compile
1111 make
1212
1313 # Run the studio
14-./foostudio tune.c plughw:0,0
14 +# Usage: foostudio [source file] [playback device] [capture device] [midi device] [latency us]
15 +./foostudio tune.c plughw:0,0 plughw:0,0 hw:0 10000
1516
1617 # In another terminal, edit the music file. When you save it, foostudio will recompile and reload it.
1718 vim tune.c
1819 ```
@@ -26,8 +27,12 @@
2627 - http://www.linuxjournal.com/article/6735?page=0,1#N0x19ab2890.0x19ba78d8
2728
2829 [code-music-studio]: https://github.com/substack/code-music-studio
2930
31 +## TODO
32 +
33 +- better CLI option syntax
34 +
3035 ## License
3136
3237 Copyright (C) 2016 Charles Lehner
3338
foostudio.cView
@@ -16,9 +16,8 @@
1616
1717 static unsigned int rate = 48000;
1818 static unsigned int channels_out = 1;
1919 static unsigned int channels_in = 1;
20-static unsigned int latency = 10000; // us
2120 static int resample = 1; // allow resampling
2221 static int16_t maxval = 0x7fff;
2322
2423 static snd_pcm_format_t format = SND_PCM_FORMAT_S16;
@@ -34,18 +33,17 @@
3433 snd_rawmidi_t *midi_in = NULL;
3534 const char *src_fname = "tune.c";
3635 const char *device_out = "default";
3736 const char *device_in = "default";
38- const char *midi_device_in = "default";
37 + const char *midi_device_in = NULL;
38 + int latency = 10000; // us
3939
4040 if (argc > 1) src_fname = argv[1];
4141 if (argc > 2) device_out = argv[2];
42- if (argc > 3) device_in = argv[3];
43- if (argc > 4) midi_device_in = argv[4];
42 + if (argc > 3 && argv[3][0]) device_in = argv[3];
43 + if (argc > 4 && argv[4][0]) midi_device_in = argv[4];
44 + if (argc > 5) latency = atoi(argv[5]);
4445
45- if (device_in[0] == '\0') device_in = NULL;
46- if (midi_device_in[0] == '\0') midi_device_in = NULL;
47-
4846 ccdl_init(&ccdl, src_fname, "play");
4947
5048 if (ccdl_watch(&ccdl)) {
5149 errx(1, "ccdl_watch");

Built with git-ssb-web