Log in

View Full Version : What code do thy use to make the Virus?


DIGITAL SCREAMS
17.03.2005, 11:31 PM
What is the code commonly used for VA synths? Is it that CC+ stuff.....or what ever its called. How many lines of code do you reckon it requires? How long does it take to write? How do they induce sonic character in code? Am I talking bullshit? :lol:

Any answers.....as im interested.

DS

tranzash
17.03.2005, 11:51 PM
Very cool thread
:)

Timo
18.03.2005, 02:00 AM
Wasn't it assembler code in the Virus, to allow the code to be really fast and efficient? I remember reading that somewhere....

Tomer=Trance
18.03.2005, 04:41 AM
yes it was,assmbler is accualy the most basic binary language-
language of the machine :D
its used when programing for dsp runing applications.
its very complex...

blay
18.03.2005, 09:03 AM
html is confusing enough for me.
c++ is plain scary.
assembler sounds evil... 8O

DIGITAL SCREAMS
18.03.2005, 09:09 AM
OK lets say Access use assembler......i find it really interesting to know 'how' they create a distinct sonic character just using code.

Any ideas? This is all pure maths right? Does the sound character come from imperfections in the code?

DS

Tomer=Trance
18.03.2005, 11:05 AM
i guess they start with analizing the charctorists of analog filters and oscilators then they add some eggs some water and walla! access virus.

Timo
18.03.2005, 01:14 PM
OK lets say Access use assembler......i find it really interesting to know 'how' they create a distinct sonic character just using code.

Any ideas? This is all pure maths right? Does the sound character come from imperfections in the code?

Analogue had imperfections which changed over time due to the wear and tear of the electronics/electrics. Digital doesn't suffer from that. What you put in, you get out, duplicated time and time again. If you have some dodgy coding, you'll get dodgy sound out.

I'd bet the real stinker is to try and analyse 'subjective' nuances and differences that we percieve to be pleasing (what you might call 'imperfections' of real analogue, as one example, that happen to sound much nicer than mathematically "perfect" waveforms), and then turn that into hard mathematics.... And then turn that into low-level coding, and optimising it so that as fewer instructions as possible need to be carried out to obtain the desired result, in order to make it as efficient as possible on the available DSP resources.

Incidently, Korg have also done it by analysing what happens to the signals when passed through individual electronic components - component modelling - so they can attempt to accurately build up a representation of what the whole circuit would sound like. That's what they did for the analogue models in their Legacy VST collection (MS20 and Polysix).

Hollowcell
18.03.2005, 01:45 PM
i guess they start with analizing the charctorists of analog filters and oscilators then they add some eggs some water and walla! access virus.

I know nothing about the inner workings of my VC, but I just had to say this is the funniest thing I've ever seen you write Tommer. :D Hehhehe.

The word "walla" doesn't get used enough in this modern world.

blay
18.03.2005, 01:50 PM
i guess they start with analizing the charctorists of analog filters and oscilators then they add some eggs some water and walla! access virus.

:lol:

yep, nice one tomer....

cheers

blay

hatembr
18.03.2005, 02:11 PM
they do use Assembly language, that is what one of the access employees told me on their live chat section. He wasn't very sure though, he hesitated between C and Assembly and then said it was Assembly.


OK lets say Access use assembler......i find it really interesting to know 'how' they create a distinct sonic character just using code.

Any ideas? This is all pure maths right? Does the sound character come from imperfections in the code?



as software programmer, i can easily imagine it :)
since everything is binary, there cannot be random imperfections (actually the concept of "radnom" doesn't really exists in computers) so imperfections themselves are implemented into algorithms, then coded.


look what assembly (ASM as commonly called) looks like:

.model small
.stack
.data
message db "Hello world, I'm learning Assembly !!!", "$"

.code

main proc
mov ax,seg message
mov ds,ax

mov ah,09
lea dx,message
int 21h

mov ax,4c00h
int 21h
main endp
end main



Imagine millions of lines of that!!

This may help some of us understand why sometimes there are bugs and why we should let Access take their time for every new release ;)

hatembr
18.03.2005, 02:16 PM
.... and yes, Digital Sound Processing is 100000% maths and accoustics.
So tomer, you weren't far :)

->the first step is analyzing sound characteristics
-> create a conceptual model
-> write the algorithm
-> code it (ASM, C or whatever...)
-> burn to EPROM ;)

DIGITAL SCREAMS
18.03.2005, 02:36 PM
Thx Hatembr....

So do they litrally use millions of lines of code? If so.....then surely they cant program all that.....they must have other software/tools to write it once the basic is down? Plz excuse my naivety.....but im beginning to find this an interesting topic. Some peopel build kit cars.....one day I'd like to try my hand at building a softsynth.

Where can I go to learn about using computer language to make synths? Are there any courses on the topic?

DS

hatembr
18.03.2005, 02:49 PM
millions? well may be a bit exessive, look, to display a simple asterisk character on the screen using ASM you will need this code:

;ASM example
.model small
.stack
.code
mov ah,2h ;moves the value 2h to register ah
mov dl,2ah ;moves de value 2ah to register dl
;(Its the asterisk value in ASCII format)
int 21h ;21h interruption
mov ah,4ch ;4ch function, goes to operating system
int 21h ;21h interruption
end ;finishes the program code

so imagine all the maths functions, conditions, cycles.................
i guess there is easily hundreds of thousands lines of code in our synths.

Of course, a good programmer never rewirtes his code, he has generic libraries (modules) he can customize and reuse (reusability is a very important concept in programing) .

Now if you want to know how to program your own synth, the first thing you will need to know is Digital Sound Processing which is quite hard (i tried to learn it but i quit! too much electronics in there).

Then you will have to write an algorithm => the different scenarii of your "program", and then code it.

If you tell me what u know in computers and programming, i can help u start, as there are tons of free tutorials on the net.

wildbill
19.03.2005, 01:50 AM
hey hatembr: total ignorance here, but i've always wondered like in your example, what determines that those code lines are referring to an asterik, and not say, a middle c on a keyboard or something?

also, i thought assembly language was just raw 0's and one's. what you're describing looks to be at least one level higher than that.

i guess my question would be, if 00011100011110000 means something - how is it determined what it means.

and with only one's and zero's to work with, how can a number refer to a sound, a picture, or anything else for that matter?

