Theo Verelst Diary Page

Latest: March 1 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

March 1, 2001

Free DX7, sounds like a little add, but in fact is almost true, software wise, my synth is doing dx stuff, that's something.

Dx72csnd

Thats short for DX-7 to csound, the name of a program with data sets to make csound orchestra and score files from banks of dx7 voice data. DX7's (see one of my previous pages for pictures) are synthesizers with about 150 invisible knobs and switches per sound to make its Frequency Modulation based sound generators produce a certain sound. They are parameters for both the character as well as the form of the sound, and modulation such as vibrato.

The sounds this synthesizer produces are of a wide spectrum, both in frequency as in variation sense of the word, and is known for the versatility of FM sythesis to make changing and interesting spectrums when a sound is played. When a key os pressed, the resulting sound is can be very dynamical, and sensitive to for instance how fast a key is pressed, not just by making the sound louder and softer, but also by changing its qualities in various other ways.

The program converts a dx7 sound bank to csound input files for all 32 sounds in the bank. I got over 300 of them with the package, thata about 10.000 sounds, which is a chalenging idea.

And by converting linefeeds, removing errorous eof characters, a little correction in the csound orchestra sources here and there, and using grep to figure out which sounds are where, I was able to find, convert, use in csound and make samples for a few of my former favorite sounds (just a few out of hundreds), which is definately fun and interesting.

The idea is that I generate 1 sample, for a certain virtual keypress with certain velocity and a certain relative tuning of the sample, make such a sample by letting csound compute what the virtual DX7 sound would sound like by using all the parameters for a certain (specified) FM algorithm, and making a sequence for one note only into a short enough sample. The result is that after maybe 10 to 30 seconds I can use a download program that now works fine after I went over and corrected all error sources to and with the microcomputers data exchange, the wires, all that.

When the (usually only first portion of) sample from csound, in 8 bit, say 8 to 22kHz sampling rate, signed byte format is put into the mc sys acting as sample player, the keys on the small instrument keyboard or the sequencer can be used to make the sounds audible. The result of course suffers from the same limitations as any sample representation of a sound, but at least the sample can be updated (changed) uin milliseconds, and there are two oscilators. The result is that I actually made dx7 sounds that worked good enough to be recognized as such, and are playable. Far from the real thing interms of responsiveness, I don't even have velocity sensitive keyboard, but definately good enough to use, and strong enough.

I even made a few instant (major) chords, for the love of it, and made a keyboard autochord equivalent by playing them chords with dx7 character in 1 4 5 sequences.

These are some example samples, I'm not sure the basic bitrate, or playback sample rate in the wav files is decent enough to get a good idea. Load them in a package that can detune them in case that is needed for the best impression. And they are short, which is because I didn't fit my 128kbyte memory in a system that is prottype anyhow.

synth 1

synth 2

dx rhodes 1, soft

dx rhodes 1, medium

dx rhodes 1, loud

dx rhodes 1, chord

synth 2

Some of these files may not have a .wav header, so they are raw signed byte audio files which may not load in a wav player.
I'll put on some more tested wavs later.

Mathematics on a sound page

The idea of fm synthesis is that operators, which are sine oscilators with envelope generators and frequency modulation inputs, drive eachother on a row, and are put in parallel to make a certain sound algorithm, for instance like this:

O-->O-->O-->O
             >+--> sound out
        O-->O

O= operator, 
--> is sound output, 
left side is frequency modulation input.

In this case because of ascii graphics, signals go from left to right, in dx7 manuals and on the front pannel, the graphs are top to bottom.

Why bother about such 'algorithms', or the idea of FM synthesis to start with, why would one want to make such complicated Bessel spectrums? Mainly the idea is that when we take the same sine oscilators in parallel, as the components of a additive wave, there are 6 harmonics with six oscilators, which is quite limited.

Even one pair of oscilators with one driving the other can create harmonic spectrums with many variations and of considerable width, even too much for most sounds. And every frequency modulation makes for a lot of spectral possiblilities, easily enough contrllable by changing two parameters: the frequency, or the modulation depth.

