I'm about to write a DSSI/LADSPA plugin that among other things, detunes
the signal by up to 15 cents. My understanding is that detuning is
accomplished by resampling. If that's the case, what do you do
with the time difference? Do you pad/truncate to get the same number of
samples you started out with? Wouldn't that introduce undesirables?
--
Hans Fugal ; http://hans.fugal.net
There's nothing remarkable about it. All one has to do is hit the
right keys at the right time and the instrument plays itself.
-- Johann Sebastian Bach
Another method, related to the vocoder but more "real-time" oriented
(i.e. sample-by-sample, not fft block processed) uses a bank of Hilbert
transforms (for the pitch shift) and a bank of bandpass filters (each
harmonic shifted individually to maintain harmonic relations) --
see ssb-bank et al in dsp.scm in the Snd tarball (ssb refers to the
single sideband suppressed carrier amplitude modulation generator).
sndscm.html has examples.
Hi guys
After reading the last few days postings, it is obvious that this list
is WAY OVER MY HEAD techwise. You are obviously developers!! Hence the
name of the mailing list. Sorry I missed that!
The thing is where can I get everyday info about triggering samples or
the program to use to do it etc.????
These type of questions are obviously beneath where your heads are
operating.
So, can someone humble themselves for a moment and give me some ideas
regarding the above forementioned??
Thaks in anticipation
Vaughan
Hello, I have created a patch that allows timeachine to automatically
start and stop recording based on the audio signal. Recording will start
when a sample value exceeds a start threashold. Recording stops when
sample values remain below a stop threashold for a period of time.
Recording of a new file will then start again when a sample value again
exceeds the start threashold. These values as well as enabeling auto
recording can all be set at the command line.
With this functionallity I would like to be able to launch timemachine
backgrounded.
Eg: timemachine args &
I would also need to be able to send the process SIGINT and SIGTERM
signals and have it exit gracefully. I have attempted to add the
necessary handlers for this.
However if I try to start timemachine backgrounded it just seems to exit
and brings jack down with it. If I run it in the foreground and try to
killall timemachine it does not exit gracefully but brings jack down as
well. In either case I see output from jack like:
subgraph starting at time timed out (subgraph_wait_fd = 7, status = 0,
state = Triggered)
jackd watchdog: timeout - killed jack
[1]+ Killed timemachine
Any suggestions or ideas are greatly appreciated. Also, the auto
recorder functionallity works great asside from the backgrounding and
SIGTERM business.
Thanks!
-Garett
PATCH FOLLOWS
diff -urN timemachine-0.3.1/src/main.c
timemachine-0.3.1.autorecord/src/main.c
--- timemachine-0.3.1/src/main.c 2005-09-19 03:41:30.000000000 -0600
+++ timemachine-0.3.1.autorecord/src/main.c 2006-01-14
11:24:13.000000000 -0700
@@ -28,6 +28,10 @@
#include <sndfile.h>
#include <gtk/gtk.h>
+/* garetts mod here */
+#include <signal.h>
+/* end garetts mod */
+
#ifdef HAVE_LASH
#include <lash/lash.h>
@@ -71,6 +75,10 @@
GdkPixbuf *img_on, *img_off, *img_busy;
GdkPixbuf *icon_on, *icon_off;
+/* garetts mod here */
+void signal_handler(int signal);
+/* end garetts mod */
+
int main(int argc, char *argv[])
{
unsigned int i;
@@ -78,13 +86,22 @@
int help = 0;
int console = 0;
char port_name[32];
+ /* garetts mod here */
+ int AUTO_RECORD = 0;
+ signal(SIGINT, signal_handler);
+ signal(SIGTERM, signal_handler);
+ float SECONDS_OF_SILENCE_BEFORE_STOP = 5;
+ float START_THREASHOLD = 0.000005;
+ float STOP_THREASHOLD = 0;
+ /* end garetts mod */
+
pthread_t dt;
#ifdef HAVE_LASH
lash_args_t *lash_args = lash_extract_args(&argc, &argv);
lash_event_t *event;
#endif
- while ((opt = getopt(argc, argv, "hic:t:n:p:f:")) != -1) {
+ while ((opt = getopt(argc, argv, "hic:t:n:p:f:q:w:e:r")) != -1) {
switch (opt) {
case 'h':
help = 1;
@@ -111,6 +128,20 @@
case 'f':
format_name = optarg;
break;
+ /* garetts mod here */
+ case 'q':
+ SECONDS_OF_SILENCE_BEFORE_STOP = atof(optarg);
+ break;
+ case 'w':
+ START_THREASHOLD = atof(optarg);
+ break;
+ case 'e':
+ STOP_THREASHOLD = atof(optarg);
+ break;
+ case 'r':
+ AUTO_RECORD = 1;
+ break;
+ /* end garetts mod */
default:
num_ports = 0;
break;
@@ -132,6 +163,9 @@
fprintf(stderr, "\t-t\tspecify the pre-recording buffer length\n");
fprintf(stderr, "\t-p\tspecify the saved file prefix, may include
path\n");
fprintf(stderr, "\t-f\tspecify the saved file format\n");
+ fprintf(stderr, "\t-q\tspecify the seconds of silence before stop\n");
+ fprintf(stderr, "\t-w\tspecify the start threashold\n");
+ fprintf(stderr, "\t-e\tspecify the stop threashold\n");
fprintf(stderr, "\n");
fprintf(stderr, "\tchannels must be in the range 1-8, default %d\n",
DEFAULT_NUM_PORTS);
@@ -164,7 +198,10 @@
}
DEBUG(1, "registering as %s\n", client_name);
- process_init(buf_length);
+ /* garetts mod here
+ * process_init(buf_length)
+ */
+ process_init(buf_length, SECONDS_OF_SILENCE_BEFORE_STOP,
START_THREASHOLD, STOP_THREASHOLD, AUTO_RECORD);
#ifdef HAVE_LASH
lash_client = lash_init (lash_args, "TimeMachine",
@@ -287,6 +324,11 @@
exit(0);
}
+void signal_handler(int iSignal) {
+ recording_stop();
+ cleanup();
+}
+
#ifdef HAVE_LASH
gboolean idle_cb(gpointer data)
{
diff -urN timemachine-0.3.1/src/threads.c
timemachine-0.3.1.autorecord/src/threads.c
--- timemachine-0.3.1/src/threads.c 2005-07-18 08:03:06.000000000 -0600
+++ timemachine-0.3.1.autorecord/src/threads.c 2006-01-14
10:58:18.000000000 -0700
@@ -19,7 +19,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
-#include <time.h>
+#include <sys/time.h>
#include <sndfile.h>
#include <jack/jack.h>
#include <gtk/gtk.h>
@@ -46,6 +46,15 @@
static unsigned int disk_read_pos = 0;
static unsigned int disk_write_pos = 0;
+/* garetts mod here */
+static float seconds_of_silence_before_stop = 0;
+static float start_threashold = 0;
+static float stop_threashold = 0;
+static float seconds_of_silence = 0;
+static int sample_rate = 0;
+static int autorecord = 0;
+/* end garetts mod */
+
/* Peak data for meters */
static volatile float peak[MAX_PORTS];
@@ -69,6 +78,32 @@
fprintf(stderr, "bad buffer!\n");
break;
}
+
+ /* garetts mod here */
+ if (autorecord) {
+ if (rec) {
+ for (i = 0; i < nframes; i++) {
+ if (fabsf(in[i]) <= stop_threashold) {
+ seconds_of_silence = seconds_of_silence + 1.0/sample_rate;
+ }
+ else {
+ seconds_of_silence = 0;
+ }
+ if (seconds_of_silence > seconds_of_silence_before_stop) {
+ recording_stop();
+ }
+ }
+ }
+ else {
+ for (i = 0; i < nframes; i++) {
+ if (fabsf(in[i]) > start_threashold) {
+ recording_start();
+ break;
+ }
+ }
+ }
+ }
+ /* end garetts mod */
for (i = 0; i < nframes; i++) {
if (fabsf(in[i]) > peak[port]) {
@@ -202,7 +236,10 @@
return 0;
}
-void process_init(unsigned int time)
+/* garetts mod here
+ * void process_init(unsigned int time)
+ */
+void process_init(unsigned int time, float secs_of_silence_before_stop,
float strt_threashold, float stp_threashold, int use_autorecord)
{
unsigned int port;
@@ -220,6 +257,14 @@
pre_size = time * jack_get_sample_rate(client);
pre_time = time;
+ /* garetts mod here */
+ seconds_of_silence_before_stop = secs_of_silence_before_stop;
+ start_threashold = strt_threashold;
+ stop_threashold = stp_threashold;
+ sample_rate = jack_get_sample_rate(client);
+ autorecord = use_autorecord;
+ /* end garetts mod */
+
for (port = 0; port < num_ports; port++) {
pre_buffer[port] = calloc(pre_size, sizeof(float));
disk_buffer[port] = calloc(DISK_SIZE, sizeof(float));
diff -urN timemachine-0.3.1/src/threads.h
timemachine-0.3.1.autorecord/src/threads.h
--- timemachine-0.3.1/src/threads.h 2005-07-18 08:03:06.000000000 -0600
+++ timemachine-0.3.1.autorecord/src/threads.h 2006-01-14
10:56:37.000000000 -0700
@@ -9,7 +9,10 @@
int process(jack_nframes_t nframes, void *arg);
-void process_init(unsigned int time);
+/* garetts mod here
+ * void process_init(unsigned int time)
+ */
+void process_init(unsigned int time, float secs_of_silence_before_stop,
float strt_threashold, float stp_threashold, int use_autorecord);
int writer_thread(void *d);
Arrrgh!!
Thanks Clemens and anyone else that I may have missed, but thankfully I
have it going!!!!
After sending the last post and walking away for a cuppa I decided to
double check some keyboard settings. One of the keyboards panel lights
are out and therefore are pretty dim.
But no matter what excuse I use I feel pretty dumb and lame having to
admit that I overlooked a simple keyboard setting. I wrestled with this
thing for 12 hrs and I simply had a setting on my keyboard incorrectly
set.
Thanks anyway!
Vaughan
PS. Is there any site where Linux users are posting songs or samples of
their songs that they are producing with Linux???? If so where?
Hi this is my first post here and I'm hoping you are friendly and
understanding to a relative self learner of Linux!! I am a musician
first and a computer hacker second. I have learned everyting I know
about Linux by stuffing up my computer and learning to refix it via the
net and forums such as this one.
I have installed Fedora Core 3 and added the ccrma kernels and programs
via the how to files on the net. I am SO IMPRESSED with the system that
they present.
I have so far achieved getting everything running (except midi...more on
that in a second) I have even been able to run some VST plugins and
programs via FST.
I am 3/4 of the way through a song on Ardour and am loving what I am
hearing so far and want to continue using Linux as my main form of
recording.
I have a Hoontech C-Port soundcard succesfully using the ice1712 driver.
However "midi in" on this card doesn't work with Alsa.
So, I just got a yamaha usb "UX16" midi controller so I can trigger some
samples. Here is my problem.
The Ux16 shows up in the qjackctrl midi connections gui. BUT nothing
appears to be triggered by my exterior keyboard.
I have tried everything in my brain but I have finally had to admit
defeat.
Oh yea I am running the 2.6.11-0.3.rdt.rhfc3.ccrma kernel
If anyone can help I'd be much obliged. Thanks in advance.
Vaughan
The ever popular CAPS Audio Plugin Suite reincarnates as v0.3.0, a
major augmentation release.
CAPS is a LADSPA library that enjoys worldwide favour for its
high-quality instrument amplifier emulation facilities. In addition it
provides a sizeable assortment of no less sophisticated classic DSP
units for daily use as well as some more exotic sound generators and
effects.
Most noteworthy addition is the new AmpV plugin which builds on the
previous Amp efforts. A fundamentally revised circuit design and the
emulation of power supply shortcomings make for a very mellow and
differentiating tone especially at clean to moderately rough settings.
The new CabinetII unit further enhances the discerning electric
guitarist's digital sound setup by modelling five classical speaker
cabinets; far more faithful than the previous Cabinet plugin it builds
on, but with the same zero-latency advantage at still extremely low
CPU taxation.
Furthermore, the new Scape plugin (if played well ;) generates epic
grooving soundscapes, the new ChorusII and PhaserII units provide
fractally modulated variants of these classics and the new SweepVFII
enhances its predecessor by allowing for modulation of filter Q.
-*-
This CAPS release compiles cleanly on x86-64 as well as with gcc-4.0.
Many plugins have been renamed and all have been relabelled, which
will unfortunately upset some host programs trying to load existing
setups. Consult the README files in the distribution package for
further details.
http://quitte.de/dsp/caps.htmlhttp://quitte.de/dsp/caps_0.3.0.tar.gz
Please forward as you see fit.
Enjoy,
Tim
I ran some timing tests, partly to check out -fast-math -- my informal impression
is that it speeds up exp by a factor of about 2, but can slow down other things
(FIR filters). I didn't see any obvious improvement in -O3 over -O2. The
actual numbers are in the snd tarball, snd-edits.c -- look for "fast-math".
(The table is aimed more at comparing int/float/double operations). These
timing numbers change by a factor of, say, 20% on each run, so don't put
much weight on them.
DT-42 DrumToy 0.1.0 - First Release
-----------------------------------
"DT-42 DrumToy was intended as an example of
interactive audio and graphics programming using
SDL, but the project went rouge and turned into
a "usable" drum machine. Not exactly a minimal
technique example, but for someone working on
some sort of music editor, the source might be
of some interest, as DT-42 is probably as simple
as it gets with all the basic vital stuff still
in place.
The package contains the source code, graphics,
sounds, some example songs and precompiled
executables for Windows, Mac OS X/PPC, Linux/x86
and Linux/AMD64."
Have fun!
Home:
http://olofson.net/mixed.html
Direct download:
http://olofson.net/download/DT-42-0.1.0.tar.gz
//David Olofson - Programmer, Composer, Open Source Advocate
.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
'-- http://www.reologica.se - Rheology instrumentation --'
JACE is a Convolution Engine for JACK and ALSA, using FFT-based
partitioned convolution with uniform partition sizes.
I wrote it mainly as a 'proof of concept' for something more
complicated, to be announced at the next LAC. But it could be
useful as it is, hence this release.
Main features:
- Any matrix of convolutions between up to 16 input and 16
outputs.
- Maximum length for each convolution is one megasample (nearly
22 seconds at 48 kHz).
- Allows the use of a period size down to 1/16 of the partition
size. This will not change the total delay (input + process +
output) which will be twice the partition time in all cases,
but at least allows you to use a smaller period size when
other parts of your system require it.
- It's fast (see performance examples below).
When used with a period size smaller than the partition size,
JACE will try to spread the CPU load evenly over all process
cycles that make up a partition. This works quite well if there
is enough work to be distributed, and less well otherwise. As an
extreme example, if there is only one input and one output, and
the convolution size is just one partition, it's clearly not
possible to spread the three elementary operations over 16
cycles. But in those cases the load will be small anyway, and
you can use a smaller partition size.
Code to use SSE (tested) and 3DNOW (untested !) for the MAC
steps is present, but disabled by default since it seems
to make little difference.
Performance on 2 GHz Pentium IV with 4 convolutions of
5.5 seconds each at Fs = 48 kHz. Load is as displayed by
qjackctl. Delay is input + process + output.
period partition load delay
-----------------------------------
1024 8k 12% 340ms
1024 4K 17% 170ms
512 4K 18% 170ms
256 4K 19% 170ms
128 2k 32% 85ms
64 1k 59% 43ms
Grab it at <users.skynet.be/solaris/linuxaudio>. You will also
need libfftw3f, libsndfile, and two shared libs available at
the same place.
Enjoy !
--
FA