iiwusynth-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iiwusynth-devel] Iiwusynth: Pitch bend, Pan (controller 10), low-latenc


From: M. Nentwig
Subject: [iiwusynth-devel] Iiwusynth: Pitch bend, Pan (controller 10), low-latency loop for OSS, GCC -Ox problem
Date: Sun, 24 Feb 2002 12:17:50 +0200

Hello,

there's still a problem with pitch bend: its default setting is not
centered. So the first time I touch the wheel the pitch jumps two
semitones, then it's works fine.
One more reason, why a swiss army-knife should have a tuning fork
instead of a corkscrew :-)

======== Missing keys with optimization -O turned on ===========
This brings back my old missing-keys problem. If the pitch-wheel is
centered (after 'touching it' once), notes are missing on some patches.
The Rhodes Mk 1 I mentioned earlier is one of them. It appears, that
some of those samples, which are played on the original pitch, are
dropped. If I move the pitch-bend wheel only one click, the tone is
back, when the wheel goes back to 0, it disappears. Strange! And this
only happens, when using the -O1, -O2, -O3 option with the latest gcc.
So for the moment I'm not using -Ox.
If anybody has a theory, please let me know! Otherwise I'll have to
debug with sprintf (especially if nobody else can reproduce the error).

=========== Concerning Fragments ==========
About the fragment setting: I'm using the driver that came with kernel
2.4.1. So it's OSS-type. In the past, I must have tried five or six
times to make Alsa work (different versions), no success so far. Maybe I
should try again...

Here is the delay loop I used in iiwu_oss.c, iiwu_oss_audio_run:
--------------------------------------------------------
 // How many buffer fragments are initially free?
  int OutSpaceMax;
  int OutSpace;
  ioctl (dev->dspfd, SNDCTL_DSP_GETOSPACE, &OutSpaceMax);
…
// Query the number of free buffers.
// Delay execution, until there are not more than x buffers full.
#define KeepXBuffersFull 3
    ioctl (dev->dspfd, SNDCTL_DSP_GETOSPACE, &OutSpace);
    while (OutSpace<OutSpaceMax-KeepXBuffersFull){
      ioctl (dev->dspfd, SNDCTL_DSP_GETOSPACE, &OutSpace);
    };
--------------------------------------------------------------------
Speaking of it, my implementation ran the synth first, and -then-
delayed execution.
So the measurement results were 'off' by one buffer, the real latency is
one buffer length shorter.

But this is only a 'quick fix', it burns 100 % CPU time!
What I'd need is a function 'give back 0.5 ms to the kernel', which I'd
prefer to run during the while-loop.

============Pan controller=====================
The Pan controller (controller 10) shows the same behaviour as the pitch
wheel did (before it was fixed): It jumps back to default for each new
key.

Inserting an
iiwu_voice_modulate(voice,1,10) around line 700 in iiwu_voice.c
(directly after the iiwu_voice_modulate for the pitch bend) and removing

voice->pan = voice->gen[GEN_PAN].val
a couple of lines later (around line 740) fixed it.
Question is: Is this the right way to set continuous controllers to
their default value, by issuing a controller event? If yes, I could do
the same with 'Reverb send' (controller 91).

Regards

Markus







reply via email to

[Prev in Thread] Current Thread [Next in Thread]