like i said - total ignorance. :oops:



digital screams - a lot of the softsynths at KVR are made with a program called synth-edit, it's not supposed to be real efficient, but you could google it up to give it a try.

EnjoyRC
19.03.2005, 03:34 AM
Binary 1's and 0's are how the data is stored. Assembly language is the actual instruction set of manipulating memory and executing commands.

jasedee
19.03.2005, 06:15 AM
Im studying this stuff at University......Learning to create simple DSP (For FX etc..) and am having to get my head around Binary, hexidecimal, learning that all mathematics in binary are performed by addition (what a headfuck!)

And then there's the electronics side of things......jeez!

hatembr
19.03.2005, 08:53 AM
hey hatembr: total ignorance here, but i've always wondered like in your example, what determines that those code lines are referring to an asterik, and not say, a middle c on a keyboard or something?

it is this line of code:
mov dl,2ah ;moves de value 2ah to register dl
;(Its the asterisk value in ASCII format)

the value 2AH (hexa) placed in the DL register of the CPU refers to the ASCII value of the character "asterisk", what follows that line will tell the CPU what to do with it (not obvious i know).

also, i thought assembly language was just raw 0's and one's. what you're describing looks to be at least one level higher than that.

i guess my question would be, if 00011100011110000 means something - how is it determined what it means.

Now as far as 0s and 1s go, the ASM language IS the lowest level in programming languages, what you see there is just a symbolic representation of it, to make it accessible to humans, otherwise it would be impossible to write not even a single line of code.

So, behind the "mov" instruction, there is a binary value, behind the "DL" register name, there is also a binary value , and so on.
After you finish your "symbolic" coding, you move to the "compilation" phase where your ASM compiler will translate those text-characters (we understand) to their real binary values so that the CPU can understand them.

ASM reflects what really happens when you execute anything on your computer, that is what the CPU really does, it moves a value into one register, another value into another register, calls an interruption and so on.

;)


and with only one's and zero's to work with, how can a number refer to a sound, a picture, or anything else for that matter?

sounds, pictures, videos, text, windows all that doesn't really exist at a low-level speaking. They are all sequences of instructions the CPU executes, to reflect a virtual image on your screen.
As far as sounds go, after a long analyzing phase (the hardest work), they can be translated into instructions the CPU in the virus executes and sends to the appropriate part of the machine to make it audibale.
But at the beginning, it is just a set of instructions.

Timo
19.03.2005, 10:49 AM
Bear in mind that computers/DSP nowadays are extremely fast in executing literally billions of lines of codes in mere seconds.

In the old days (the furthest I can look back is the 80's, being just 25 yrs old) it took hours to load relatively simple applications. Lol, the Commodore 64 sometimes took 30-40mins to load up a basic 8-bit game.

The SID chip, though, wow..... :) Still loved, 20 years on.

Juho L
19.03.2005, 11:38 AM
->the first step is analyzing sound characteristics
-> create a conceptual model
-> write the algorithm
-> code it (ASM, C or whatever...)
-> burn to EPROM ;)

...and this way we get a EPROM full of ASCII characters. Yay! As someone pointed out, the code is just a pseudo language that coding would be easier for humans. To make computer to execute the program, the code has to be translated (compiling, building, linking...) to create a binary code.

Juho L
19.03.2005, 11:46 AM
sounds, pictures, videos, text, windows all that doesn't really exist at a low-level speaking. They are all sequences of instructions the CPU executes, to reflect a virtual image on your screen.

Or we might say that any kind of data can be presented as numbers - This is why Gauss said maths is the queen of sciences. For example pictures can be presented with raw numbers like coordinates + colour code. The instructions to read the data or what to do with the data is not contained in the picture data. Messing the picture data with isntructions would be silly. Naturally there are tags in the start and/or end of a data area to tell the possible preferences of the data (like packing method, size, etc).

As far as sounds go, after a long analyzing phase (the hardest work), they can be translated into instructions the CPU in the virus executes and sends to the appropriate part of the machine to make it audibale.
But at the beginning, it is just a set of instructions.

Easier to say that sounds are waves, and waves can be presented as continuous functions (I assume functions are familiar to everyone from school), and, as Mr.Fourier proved, any continuous function can be divided into a finite number of sine and cosine components. All computer audio is more or less based on Fourier analysis either dividing incoming audio to components or reconstructing audo from components.

Juho L
19.03.2005, 11:51 AM
and am having to get my head around Binary, hexidecimal, learning that all mathematics in binary are performed by addition (what a headfuck!!

It's fairly easy when you get hang of it. Just spend some free time on those things and you save lots of time in the future. I recommend that you always transform binary values to hexadecimal to ease up (and shorten) the calculations and then transform the result back to binary.

And then there's the electronics side of things......jeez!

My favourite! Call me geek, but there's nothing more fun (besides music) than design & build computer controlled electronic devices. Shucks that I don't have chip programming boards and PCB stuff around... Maybe I should get those and start building stuff again for that synth project.

Nigel Harkness
19.03.2005, 12:02 PM
that synth project. :?: :?: :?:

Do tell, what project?

DIGITAL SCREAMS
19.03.2005, 12:43 PM
Truth is guys....i think ive discovered what i want to do in life. Build analog synths weeeeee

DS

hatembr
19.03.2005, 12:53 PM
...and this way we get a EPROM full of ASCII characters. Yay! As someone pointed out, the code is just a pseudo language that coding would be easier for humans. To make computer to execute the program, the code has to be translated (compiling, building, linking...) to create a binary code.


:D

yeah it's me, I said it is just a symbolic representation of binary instructions, but in that example (the first one), it is true i didn't mention the compiling phase, (which is quite important :) btw)

dries
19.03.2005, 03:35 PM
for that kind of stuff you use c with lots of inline assembler.

every dsp has its own tricks and trouble.

you need some sollid hardware knowledge too, to understand all that stuff.

here some code for a reverb section:

/******************************************************************************** ****************
* *
* Reverberation Audio Effect program as described by James A. Moorer in *
* "About This Reverberation Business," Computer Music Journal, *
* Vol. 3, No. 2, pp. 13-28, 1979. *
* *
* Based on reference code created for the ADSP-2181 EZ-KIT Lite *
* by Brian C. Neunaber, St. Louis Music Electronics *
* *
* Created for the 21065L EZ-LAB Evaluation Platform to include on-the-fly selection *
* of reverb comb filter gains/lengths, ER gain/length presets, and left/right panning *
* via IRQ1 or RS232 control *
* John Tomarakos *
* ADI DSP Applications *
* Revision 3.0 *
* 9/30/98 *
* *
******************************************************************************** *****************/