As a result, for a static sound, the algorithm above, or any other combination of operators driving eachother out of the Dx7's palette of 32 needs 6x2=12 parameters to define that sounds character, globally.

And with those 12 parameters, spectra can be covered from string instruments, wind inturments, electrical instruments, various electronical instruments, withing limitations, but quite effectively over the whole. Even piano sounds, see the little example above for an electrical piano sound, can be mde convincingly enough, and quite musical.

For these kind of instrument patches, the sound is far from static, and use is made of the idea of changing the envelope and external modulation sources of the operators, which in certain ways is still overseeable, and at least understandable: when a spectrum change from spectrum a to b is wanted, one may define the envelopes of the operators such that the static spectrum settings are changed gradually by the envelopes from a to b. Times 6 that is considerable sound change by additional envelope parameters, but at least the possibilities are considerable, and the number of knobs is very far from the number of samples that could be drawn in a sample drawing program to arrive even at a short sound, and then works very onhandy. And the result is not a sample, but a number of parameters that can be changed dynamically even to make sonic variations, which are missing in samples.

The whole idea can be seen as making good use of parameters or knobs to have access to, to make a interesting and or wide spectrum of sounds, without too many parameters, and without missing out on possibilities by too few or to powerless ones.

What's the mathematics in all this doing? The wave laboratory page shows how the basics of sounds can be represented in mathematical form, which is natural for many engineers and scientists. There are not many sensible alternatives, a sound is basically a pressure change, which can be represented as a graph, normally of a one dimensional signal variable, time, and there are many mathematical ways of dealing with graphs.

One may use highschool knowledge about trigoniometics, maybe about 2d and 3d order polynomyals, and try to deal with signals of various kinds like being produced in musical instruments. To start with, one may want to analyse existing signals, such as for instance from sound sample from a real instrument, or try what a certain graph sounds like when rendered into the physical air pressure changes that our ears can understand, by making a sample, and having our modern workhorses' soundcard put it into an electronical signal.

Without prior knowledge or tutoring, making graphs into sounds is not so easy. With some knowledge, it makes sense to start with periodic sounds, and because most of us now sine like functions are periodic, we might start with them, which is a natural and good starting point. Now we'd need to know about frequencies, higher/lower is fine, and about what we can do to make variations in sounds, for which it makes sense to add sine waves together, and know about the concept of a linear combination of signals.

Our ears pick up sine components from a sound, and interpret them in combination, and with certain dynamic changes as sounds from different sources, possibly with musical meaning, or just as sounds. Mathematics let one deal with in principle every sound there is, as long as there is a way of representing it, which there is: a graph, or as some almost see it: a list of sample values representing pressure changes.

In physics and electrical engineering, it is very customary to make use of mathematics to model everything from the behaviour of fundamental particles making up atoms and molecules to signals in a CD player. The idea of modeling sounds mathematically has the advantage of a large knowledge base in mathematical and even computer program form to tackle problems and make sensible statements and reasoning work. A mathematical proof or method is a reliable way to talk about sound properies, and can be used to the advantage of both sound analysers and synthesists. FM synthesis is an example of using a certain mathematical idea and some knowledge around it to make a synthesis methos work with which can be put to use effectively. Additionally, as is also the case with FM, and very much so with other synthesis methods, the application of the mathematical principles has to be possible in some (electrical) engineering way, to make some machine that can actually work with the state of technology.

In synthesis, the state of technology is not bad compared with what is needed to do many interesting and fun enough sounds, or process sounds or music. Apart from the obvious sound reproduction systems, computers and electronics are known to be quite advanced makers of all kinds of sounds, even by complete synthesis, and we all are aware of the possiblities of sampling and storing music on harddiscs. And most are aware of the current limitations of technology here to every song we'd ever want to record on some device, there is quite a limitation in terms of the available amount of memory, so part of the current fashionable technoly tools set is compression to reduce sound file size to about a twentieth by making use of redundancies in the information of music samples.

