Greetings:
I ran memtest for a day, the RAM's fine, so I brought in another
machine, added my drives, memory, and cards, everything's working all right.
Once again I learned a lot, thanks to everyone who replied. But I
gotta get me some new iron...
Best,
dp
This is, I know, slightly off-topic for this group, as it does not deal
with audio per se. It does, however, deal with the
"real-time"/preemptible Linux kernel, for which I think most of the
expertice is gathered here.
The OS is Linux, the computer an ordinary PC. The task we are faced with
is to run a program, tcpreplay, in such a way that it delivers its
network packets as precisely as possible. I.e. the packets should be
delivered to the network with the smallest possible timing error.
We think that the way to minimize this timing error is to use a kernel
with the real-time patches, as this will improve latency and response
times.
The question is how we can assure that the program really utilizes the
real-time capabilities of the kernel. My understanding is that having a
real-time capable kernel is only the first step, the second necessary
step is to get access to this capabilities? So, how does one accomplish
this, given that the program itself does nothing to achieve this?
* Will an ordinary program, run as root, take advantage of the real time
capabilities of the kernel?
* Will an ordinary program, run as a user that is a member of the
"audio" group on f.i. Agnula, take advantage of the real-time capabilities?
* If given a real-time kernel, what else is necessary to take advantage
of its capabilities?
* How does normal priorities (nice, renice) play together with the
real-time kernel?
With kind regards
Asbjørn Sæbø
After my initial problems with jack I must say I have come to like jack.
Especially together with muse. Now I wonder, is there something like a sample
browser (possibly with jack output) that allows traversing through
directories and click-n-play audio files in them? Something like good old
fastwav on windows... I have searched and searched but everything I could
find needs at least two clicks to play.. also kde/qt drag and drop would be
nice..
thanks,
mm
On Thu, 9 Jun 2005 10:05 , 'Chris Cannam' <chris.cannam(a)ferventsoftware.com> sent:
>N Smethurst:
>> Since a vector is a wrapped C array (i.e. contigous), the [] operator
>> compiles to the C equivalent when optimisation is turned on.
>
>I was thinking of iterator operations, having vaguely recalled that the vector
iterator in the gcc library had at some point changed from an actual pointer to a
wrapper class. Looking at the code, though, the wrapper is so thin that it
probably isn't an issue with optimization on.
>
>
I was under the impression that there was bounds checking going on with
vectors. Is this not the case?
Jan
Frailty, thy name is GCC
A Modern Drama in Three Scenes.
Dramatis Personae: An ardent programmer and a popular C++ compiler
-*-
Prologue:
Appalled by the rat race commonly known as the proprietary software
business, our young and gifted hero joins the light side, deeply
inspired by the manifold yet subtle qualities of free software.
Scene I:
Our hero in day-and-night-long sessions optimizes the hell out of a
SSE2-based n*4-band IIR equalizer. Of course in assembly, and mixed
with C++ templating. The final code is about 10% faster than floats on
AMD, probably a fair bit quicker yet on P4 systems.
Enter gcc version 3, which drops multi-line inline assembly support.
Said assembly code becomes effectively unusable and dies a quick and
unsung death.
Scene II:
Our hero puts years of work into an all-round realtime audio and MIDI
library that expands the Python programming language. While having its
flaws, it's a versatile, surprisingly stable and immensely capable
system, partly thanks to a very clever (according to our hero) design
that subclasses Python's C types in C++.
Enter gcc version 3, moving the vtable member to memory offset 0 of a
derived type even if the base type is in C which doesn't know about
vtables. As a result, the very foundation of said library's type
system is rendered nonfunctional since Python expects its type header
to reside in the very same memory location. With no precautions for
such an abrupt change taken and the implications requiring a manual
review and substantial rewrite of a good 50.000 lines of source code,
said library dies a slow and painful but equally unsung death.
Scene III:
Our hero bundles his DSP efforts into a free plugin library, once
again saving himself much work and improving code readability by using
C++ templates, resulting in quite an elegant object system and source
code, hethinks.
Enter gcc version 4, which requires the templated types' constructor
code be rewritten in the most nonsensical, misleading and ugly fashion
possibly imaginable this side of Hungary and Redmond, WA, according to
our (now not so very young anymore) hero.
Epilogue:
Our hero has completely and permanently lost his faith in the popular
compiler. Disillusioned and indecisive, he resigns himself to
henceforth reluctantly write C++ only to support his miserable life.
His plight is so bad he downright refuses to support the latest
follies of the popular compiler in his free software efforts.
-*-
Will this be the end? To be continued, hopefully.
Cheers, Tim
On Thu, 9 Jun 2005 23:41 , David Cournapeau <cournape(a)gmail.com> sent:
>On 6/9/05, stefan kersten steve(a)k-hornz.de> wrote:
>> On Thu, Jun 09, 2005 at 10:31:35PM +0900, David Cournapeau wrote:
>> > _Z6vectorSt6vectorIiSaIiEE:
>> > .LFB539:
>> > .L2:
>> > .L7:
>> > pushl %ebp
>> > .LCFI0:
>> > movl %esp, %ebp
>> > .LCFI1:
>> > popl %ebp
>> > ret
>>
>
>Well, that's what happens when one post some code after some heavy
>coding all day long, and when one tries to answer two questions at the
>same time....That's why I would have prefered to find the relevant
>part instead in the C++FAQ :)
>
> Anyway, for the question "is there bound checking with operator[]",
>the answer of Bjarne Stroustrup is no :).
> The other problem "is [] as efficient for vector and plain c array
>?", well, people who know better than me asm/gcc can test and answer.
>
Yeah, it really needs to be tested to tell. I remember taking a course in
VAX Macro asm back in the days of dinosaur eggs and phonograph needles. The
book, DEC, and the teacher all said you could turn off the VAX debugging mode
when you compiled. I wrote some self-modifying code for one of the exercises (I
wouldn't do that in real life ;-) The compiler still slapped in some debugging
stuff and it wouldn't work. It was a real simple program though so the
instructor checked it and passed it anyway ;-)
Jan
N Smethurst:
> Since a vector is a wrapped C array (i.e. contigous), the [] operator
> compiles to the C equivalent when optimisation is turned on.
I was thinking of iterator operations, having vaguely recalled that the vector iterator in the gcc library had at some point changed from an actual pointer to a wrapper class. Looking at the code, though, the wrapper is so thin that it probably isn't an issue with optimization on.
Chris
>Could anyone point me toward a document explaining the
>technical/mathematical details of convolution, especially about audio?
I've used convolution/correlation/fourier analysis for school projects. The
standard text for Fourier analysis is Bracewell, "The Fourier Transform and
its Applications". Also check out "Numerical Recipes in C" (available
on-line) by Press, Teukolsky, Vetterling and Flannery, Cambridge Press, for
code on performing convolution and correlation with the fast fourier
transform.
As for audio, I've dealt mostly with images but the same principals apply.
Audio is a 1D signal and most texts spend a considerable time covering
these . Look for any book on digital signal processing and it will most
certainly contain what you need.
Kevin
> And, as I said above, it did work better with some samples than with
> others, but: it works :-)
>
> Here are three example of what it sounds like, using a modified guitar
> chord sample as response file :
>
> 1 - For this one I softly hit the edge of the pad continuously, and the
> middle of the edge harder once at the beginning of the measure :
> http://samalyse.com/labs/edrum/audio/beat.ogg
>
> 2 - Playing faster ("rolling") with this one :
> http://samalyse.com/labs/edrum/audio/roll.ogg
>
> 3 - Using a pen to hit and scratch the surface. The rubber surface, made of
> several layers of bike tube makes it possible to obtain an interesting
> sound (the input level was not high enough for this one, so I normalized it
> afterward, it could sounds much better I think) :
> http://samalyse.com/labs/edrum/audio/scratch.ogg
>
> As you may see, scratching seems to work fine in here :-)
>
This is so incredibly cool! Is this technique already in wide use somewhere
that I missed? Because if not, it should be. This means that all you need
for an electronic drum set is a multichannel sound card and some homemade
piezo-triggered pads! And I think with some further experimentation with pad
materials and response files, you can probably come up with all kinds of
permutations on the sound. I'd like to hear what this sounds like using some
traditional drum samples ( like a snare or an 808-style kick ). I'm assuming
that the current samples lack "punch" only because they are from a piano
chord response file.
> By the way, Ben, what do you think of my idea of coupling triggering with
> convolution, as stated in my previous mail (above, third paragraph) ?
> Here's a diagram to further describe this idea :
>
> pad signal ----> trigger detection ----> sample playback -----
> | |
> | |
> -------------------------------------> convolution <----
> |
> |
> +--> output
>
> Would this be possible ?
You essentially _have_ the drawing, above. You just can't change the sample
on every hit. I don't know what you expect to achieve. Trust me, what
you've got now is much cooler than a triggered playback (although it does not
sound the same)
It is possible that using a triggered sample or some sort of envelope follower
will be required to get the attack of a traditional drum sound. I'm sure
there are lots of ways to improve this simple system beyond jack_convolve. I
think you've stumbled across a really cool synthesis technique!
-Ben