/* ADSP-21060 System Register bit definitions */
#include "def21065l.h"
#include "new65Ldefs.h"

.GLOBAL Digital_Reverberator;
.GLOBAL Init_Reverb_Buffers;
.GLOBAL change_reverb_settings;
.EXTERN Left_Channel_In;
.EXTERN Right_Channel_In;
.EXTERN Left_Channel_Out;
.EXTERN Right_Channel_Out;



/* Reverb DM Variables and pointers */
.segment /dm rev_vars;
.VAR reverb_result;
.VAR er_output;
.VAR all_pass_ptr;
.VAR early_refl_ptr;
.VAR comb1_ptr;
.VAR comb2_ptr;
.VAR comb3_ptr;
.VAR comb4_ptr;
.VAR comb5_ptr;
.VAR comb6_ptr;
.VAR comb1_lpf_state;
.VAR comb2_lpf_state;
.VAR comb3_lpf_state;
.VAR comb4_lpf_state;
.VAR comb5_lpf_state;
.VAR comb6_lpf_state;
.VAR comb_output[6];
.VAR all_pass[336]; /* 7 ms, rounded to prime number */
.VAR early_refl[3520];
.endseg;


/* comb lengths are rounded to nearest prime number */
#define C1_LENGTH 1915 /* 1915 */ /* 40 ms @ 48 KHz} */
#define C2_LENGTH 2121 /* 2121 */ /* 44 ms */
#define C3_LENGTH 2300 /* 2300 */ /* 48 ms */
#define C4_LENGTH 2496 /* 2496 */ /* 52 ms */
#define C5_LENGTH 2685 /* 2685 */ /* 56 ms */
#define C6_LENGTH 2881 /* 2881 */ /* 60 ms */

/* -------------DATA MEMORY COMB FILTER BUFFERS ---------------------------------*/
.segment /dm dm_revrb;
.VAR comb1[C1_LENGTH];
.VAR comb2[C2_LENGTH];
.VAR comb3[C3_LENGTH];
.VAR comb4[C4_LENGTH];
.VAR comb5[C5_LENGTH];
.VAR comb6[C6_LENGTH];

.endseg;


/* ----------- INTERRUPT/FLAG AUDIO DEMO CONTROL PARAMETERS ---------*/
.segment /dm IRQ_ctl;
.VAR COMB1_GAIN = 0x50710000;
.VAR COMB2_GAIN = 0x4FD40000;
.VAR COMB3_GAIN = 0x4F390000;
.VAR COMB4_GAIN = 0x4EA10000;
.VAR COMB5_GAIN = 0x4E0B0000;
.VAR COMB6_GAIN = 0x4D770000;
.VAR COMB1_LENGTH = 1915; /* Comb Filter lengths initially set to constants defined above */
.VAR COMB2_LENGTH = 2121; /* These are used to set the L registers for the comb filters */
.VAR COMB3_LENGTH = 2300; /* When modifying these values for simulating different enclosed */
.VAR COMB4_LENGTH = 2496; /* spaces, ONLY MAKE THEM SMALLER !! */
.VAR COMB5_LENGTH = 2685; /* If you make them larger, reverb buffers will overlap */
.VAR COMB6_LENGTH = 2881;

.VAR IRQ1_counter = 0x00000004; /* selects preset 1 first on IRQ1 assertion */

/* mask register and select bits for early reflection length and gain presets */
.VAR EAR_REF_MASK = 0x00000000;
#define DEFAULT_ER 0
#define SELECT_LEN1 1
#define SELECT_LEN2 2
#define SELECT_LEN3 3
#define SELECT_GAIN1 4
#define SELECT_GAIN2 5
#define SELECT_GAIN3 6

.VAR DRY_GAIN_LEFT = 0x7FFFFFFF; /* Gain Control for left channel */
/* scale between 0x00000000 and 0x7FFFFFFF */
.VAR DRY_GAIN_RIGHT = 0x7FFFFFFF; /* Gain Control for right channel */
/* scale between 0x00000000 and 0x7FFFFFFF */
.VAR ER_GAIN_LEFT = 0x7FFFFFFF; /* Gain Control for early_reflections left output */
/* scale between 0x00000000 and 0x7FFFFFFF */
.VAR ER_GAIN_RIGHT = 0x7FFFFFFF; /* Gain Control for early_reflections right output */
/* scale between 0x00000000 and 0x7FFFFFFF */
.VAR REV_GAIN_LEFT = 0x7FFFFFFF; /* Gain for reverb result */
/* scale between 0x00000000 and 0x7FFFFFFF */
.VAR REV_GAIN_RIGHT = 0x7FFFFFFF; /* Gain for reverb result */
/* scale between 0x00000000 and 0x7FFFFFFF */

/* Early Reflection Filter Tap Lengths */
.VAR er_length1[18] = -190, -759, -44, -190, -9, -123, -706, -119, -384,
-66, -35, -75, -419, -4, -79, -66, -53, -194;
.VAR er_length2[18] = -127, -524, -99, -166, -40, -188, -500, -156, -180,
-250, -40, -700, -50, -80, -100, -350, -50,-100;
.VAR er_length3[18] = -400, -800, -550, -345, -200, -225, -150, -90, -75,
-60, -175, -150, -90, -65, -45, -30, -40, -20;
.endseg;

.segment /pm IRQ_pm;
.VAR er_gain1[18] = 0x6BA60000,
0x40830000,
0x3ED90000,
0x30830000,
0x30A40000,
0x2C4A0000,
0x24FE0000,
0x22D10000,
0x18930000,
0x18B40000,
0x1BC70000,
0x172B0000,
0x170A0000,
0x172B0000,
0x16870000,
0x122D0000,
0x15600000,
0x11270000;

.VAR er_gain2[18] = 0x62A60000,
0x7A0C0D00,
0x5ED90FF0,
0x608302D0,
0x6FA4AB00,
0x654A0054,
0x53FE9200,
0x52D100ED,
0x65930AC1,
0x70B49973,
0x4BC74425,
0x542BAA46,
0x430A22DC,
0x372BAA56,
0x4687DA23,
0x352D4254,
0x5600ABCD,
0x41279245;