When chosen right, such technological tools are usefull enough in their own respect, but it may well be that they have more gained insight and possiblities as potential. For instance, mpeg sound files sound different, which may be desirable by some. And that is so because of sound and ear perception research that has identified certain characteristics of our hearing.

The idea of making synthesizers is based on wanting to make ones own sound anywhere a synthesizer can go, and probably the idea of freedom in sound generator choices, to make new sounds at will, and not be limited by existing instruments. I had another motivation as well, I wanted instruments that would fit in my room and could be played without disturbing the environment.

Soundwise, technology is such that many sounds can be reproduced and made, lets say good enough to make general midi keyboards do many convincing imitation of many instruments, even good enough to listen to. In terms of quality, expensive instruments are still needed to make quality sounds, except that a PC may do quite a lot in no-real time, off line fashion. In other words, even for normal enough instruments, technology is not too limited, but not almighty in any respect.

The main point of musical instrument, their pleasingness, versitality, and having an interesting and usefull enough sound character is still quite different for physical, mechanical instruments and synthesizers and electronical and computer instruments. Not just operation wise, but sound wise, though the latter are not bad, and a wide spectrum of their own, no all instruments can readily be made with them, and various properties of mechanical instruments are still considered superior or interesting.

The ultimate sample set hasn't been made, and will never be made, because of the idea in an instrument being not sample replay. To make a good synthesizer, there are various examples that make a certain method of sound synthesis work effective in practice and with musicians interest, for objective enough reasons.

The main reasons are obvious: the sound must be good, which is subjective, but quite measurable and quantifiable, the idea of using it as an instrument must full fill its purpose, meaning it must respond right, and it must be worth the effort, that is the effort of learning a new instrument must pay of.

It is not easy to make realy new and appealing synthesis methods into an instrument, and of course there is quite some quality on the market already, and al lot of fill products, which clearly make use of a certain existing technology variation. Making use of the latest technological advancements is a major drive in the synth market, and generally leads to more advanced and capable instrument. The synthesis models available in instrument form are limited to a number of quite known categories, and attempts to make mathematically and musically founded new synthesis methods into a working instrument can be counted on the fingers of at most a few hands. The succes of an instrument like the dx7, and some others, is at least for a major part a result of making an instrument which with good results implements a new synthesis method which makes sense, and which is used to generate at least a class of sounds not available with others synths, or not in the same way.

Mathematical models to comprehensively model the operations of existing musical instruments are not yet easy to implement on computers without making all kinds of limitations and provisions to make the accuracy good enough. Putting a piano in a graphics program, and letting simulated hammers of hit the virtual strings, and picking up a simulated microphone signal which sounds like the real thing is not so near.

Parts of the idea are quite feasible, but actually generating the sounds from scratch with good enough credibility is not easy enough, and rarely attempted without major simplifications. Electrical guitars as synthesizer sounds suck in general, thats common knowledge.

The system stuff

This is the download program in decent enough C lingo, that at least now has worked without error thus far, meaning the file transfer part is fine, and this program version already shows the preparations of doing memory based dumps.


int _stklen=100000;

#include<stdio.h>
#include<math.h>

#define MAXB 256*1024

unsigned char p[MAXB];

FILE *fp;
int la;

int readarray(n)
char n[];
{
   if ((fp = fopen(n,"rb")) == NULL) {printf("Error: can't open %s.\n",n); exit(-1); }
   la = (int) fread(p, 1, MAXB, fp);
   fclose(fp);
   printf("Read %d bytes\n",la);
   return(0);
}

cunsigned()
{
   int i,j;
   unsigned char c;
   for (i=0; i< la; i++) {
      j = p[i];
      j+=128;
      c = (unsigned char) j;
      p[i] = c;
   }
}

int doout(dd,p)
int p;
unsigned char dd;
{
   asm {
        push ax
        push dx
        mov dx,word [p]         //;word seems 16 bit
        mov al,byte [dd]

        out dx,al

        mov eax,0
        pop dx
        pop ax
   }

   return _EAX;
}

