Theo Verelst Diary Page

Latest: Februari 12 2001

I've decided after good example to write some diary pages with toughts and events.

Oh, in case anybody fails to understand, I'd like to remind them that these pages are copyrighted, and that everything found here may not be redistributed in any other way then over this direct link without my prior consent. That includes family, christianity, and other cheats. The simple reason is that it may well be that some people have been ill informed because they've spread illegal 'copies' of my materials even with modifications. Apart from my moral judgement, that is illegal, and will be treated as such by me. Make as many references to these pages as you like, make hardcopies, but only of the whole page, including the html-references, and without changing a iota or tittel...

And if not? I won't hesitate to use legal means to correct wrong that may be done otherwise. And I am serious. I usually am. I'm not sure I could get 'attempt to grave emotional assault' out of it, but infrigement on copyright rules is serious enough. And Jesus called upon us to respect the authorities of state, so christians would of course never do such a thing. Lying, imagine that.
 

Previous Diary Entries
 

February 13, 2001

Experiments

What's a lab for? I always thought that mainly the answer is to achieve something with research and or development, and that it is sort of a facility that contains enough high tech or appropriate equipment to make it fun and interesting abide for persons into the field.

I've played around a bit with the wave laboratory page, the spectrum analyser is interesting, I didn't do much with that yet in other forms, and I'm sure if I'd upload a history of formula's from the entry box, they amount to hundreds of interesting experiments by now. I just tried how to get to a triangle from a square wave by making the synth type of filter act as a near integrator for the first bunch of harmonics.

Make the impule response, try to get the steepness of the filter curve right by picking the right portion, and changing it shape by a touch of resonance, then it should deminish the first few harmonics reasonably as intended. Now apply it to a square instead of a (near) impulse, and see what happens: not that good, mainly because the shape isn't visually much of a triangle. That can also be achieved, but then the spectrogram makes clear it isn't realy close enough to what we want, probably to much higher than 2d order curvature in the ramps of the wave, and too much roundness on top.

By using the impulse response, things can get reasonable, and in the end I tried what would happen if I'd just feed the first 4 partials (sines) of the square wave in, and change the phase of the higher ones to compensate for the, probably considerable, phase shift in the filter with some resonance. An sort of triange was the result of this compensation scheme.

Usefull? Yep, maybe I should automatically cgi the actions on the form to some file on tripod for future reference, but the cgi's work only once in 10 times or so, and I don't want the page to respond crummy. The use is first that such experiments have everything to do with what is important for sound syntesis, and that even though sonically sounds are not that different, such as the triangle harmonics with roughly the right amplitudes, the results of phase shifts are not just that the signal looks different, and might not be recognized for instance, but also that a non-linear signal processing step such as distortion (like in a quitar amplifier), or the interference with another triangle, which is a 'real' triangle, will give not the right or anticipated results.

An example of a reasonable, though frequency limited triangle is taking this as the expression for the component phase shifted square wave (4 waves in the graph window):

1+sin(4*2*pi*t)+(1/3)*sin(4*3*2*pi*t+2*pi/3)+
 +(1/5)*sin(4*5*2*pi*t+2*pi/2)+(1/7)*sin(4*7*2*pi*t+pi*2/2)

and taking the filter coefficient 0.23, and a resonance of 0.1, noting the 1 added in the expression is to make the DC component such that the filter has no transient behaviour worth noticing to mess up the graph. The fourier window can be seen as wrapped around at the end to the beginning, and if the graph of the signal doesn't seamlessly connect back to itself, harmonics are though to appear to account for that signal jump, which introduces quite some spectral components unrelated to the desired signals' components.

This is an important principle, and is the reason a integer number of waves is normally fitted in the window I use. You can just cut and paste the data in place, click the plot signal to see the signal as a bit rounded triangle between 0 and +1, and hit plot spectrum to get an idea of the spectrum.

There is a 'tri(4*2*pi*t)' function you may want to try to compare the spectral components of the real thing, and see why our triangle looks not so bad but rounded. The little glitch between the outmost right and the left part of the graph where the wave is virtually cycled is the reason for the 'noise' seen in the lower part of the spectrum, sort of with a shape like the spectrograms of narrow pulses, see the menu.

The principal components of the wave (seem to) stand out just enough.

Another try is to not mess with the basic waveform, assuming we just have the most common ones to start with:

sqr(8* 1*pi*(1-t)+pi/2)
now take .14 as cutoff frequency, and .13 (concidence, I think) as a resonance, and again as sort of triangle results, which is pretty round, but there is a third harmonic. Try taking a sine (sin) instead of the square (sqr) in the expression to see the difference between a real sine wave, because the filter will not change the waveform of a sine, minus an average shift, normally.

Adding the sounds themselves is interesting, and almost getting ludicrous: the filter might be up to speed to produce samples at not too high sampling rate in javascript. I've yesterday tried to write binary data to a web page, maybe if that indeed works as it seems, I'll open a mime type 'wav', write the header data, and push a sample to the browser for opening or download. I'm not at all sure that would work, but it's an interesting experiment.