.VAR er_gain3[18] = 0x12A60000,
0x2A0C0D00,
0x3ED90FF0,
0x208302D0,
0x3FA4AB00,
0x454A0054,
0x33FE9200,
0x52D100ED,
0x45930AC1,
0x70B49973,
0x6BC74425,
0x542BAA46,
0x630A22DC,
0x572BAA56,
0x6687DA23,
0x652D4254,
0x5600ABCD,
0x71279245;
.endseg;

/* -------------PROGRAM MEMORY CODE---------------------------------*/
.segment /pm pm_code;

Init_Reverb_Buffers:
B0 = er_length1; /* initialize early reflection delay tap lengths*/
B8 = er_gain1; /* initialize early reflection gains */
/* always use I0 and I8 for ER FIR filter, place in internal mem */
L0 = @er_length1; L8 = @er_gain1;

B1 = early_refl; /* initialize early reflections pointer to top of buffer */
DM(early_refl_ptr) = B1;

B1 = comb1; /* initialize pointers to comb filter buffers */
DM(comb1_ptr) = B1;
B2 = comb2;
DM(comb2_ptr) = B2;
B3 = comb3;
DM(comb3_ptr) = B3;
B4 = comb4;
DM(comb4_ptr) = B4;
B5 = comb5;
DM(comb5_ptr) = B5;
B6 = comb6;
DM(comb6_ptr) = B6;

B7 = all_pass; /* initialize all-pass filter pointer to top of buffer */
DM(all_pass_ptr) = B7;


RTS;

/* //////////////////////////////////////////////////////////////////////////////////////////// */
/* */
/* Digital Reverb Filter Routines */
/* */
/* //////////////////////////////////////////////////////////////////////////////////////////// */

Digital_Reverberator:
r14 = DM(Left_Channel_In);
r15 = DM(Right_Channel_In);

r1 = 0x40000000; /* sum input samples */
mrf = r14*r1 (SSF); /* 1/2 xleft(n) + 1/2 xright(n) */
mrf = mrf + r15*r1 (SSFR);

call (PC, early_reflections); /* early reflections */
r6 = mr1f;
DM(er_output) = r6;

call (PC, comb_filters); /* comb filters */

r0 = mr1f;
call (PC, all_pass_filter); /* all pass filter */
dm(reverb_result) = r3;

call reverb_mixer;

rts;

/* --------------------------------------------------------- */

reverb_mixer:
r2 = 0x2AAA0000; /* set up scaling factor for result */
/* mix input with eref & reverb result by 1/3 */

r10 = DM(Left_Channel_In); /* get current left input sample */
r11 = DM(DRY_GAIN_LEFT); /* scale between 0x0 and 0x7FFFFFFF */
r10 = r10 * r11(ssf); /* x(n) *(G_left) */
mrf = r2 * r10(ssf); /* 0.33 * (G_left) * x(n) */

r1 = dm(reverb_result); /* get reverb result */
r11 = DM(REV_GAIN_LEFT); /* scale reverb between 0x0 and 0x7FFFFFFF */
r1 = r1 * r11 (ssf); /* x_reverb(n) * RG_left */
mrf = mrf + r1*r2 (ssf); /* add reverb to input sample */
r10 = mr1f; /* 0.33*x(n) +0.33*x(rev_result) */

r1 = dm(er_output);
r4 = DM(ER_GAIN_LEFT); /* scale between 0x0 and 0x7FFFFFFF */
r3 = r1 * r4 (ssf); /* x_er(n) * (ER_G_left) */
mrf = mrf + r3*r2 (ssfr); /* yL(n)=0.33*x(n) +0.33*x(rev_result) + 0.33*x(ear_ref) */
r10 = mr1f;
dm(Left_Channel_Out) = r10; /* output left result */


r10 = DM(Right_Channel_In); /* get current right input sample */
r11 = DM(DRY_GAIN_RIGHT); /* scale between 0x0 and 0x7FFFFFFF */
r10 = r10 * r11(ssf); /* x(n) *(G_right) */
mrf = r2 * r10(ssf); /* 0.33 * (G_right) * x(n) */

r1 = dm(reverb_result); /* get reverb result */
r11 = DM(REV_GAIN_RIGHT); /* scale reverb between 0x0 and 0x7FFFFFFF */
r1 = r1 * r11 (ssf); /* x_reverb(n) * RG_right */
mrf = mrf + r1*r2 (ssf); /* add reverb to input sample */
r10 = mr1f; /* 0.33*x(n) +0.33*x(rev_result) */

r1 = dm(er_output);
r4 = DM(ER_GAIN_RIGHT); /* scale between 0x0 and 0x7FFFFFFF */
r3 = r1 * r4 (ssf); /* x_er(n) * (ER_G_right) */
mrf = mrf + r3*r2 (ssfr); /* yR(n)=0.33*x(n) +0.33*x(rev_result) + 0.33*x(ear_ref) */
r10 = mr1f;
dm(Right_Channel_Out) = r10; /* output right result */
rts;


/*------------ Early Reflections FIR Filter ------------*
* *
* input -> MR1F *
* *
* MR1F <- output *
* *
*-------------------------------------------------------*/
early_reflections:
L0 = 18; /* L0 register set back to 18, since modified in comb routine */
B8 = er_gain1; /* I8 is ptr to tap gains */
B0 = er_length1; /* I0 is ptr to tap lengths */

/* select desired gain and filter tap lengths from presets */
R10 = DM(EAR_REF_MASK);

check_er_gain_length:
BTST R10 by DEFAULT_ER; /* Default preset */
IF sz JUMP check_er_len1;
B8 = er_gain1; /* If at default setting, do not change */
B0 = er_length1;

check_er_len1:
BTST R10 by SELECT_LEN1;
IF sz JUMP check_er_len2;
B0 = er_length1; /* point to length 1 buffer if selected */

check_er_len2:
BTST R10 by SELECT_LEN2;
IF sz JUMP check_er_len3;
B0 = er_length2; /* point to length 2 buffer if selected */

check_er_len3:
BTST R10 by SELECT_LEN3;
IF sz JUMP check_er_gain1;
B0 = er_length3; /* point to length 3 buffer if selected */