delay(c)      /* Don't look, this is custum */
int c;
{
   int i;
   double x,y;
   x=10.0;
   for (i=0; i< c; i++) {
      y=sin(x);
      x=y+1;
   }
}

dly()
{
   int i,j;
   j=0;
   for (i=0; i<20; i++) j=j+i;
}

outarr(p,m)
char *p;
int m;
{
   int i, j;
   j=0;
   for (i=0; i<m; i++) {
      doout(0,0x37A);
      doout(p[i],0x378);
/*   if ( getch() != ' ') { exit(0); } ; */
      dly();
      doout(1,0x37A);
      j++;
      dly();
   }
      doout(0,0x37A);
   printf("sent %d bytes\n",j);
/*      getch(); */
      doout(1,0x37A);
}

fillarray() {
   int i; 
   unsigned int u;
   unsigned char uc;
   unsigned char *t;
   t = (unsigned char *) p;
   for (i=0; i<4096-2*256; i++) {
      u = 127 + (int) (127 * sin(2*3.141592* (float)i/(128)) / (1+i/512.0) );
      uc = (unsigned char) u;
      t[i]=uc;
/*      printf("%d\n",(unsigned int) uc); */
   }
}

cplot(p)
unsigned char *p;
{
   int i,j;
   for (i=0; i< 256; i++) {
      for (j=0; j<p[i]/4; j++) printf(" ");
      printf("* %d\n",(int) p[i]);
   }
}

main(argc, argv)
int argc;
char *argv[];
{
   int i;
   char c;
   if (argc != 2) { printf("Usage out <file>\n"); exit(-1); }
   fillarray();
   readarray(argv[1]);
/*   outarr(p,4096-2*256); */
   
   cunsigned();
   printf("strobe set to %d\n",doout(0,0x37A) );
   delay(1);
   printf("data prepared, sending\n");
   for (i=0; i< la; i+=4096-2*256) {
      printf("\n%d %d ",i/(4096-2*256),i );
      outarr(p+i,4096-2*256);
      if ((c = getch()) == 'q') exit(0);
      if (c=='p') cplot(p+i);
   }
}

The instructiveness lies enough in the ideaof the program, the programming methods, and maybe the assembly, which is all decently usefull enough to plan on serious enough development.

See the synthesizer progress page for the software on the Z80 system which does the sound playing by keyboard control and digital to analog conversion.

The dma circuitry is not available on this site yet, I didn't have the chance to write it down and scan or do a decent schematics drawing of it somehow, its basically a monoflop driven reset circuit for a array of counters for a number of kilobytes of DMA addressing into the system bus. The data comes from the parallel (printer) port, and the strobe is used to both control the reset monoflop and the counter section clock. The write signal is taken directly from the strobe as well, and the activation of the dma is taken from the reset pulse for the counters.

As a result, any data written to the printer port, at any speed in can maintain itself (I don't think it will make more than lets say 10 megabytes per second pass, and I know my busses and memory are up to 30 at least), will be fed into the microcomputer's memory as soon as the dma is recognized, assuming that time is granted, which is for similar reasoning and because dma isn't interutable or disable-able, the case whenever data rates are limited to the megabytes per second range (which is pretty much what one may expect a printer cable to support max anyhow, I didn't try it completely, except at some point on the other machine I ran into a limitation possible caused by the little capacitive loads on the printer output buffer, probably meant for preventing disturbance and electrical discharge pulses).

In short, the data is put in consequetive memory places as it arrives, in either the zero page memory range, for changing the bootup program, or in a higher section, for dynamically changing data sets. The reset monoflop is used to make sure that when a new dataset arrives, one does not need to rely on the last dataset having filled the whole memory range and cycled the whole counter range to start at zero.