And then what, give all those great sounds away? Why not, as examples, there are so many thousands possible, let some samples be for free. Some of them are bound to be good, and hard enough to get right, and hardly any software generator gets a major portion of them right, so that is good advertisement. And it definately fun trying all kinds of possibilities, where every curve, modulation, and harmonic counts.

If it works, high Q samplers, and soundcards, and programs such as csound or sequencers can use the samples. If it indeed works, some more application may be possible and interesting.

I've no way of trying now, but at least there seems to be an interesting way to make a java applet output sounds for which it created the data itself, I found it via this java source file, from where it would seem that the sound[] array is used in a loop or repeatedly output, I didn't check. I wonder how java knows how to deal with this data, in terms of sampling and repeating behaviour. The idea is:

      soundStream = new ContinuousAudioDataStream(new AudioData(sound));

I checked it out and,.. it appears in the bug department, javas' class seems to earlier have assumed a 8k mono ulaw encoding, and now allows for some method calling back and forth when creating an official audio data array, that generates bug. Not that nice, but if it works, it would be good to have a way to make sounds work from java, if they can be looped and of some quality, I'd be making synth modules when I can run a jdk somewhere again.

I should be a .com by now.

The physical stuff

The theoretical physics I've been into is about mathematical representations of the basic particles nature shows at small scale, and how they interact. That includes how particles and fundamental building blocks sort of oscilate just the same. And frequency domain considerations are normal, just as the idea of a coupled vibration. The tools are lets say male mathematics as starting point: the idea is that everything is described by our equations, and if it isn't they describe even bigger and more complicated phenomena just the same, until they do. The idea is using infinite dimensional spaces, and then start the whole thinking with functions mappings that are made of infinately many of those. And then computations start, of course.

The terminology is because I liked the idea, and because more or less surprisingly, very general mathematical considerations lead to mathematical thinking, logic, and lets say tools that in the beginning of the previous century led to an understanding of physics still valid today, with very strong, kind of weird, almost strictly mathematical basis. The idea of starting with in some ways simple enough observations about symmetry, statistical distributions, exclusion, and energy, and ending up with models that are still valid and strong enough a century later is appealing.

The string simulator is in a corner of reality not so much like that, but practically, it is of major interest to the sound synthesis area, and it has many parallels with wave behaviour mathematics and considerations in physics or ee.

I got one of my simulators waves, and loaded it in my sample player hardware to see what would happen, in fact the file is on the wave laboratory page. It is kind of a soft (and long) sample, I counted on hearing just the attack portion, but heard almost nothing, until I accidentally loaded into a program which assumes 8 bit instead of 16 bit samples, and downloaded it into the sample player. Funny enough, probably because the signal is two's complement, and of little amplitude, and has certain properties, the result is a near saturated square wave, with some characteristics of the sound still in it, like very old computer 1 bit audio, and the sound was definately worth it, alive but hard to describe. The loop portion was also quite good.

Apart from maybe nice to do or write, there is a reason that it is possible that such a signal, though equivalently hard amplified and very hard clipped, is still interesting, though filtering was needed to get rid of the major noisy edge in it. That reason is that the signal is made in way that makes it a long time before the signal simply repeats itself, in a way that is natural and quite hard to achieve with known synthesis methods. The string which is vibrating makes a wave that depends on the length of the string, its properties, the filtering at the end points, feedback and string cross coupling, and (depending on the simulator version) non-linearities, which make for a rich, complicated waveform.

As a physisist, the whole string with every possible wave on it could be transformed into the frequency domain, where normally one would be interested in the final 'modes' of vibration. As instrument maker, the interest is more in the part where the string starts showing these modes, and how. Also, the idea of picking a signal anywhere from the string can be tranformed into frequency domain, as is regularly done, though that gives analysis unclearnesses like with the non-fitting waves in the window above for practical analysis. This depends on what one wants to know, and how accurate (long computations) the analysis is, and what its meaning is.

At least, the whole string propagating the wave, and iteracting with every end point, pickup and feedback can be expressed as a time evolution integral, and there are quite some physics and mathematics about such integrals. I salved a few myself, and need to think about what the idea could be to make good use of uch knowledge, mainly for two or three purposes: improved accuracy of the computations in my simulator, especially when difficult signals are made and when major non-linearities and / or medium changes are involved, then there is the question of efficiency: there are various more efficient models (using delays with linear poles and zeros at junctions) that do not use the couples oscilator idea all over the string, that already take relative long computation times. It may well be that certain integral equation solutions such as helmholz resonator approaches yield usable steady state solutions, that may even be perturbed, as an example, in short the complete path integral may not need to be evaluated at all times to arive at a good signal.

Another factor is understanding, for which pruning in a general solution and equation is a good way to make sure no things are lost unless intended. The simulator uses a similar idea: make sure all elements are there and simulated accurately, than at least the simulation makes sense, and can subsequently can be reparameterized, tweaked and tuned.