check_er_gain1:
BTST R10 by SELECT_GAIN1;
IF sz JUMP check_er_gain2;
B8 = er_gain1; /* point to gain 1 buffer if selected */

check_er_gain2:
BTST R10 by SELECT_GAIN2;
IF sz JUMP check_er_gain3;
B8 = er_gain2; /* point to gain 2 buffer if selected */

check_er_gain3:
BTST R10 by SELECT_GAIN3;
IF sz JUMP start_fir_filtering;
B8 = er_gain3; /* point to gain 3 buffer if selected */

start_fir_filtering:
M8 = 1;
B7 = early_refl;
L7 = @early_refl;
I7 = DM(early_refl_ptr); /* I7 is ptr to buffer */
R10 = MR1F;
DM(I7,1) = R10; /* write current sample to buffer */
DM(early_refl_ptr) = I7; /* save updated pointer */

R1 = DM(I0,1); /* get first delay tap length */
M7 = R1;
MODIFY(I7,M7); /* buffer pointer now points to first tap */

R1 = DM(I0,1); /* get next tap length */
M7 = R1;
R3 = DM(I7,M7), R4 = PM(I8,M8); /* get first sample and first tap gain for MAC */

LCNTR = 17, DO er_sop UNTIL LCE; /* number of early reflections = 18 */
R1 = DM(I0,1); /* get next tap length */
M7 = R1; /* put tap length in M7 */
er_sop: MRF = MRF + R3*R4 (SSF),R3 = DM(I7,M7), R4 = PM(I8,M8);
/* compute sum of products, get next sample, get next tap gain */
MRF = MRF + R3*R4 (SSFR); /* last sample to be computed */
MRF = SAT MRF;

RTS;


/* ----------------- Cascaded Comb Filters Routine -------------------- */
/* */
/* R6 <- input */
/* output -> MR1F */
/* */
/* Note: R6 must not be corrupted until all 6 comb filters are */
/* computed */
/* Also, it is not necessary to save and restore all comb filter */
/* FIR or all-pass filter index and length registers, if only */
/* doing this reverb demo. These extra instructions are included */
/* so that this example can easily be combined with other audio */
/* effects that require the use of multiple buffers */
/* -------------------------------------------------------------------- */

comb_filters:

L0 = @comb_output;
B0 = comb_output;