It's time is set to a very short value, which makes it possible to do transfers fast after eachother, still having the counters reset in between to start downloading at the base of the memory segment. Wether data is written to the startup program (0 address, I don't use nmi to do reset, but the real one) space and following, which is write protected during program execution, or to another area, which is not write protected, and can be changed by either the cpu or the dma unit while programs are running, is selected currently by a little switch with two positions. Normally, the program stays in place a long time, while data can be changed on a split second basis, even while a key is held down, and a sample is played in loop mode (the last portion of it) to make a continuous sound with two oscilators, that part of the sample may be changed by a fast download, so the sound character of the loop changes while playing. A little glitch can be heard, nothing bad, which could be less by playing it even faster with the reset pulse, but then it might be some older machines or older programs are not up to the speed it takes to keep the reset from kicking in during a normal transfer.

The idea is that clock pulses are not necessarily symmetrical for the highest transfer speeds, but may leave the circuit waiting for the next databyte, while keeping the clock active, and only cycling trhough the increment/possible reset clock section fast enough to prevent reset.

Various improvements are quite possible, I just worked with the parts I had, and at least it all works from the breadboards, now.

And reliable enough to make a program dump from a ihx Z80 file almost alwys work reliable enough to make the machine tick from the next reset pulse onward, which requires no bit errors, of course.

During dull moments, I had little visions of using the display during no-note-being-played to indicate a checksum of the latest transfer, and maybe a voice name or something. Of course I could also use the ack through end of paper input lines to do automatic checking, but they're not so standard, some are inverted on some machines, bit unhandy. The check of having the program actually run and respond is good enough normally to know things work, and a sound with one byte error has normally a quite audible click in it, too.

A wet suit or stoned to death

Starting from the word death, in greek being tanathos, from for instance rev 1, '... and I, Jesus, have the keys to death and the underworld (hades)..', I looked up some passages with that word, starting in homer, finding a passage with a word only appearing there, and various other words used in not very appealing Homer translation.

Thanatos is death, without question, but not just physical death. The way it is used in the first passage in Homer, refered to in the Scott Liddel lexicon is speaking about a person having been forced to run after having alledgly killed a man from his own town, wanting to take part in a ship journey, explaining some of his wherabouts.

The dark goddess of death and one of destiny are mentioned, as well as a word meaning something unknown, ranging from becoming wet in winter time when that is not wise to stoning under death, I seem to remember, taking word pieces together for which there are many known translations, the idea of being affraid of clan leader and high placed ones, such things.

Reading on of various translations, it becomes clear that in homer, too, it pays to mind the idea that translations can be biased or simply imperfect. The subjects and descriptions are without question of interest for understanding scripture and history, and at least I practice my greek.

What is the key to death, considering death as general idea of separation, and physical death? Obviously Jesus won by raising from the dead from physical death, at least that is what we are informed about with considerable credibility. What about death in the sense of seperation from God? And what if that death is defeated by Jesus for the sake of someone not being seperated any longer, what is the practical result? Why is the 'blood of saints' in the great whore and her abominable ways? And why is that permitted, when even in the churches that are willing to betray and do wrong anything, God can force them to acknowledge that his real followers are His and over their heads, and of a God that is realy almighty God?

In other, less litarary words, what game is being outlined in revelation, and for what divine purpose? There must be a reason for those not very positive prophesies concerning the various groups in revelation, and that not all the ones being in touch with what god wants personally make it very much in terms of holy or acceptable lives. It can be understood that corintians existed, but why was there no more than there was to correct some major wrongs in their midst, like Peter telling liars to drop dead on the spot? Was Paul not good enough apostle for the job, that his fruits were such as in 1 corintians?

And what is the reson that so much misery and damnation is in this world even after Christs' salvation work and alledged continuous intercession with God for the benefit of what, some plan, waiting until all people He wanted to let exists are born and dead again, for what purpose, and is there any we can or may discern?

For whatever reason it was, it seems that God does deal with certain things in a way that makes it not allowed to make them known, maybe personally, maybe for a whole book of prophesy, and considering He has everything to do with desirable human life, it may be that in a human way we can understand why He acts a certain way, and lets things exist the way they are.

And I'm sure He has a reason, which of course may be born out of desire that that is so, but mainly because too much of what He did and made clear maked too much sense to not take serious that there must be direct reasons for a lot more than most humans are willing to seriously communicate about.