/* comb 1 */
R0 = DM(COMB1_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x26660000; /* gl -- low pass filter gain */

L1 = DM(COMB1_LENGTH);
I1 = DM(comb1_ptr);
R4 = DM(I1,0); /* read comb buffer -> output */

R5 = DM(comb1_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb1_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I1,1) = R10; /* write sample to buffer */
DM(comb1_ptr) = I1; /* save updated pointer */


/* comb 2 */
R0 = DM(COMB2_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x27AE0000; /* gl -- low pass filter gain */

L2 = DM(COMB2_LENGTH);
I2 = DM(comb2_ptr);
R4 = DM(I2,0); /* read comb buffer -> output */

R5 = DM(comb2_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb2_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I2,1) = R10; /* write sample to buffer */
DM(comb2_ptr) = I2; /* save updated pointer */


/* comb 3 */
R0 = DM(COMB3_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x28F60000; /* gl -- low pass filter gain */

L3 = DM(COMB3_LENGTH);
I3 = DM(comb3_ptr);
R4 = DM(I3,0); /* read comb buffer -> output */

R5 = DM(comb3_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb3_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I3,1) = R10; /* write sample to buffer */
DM(comb3_ptr) = I3; /* save updated pointer */


/* comb 4 */
R0 = DM(COMB4_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x2A3D0000; /* gl -- low pass filter gain */

L4 = DM(COMB4_LENGTH);
I4 = DM(comb4_ptr);
R4 = DM(I4,0); /* read comb buffer -> output */

R5 = DM(comb4_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb4_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I4,1) = R10; /* write sample to buffer */
DM(comb4_ptr) = I4; /* save updated pointer */


/* comb 5 */
R0 = DM(COMB5_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x2B850000; /* gl -- low pass filter gain */

L5 = DM(COMB5_LENGTH);
I5 = DM(comb5_ptr);
R4 = DM(I5,0); /* read comb buffer -> output */

R5 = DM(comb5_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb5_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I5,1) = R10; /* write sample to buffer */
DM(comb5_ptr) = I5; /* save updated pointer */


/* comb 6 */
R0 = DM(COMB6_GAIN); /* gf = Gf/(1+gl) -- comb feedback gain */
R1 = 0x2CCD0000; /* gl -- low pass filter gain */

L6 = DM(COMB6_LENGTH);
I6 = DM(comb6_ptr);
R4 = DM(I6,0); /* read comb buffer -> output */

R5 = DM(comb6_lpf_state); /* read previous low pass filter state */
MRF = R4*R0 (SSF), DM(I0,1) = R4; /* save output, feedback comb output */
MRF = MRF + R5*R1 (SSFR); /* add low pass filter state */
R10 = MR1F;
DM(comb6_lpf_state) = R10; /* replace with new filter state */

MR1F = R5; /* get old low pass filter output */
R7 = 0x46760000; /* gi = 1/(1 + gf + gf*gl) */
MRF = MRF + R6*R7 (SSFR); /* mac lpf output with input */
R10 = MR1F;
DM(I6,1) = R10; /* write sample to buffer */
DM(comb6_ptr) = I6; /* save updated pointer */


B0 = comb_output; /* sum outputs of comb filters */
R1 = 0x15555555; /* scale comb outputs by 1/6 */
R0 = DM(I0,1); /* load comb output */
MRF = R0*R1 (SSF), R0 = DM(I0,1); /* compute product, load next comb output*/
MRF = MRF + R0*R1 (SSF), R0 = DM(I0,1); /* compute sum of products */
MRF = MRF + R0*R1 (SSF), R0 = DM(I0,1); /* and so on ... */
MRF = MRF + R0*R1 (SSF), R0 = DM(I0,1);
MRF = MRF + R0*R1 (SSF), R0 = DM(I0,1);
MRF = MRF + R0*R1 (SSFR);

RTS;


/* --------------- All Pass Filter Routine ---------------------- */
/* */
/* input -> R0 */
/* output -> R3 */
/* */
/* -------------------------------------------------------------- */

all_pass_filter:
B7 = all_pass;
I7 = DM(all_pass_ptr);
L7 = @all_pass;
R1 = 0x599A0000; /* feedback gain */

R10 = DM(I7,0); /* load output of buffer */
MR1F = R10;
MRF = MRF + R1*R0 (SSFR); /* add to (feedback gain)*(input) */
MRF = SAT MRF;
R3 = MR1F; /* output of all pass in R3 */

MR1F = R0; /* put input of all pass in MR1F */
MRF = MRF - R1*R3 (SSFR); /* input - (feedback gain)*(output) */
MRF = SAT MRF;
R10 = MR1F;
DM(I7,1) = R10; /* save to input of buffer */
DM(all_pass_ptr) = I7;

RTS;

/* ------------------------------------------------------------------------------------- */
/* */
/* IRQ1 Pushbutton Interrupt Service Routine */
/* */
/* This routine allows the user to modify reverb presets on-the-fly to allow for */
/* emulation of either large auditoriums, medium size enclosures, or small rooms. */
/* */
/* Default before 1st IRQ push: Reverb Setting #1 - Large Auditorium/Gym */
/* 1st Pushbutton Press: Reverb Setting #1 - Small Room - Bathroom or Hallway */
/* 2nd Pushbutton Press: Reverb Setting #2 - Medium Size Room with increasing ER */
/* 3rd Pushbutton Press: Reverb Setting #3 - Large Gym with R to L panning effect */
/* 4th Pushbutton Press: Reverb Setting #4 - Large Cave with L to R pan */
/* 5th Pushbutton Press: Reverb Setting #4 - Large Gym with L to R pan */
/* 6th Pushbutton Press: Reverb Setting #4 - Large Auditorium with L to R pan */
/* 7th Pushbutton Press: Reverts back to setting #1 */
/* */
/* Also note, early reflections and later reverberations are panned differently */
/* between left and right channels for all reverb presets. For example, early */
/* reflections may come from the left speaker, while the later reverberations */
/* come from the right speaker. */
/* */
/* yL(n)=0.33*(Gain)*x(n) +0.33*(Gain)*x(rev_result) + 0.33*(Gain)*x(ear_ref) */
/* yR(n)=0.33*(Gain)*x(n) +0.33*(Gain)*x(rev_result) + 0.33*(Gain)*(x(ear_ref) */
/* ------------------------------------------------------------------------------------- */

change_reverb_settings:
bit set mode1 SRRFH; /* enable background register file */
NOP; /* 1 CYCLE LATENCY FOR WRITING TO MODE1 REGISER!! */

r13 = 6; /* number of presets */
r15 = DM(IRQ1_counter); /* get preset count */
r15 = r15 + 1; /* increment preset */
comp (r15, r13);
if ge r15 = r15 - r15; /* reset to zero */
DM(IRQ1_counter) = r15; /* save preset count */

r10 = pass r15; /* get preset mode */
if eq jump reverb_settings_2; /* check for count == 0 */
r10 = r10 - 1;
if eq jump reverb_settings_3; /* check for count == 1 */
r10 = r10 - 1;
if eq jump reverb_settings_4; /* check for count == 3 */
r10 = r10 - 1;
if eq jump reverb_settings_5; /* check for count == 4 */
r10 = r10 - 1;
if eq jump reverb_settings_6; /* check for count == 5 */

reverb_settings_1: /* count therefore, is == 6 if you are here */
r14 = 0x00000024; DM(EAR_REF_MASK) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x2FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_LEFT) = r14;
r14 = 0x0FFFFFFF; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x07FFFFFF; DM(REV_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_RIGHT) = r14;

/* When modifying length values for simulating different enclosed spaces, ONLY MAKE THEM SMALLER !! */
/* If you make them larger than defined lengths, reverb buffers will overlap */
/* Default Comb1 Length 1915 - 40 ms @ 48 KHz} */
/* Default Comb2 Length 2121 - 44 ms */
/* Default Comb3 Length 2300 - 48 ms */
/* Default Comb4 Length 2496 - 52 ms */
/* Default Comb5 Length 2685 - 56 ms */
/* Default Comb6 Length 2881 - 60 ms */

r14 = 1115; DM(COMB1_LENGTH) = r14;
r14 = 1321; DM(COMB2_LENGTH) = r14;
r14 = 1500; DM(COMB3_LENGTH) = r14;
r14 = 1796; DM(COMB4_LENGTH) = r14;
r14 = 1985; DM(COMB5_LENGTH) = r14;
r14 = 2281; DM(COMB6_LENGTH) = r14;

r14 = 0x30710000; DM(COMB1_GAIN) = r14;
r14 = 0x2FD40000; DM(COMB2_GAIN) = r14;
r14 = 0x2F390000; DM(COMB3_GAIN) = r14;
r14 = 0x2EA10000; DM(COMB4_GAIN) = r14;
r14 = 0x1E0B0000; DM(COMB5_GAIN) = r14;
r14 = 0x1D770000; DM(COMB6_GAIN) = r14;
bit set ustat1 0x3E; /* turn on Flag4 LED */
bit clr ustat1 0x01;
dm(IOSTAT)=ustat1;
jump done;

reverb_settings_2:
r14 = 0x00000048; DM(EAR_REF_MASK) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x00000000; DM(ER_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_LEFT) = r14;
r14 = 0x00000000; DM(REV_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_LEFT) = r14;

r14 = 800; DM(COMB1_LENGTH) = r14;
r14 = 1121; DM(COMB2_LENGTH) = r14;
r14 = 1200; DM(COMB3_LENGTH) = r14;
r14 = 1596; DM(COMB4_LENGTH) = r14;
r14 = 1685; DM(COMB5_LENGTH) = r14;
r14 = 2081; DM(COMB6_LENGTH) = r14;

r14 = 0x20710012; DM(COMB1_GAIN) = r14;
r14 = 0x2FD45476; DM(COMB2_GAIN) = r14;
r14 = 0x2F390776; DM(COMB3_GAIN) = r14;
r14 = 0x1EA10001; DM(COMB4_GAIN) = r14;
r14 = 0x1E0B0999; DM(COMB5_GAIN) = r14;
r14 = 0x1D770cff; DM(COMB6_GAIN) = r14;
bit set ustat1 0x3D; /* turn on Flag5 LED */
bit clr ustat1 0x02;
dm(IOSTAT)=ustat1;
jump done;

reverb_settings_3:
r14 = 0x00000028; DM(EAR_REF_MASK) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_LEFT) = r14;
r14 = 0x00000000; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x00000000; DM(REV_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_RIGHT) = r14;

r14 = 1742; DM(COMB1_LENGTH) = r14;
r14 = 2087; DM(COMB2_LENGTH) = r14;
r14 = 2202; DM(COMB3_LENGTH) = r14;
r14 = 2487; DM(COMB4_LENGTH) = r14;
r14 = 2577; DM(COMB5_LENGTH) = r14;
r14 = 2743; DM(COMB6_LENGTH) = r14;

r14 = 0x40712344; DM(COMB1_GAIN) = r14;
r14 = 0x3FD42525; DM(COMB2_GAIN) = r14;
r14 = 0x3A392465; DM(COMB3_GAIN) = r14;
r14 = 0x3AA14343; DM(COMB4_GAIN) = r14;
r14 = 0x3C0B2344; DM(COMB5_GAIN) = r14;
r14 = 0x2F771141; DM(COMB6_GAIN) = r14;
bit set ustat1 0x3B; /* turn on Flag6 LED */
bit clr ustat1 0x04;
dm(IOSTAT)=ustat1;
jump done;

reverb_settings_4:
r14 = 0x00000000; DM(EAR_REF_MASK) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x00000000; DM(ER_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_LEFT) = r14;
r14 = 0x00000000; DM(REV_GAIN_RIGHT) = r14;

r14 = 1179; DM(COMB1_LENGTH) = r14;
r14 = 1372; DM(COMB2_LENGTH) = r14;
r14 = 1573; DM(COMB3_LENGTH) = r14;
r14 = 1832; DM(COMB4_LENGTH) = r14;
r14 = 2185; DM(COMB5_LENGTH) = r14;
r14 = 2381; DM(COMB6_LENGTH) = r14;

r14 = 0x30711200; DM(COMB1_GAIN) = r14;
r14 = 0x3FD4aa00; DM(COMB2_GAIN) = r14;
r14 = 0x4F390012; DM(COMB3_GAIN) = r14;
r14 = 0x3EA10000; DM(COMB4_GAIN) = r14;
r14 = 0x3E0B0120; DM(COMB5_GAIN) = r14;
r14 = 0x2D770240; DM(COMB6_GAIN) = r14;
bit set ustat1 0x37; /* turn on Flag7 LED */
bit clr ustat1 0x08;
dm(IOSTAT)=ustat1;
jump done;

reverb_settings_5:
r14 = 0x00000000; DM(EAR_REF_MASK) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_RIGHT) = r14;

r14 = 1915; DM(COMB1_LENGTH) = r14;
r14 = 2121; DM(COMB2_LENGTH) = r14;
r14 = 2300; DM(COMB3_LENGTH) = r14;
r14 = 2496; DM(COMB4_LENGTH) = r14;
r14 = 2685; DM(COMB5_LENGTH) = r14;
r14 = 2881; DM(COMB6_LENGTH) = r14;

r14 = 0x50710011; DM(COMB1_GAIN) = r14;
r14 = 0x4FD40100; DM(COMB2_GAIN) = r14;
r14 = 0x4F390020; DM(COMB3_GAIN) = r14;
r14 = 0x3EA100aa; DM(COMB4_GAIN) = r14;
r14 = 0x2E0B00bb; DM(COMB5_GAIN) = r14;
r14 = 0x3D770012; DM(COMB6_GAIN) = r14;
bit set ustat1 0x2F; /* turn on Flag8 LED */
bit clr ustat1 0x10;
dm(IOSTAT)=ustat1;
jump done;

reverb_settings_6:
r14 = 0x00000000; DM(EAR_REF_MASK) = r14;
r14 = 0x2FFFFFFF; DM(DRY_GAIN_LEFT) = r14;
r14 = 0x7FFFFFFF; DM(DRY_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(ER_GAIN_LEFT) = r14;
r14 = 0x4FFFFFFF; DM(ER_GAIN_RIGHT) = r14;
r14 = 0x7FFFFFFF; DM(REV_GAIN_LEFT) = r14;
r14 = 0x4FFFFFFF; DM(REV_GAIN_RIGHT) = r14;

r14 = 1915; DM(COMB1_LENGTH) = r14;
r14 = 2121; DM(COMB2_LENGTH) = r14;
r14 = 2300; DM(COMB3_LENGTH) = r14;
r14 = 2496; DM(COMB4_LENGTH) = r14;
r14 = 2685; DM(COMB5_LENGTH) = r14;
r14 = 2881; DM(COMB6_LENGTH) = r14;

r14 = 0x50711234; DM(COMB1_GAIN) = r14;
r14 = 0x4FD45647; DM(COMB2_GAIN) = r14;
r14 = 0x4F390579; DM(COMB3_GAIN) = r14;
r14 = 0x4EA10120; DM(COMB4_GAIN) = r14;
r14 = 0x4E0Babba; DM(COMB5_GAIN) = r14;
r14 = 0x4D77dead; DM(COMB6_GAIN) = r14;
bit set ustat1 0x1F; /* turn on Flag9 LED */
bit clr ustat1 0x20;
dm(IOSTAT)=ustat1;

done:
rti(db);
bit clr mode1 SRRFH; /* switch back to primary register set */
nop; /* 1 cycle latency for switching to occur */


.endseg;

have fun ;-)

harrystainer
19.03.2005, 04:20 PM
I won't bother quoting what he just wrote but wtf? 8O

wildbill
19.03.2005, 04:28 PM
to further demonstrate my lack of knowledge:

what's compiling?

from what you've all said, it sounds like you use assembly language, or C or C++ or something, which is actually a shorthand for all those 0's and 1's, and then you do something with a compiler.

it sounds like the compiler is what my original question was about - the interpretation of all that raw data.
for instance, does the data refer to sound, graphics, or something else.

is the compiler another program?

are there one's specific to music applications?

are there more compilers than languages? or are there relatively a few of them.

i know i could google this, but it's easier when it comes from a discussion sometimes.

hatembr
19.03.2005, 05:30 PM
From what you've all said, it sounds like you use assembly language, or C or C++ or something, which is actually a shorthand for all those 0's and 1's, and then you do something with a compiler.

correct!


is the compiler another program?


correct.

The compiler, which is also a binary program, takes all the symbolic representation of binary instructions you write, and translates them into binary instructions, compiled into an executable file (EXE, COM, SYS, VXD....) the computer can understand and run.
There is a compiler for C, one for C++, one for ASM, one for Pascal, Delphi etc etc etc.
Every language has its own compiler, because every language has its own and specific semantics and syntax.
If you talk to a chineese guy, you'll need a translator who speaks chineese, same for any other language.


are there one's specific to music applications?

no, music applcations are normal applications that require classic compilers depending on the language they have originally been written in.

For eg. winamp is written in C++, so Nullsoft developers compiled it using a C++ compiler to get that winamp.exe and all its related DLLs and files, same for Cubase or Sonar.


are there more compilers than languages? or are there relatively
a few of them.

there is a compiler for each language, i've never heard of any polyglot compiler :)

i know i could google this, but it's easier when it comes from a discussion sometimes.

i agree :D

Househead
19.03.2005, 06:03 PM
I tried to learn Assembler back on the old amiga days...lasted about 2 weeks

8O 8O

I tried to code amiga demos.... :?

Juho L
19.03.2005, 06:10 PM
I tried to code amiga demos....

Hoho. So you started from the easiest part, eh? Those demos require heaps-o-experience. Usually when starting programming one sohuld not expect anything ground-breaking. Starting from a "Hello world!" program is a wise idea and gradually start adding things. The internet offers tons of tutorials (from lousy to excellent ones) and if you don't like hunting down internet tutorials you can always visit local library or book store.

Househead
19.03.2005, 07:33 PM
I tried to code amiga demos....
Starting from a "Hello world!" program is a wise idea and gradually start adding things

Yes, I learnt the hard way but ended up being a GFX artist for a UK group called Pendle Europa....Those were the days :roll:

wildbill
19.03.2005, 08:24 PM
thanks guys: sounds like an icredible amount of work goes into these things. i'm happy enough to just play around with them after someone else designs them.

dries
19.03.2005, 09:58 PM
I won't bother quoting what he just wrote but wtf? 8O

this code is the answer to his question.


:wink:

acid1
24.03.2005, 07:45 AM
you have all heard of sysex right?

sytem exclusieve?

Timo
24.03.2005, 01:09 PM
you have all heard of sysex right?

sytem exclusieve?

?

But that's MIDI...

dries
28.03.2005, 01:23 PM
you have all heard of sysex right?

sytem exclusieve?

oh yes; and we all know that porsche is a car.

but that's not what this thread is about dude.

DIGITAL SCREAMS
28.03.2005, 02:21 PM
Interesting replies so far guys...thx. However im primarily interested in how they create a specific sonic character using code....i.e. Nords and Virus' sound different.....so how do they do it?

DS

mcoyote
29.03.2005, 05:10 AM
Interesting replies so far guys...thx. However im primarily interested in how they create a specific sonic character using code....i.e. Nords and Virus' sound different.....so how do they do it?

DS

Historically, sound generation hardware in digital instruments was parameterized by simple control software. That is, the hardware that actually generated the line-level signal that we can eventually hear was instructed what to do in basic terms and then triggered.

A sample playback engine pretty much feeds the waveform it's to reproduce -- amplitudes at various frequencies varying over time (a 3D map). Some systems go further to implement compression protocols between storage and the sound hardware, but the idea is the same.

ROMPlers and most full-feartured samplers take this a bit further and the basic output may be further manipulated by effect, envelope, filtering, and other hardware that refactors the sound in the output pipeline to achieve desired results.

For analog synthesizers with digital controls (DX7, D50, etc.) the sound hardware was governed by more general parameters -- e.g. starting frequency and waveform descriptors, wavetable offsets, oscillation and modulation settings, etc. -- and these were organized into patches.

These approaches are somewhat old-fashioned, however, by the standards of modern DAWs and VA-type sound modules.

Basically, even as late as a few years ago, commodity DSPs in sound modules and CPUs in conventional computers didn't have the memory or the muscle (in terms of clock cycles or bandwidth among componentry) to abritrarily manipulate sound in "real time".

I.e., if you wanted purely digital tracks solely from a normal computer they could only be set up in advance, rendered in batches into digital audio formats, and them played back but with no useful control of sonic properties during that playback.

Now, however, not only can conventional computers generate a plausible, complete waveform directly from math expressed in common programming languages, but these waveforms can be completely rendered into a routeable signal with no significant delay.

Additionally, the input from hardware and software control metaphors (e.g., MIDI-based control surfaces or VST-type effects plug-ins) can be factored into waveform generation inline, enabling a conventional computer to work as a performance tool.

(...That doesn't mean it doesn't require practice, but we know that...)

So now if a sound module designer needs to support a wide variety of extensible sound generation techniques, they don't need custom-made, impossible-to-update, integrated circuits dedicated to each approach on board.

To achieve their goals, they can just play math games until they find a set of algorithms that work well together with a useful abundance of adjustable variables to produce interesting sounds.

Either that, or they take sounds which are already cool for one reason or another and examine them carefully using hardware or software analysis tools, constructing algorithms that may produce waveforms with the same qualities.

Whatever mechanism is used, these days it's largely just software. C or C++, assembly, even Java can be set up to produce complete waveforms (amplitides within a range of frequencies) from mathematical expressions fast enough that a useable signal may be had almost instantly.

The upshot is that you can create sounds with tremendously sophisticated properties.

The downside, if you will, is that when the actual sound generation was in the hands of hardware under a lesser degree of control, the sound designer just had to do their best to roll with the peculiarities of that hardware. Now they are responsible for almost the whole thing.

In many cases the skill of the device designer can be seen not in an abundance of algorithm parameters available to the musician but the availability of the few most critical direct or derived (i.e., parameters that control others) ones needed to be as expressive as possible.

If you do it on a normal computer, it's a DAW. Do it in a sound module with a dedicated, high-speed bus (the communications medium interconnecting its parts) and ultra-fast, high-end waveform and effects rendering hardware and you have the same idea made more useful.

Plus, you average high-end sound module (like a Virus, Nord, etc.) has snazzy control surfaces that facilitates creativity and is usually solid state -- nothing moving around inside like a hard drive -- so it's more likely to endure in a production or peformance environment.