Subject: MAX Digest - 28 Feb 1999 to 1 Mar 1999 (#1999-69)
Date: Tue, 2 Mar 1999 00:00:01 -0500
From: Automatic digest processor 
Reply-To: MAX - Interactive Music/Multimedia Standard Environments
     
To: Recipients of MAX digests 

There are 7 messages totalling 455 lines in this issue.

Topics of the day:

  1. fft-ifft
  2. Ticks into Date to determine Seed into Random
  3. new bomb object
  4. powerglove
  5. expletive deleted (ie crash)
  6. Electronic live concert - WebCast (8 Mar 1999)
  7. CD object

----------------------------------------------------------------------

Date:    Mon, 1 Mar 1999 00:16:37 -0800
From:    dudas 
Subject: fft-ifft

Recently Mats Claesson and Joachim Gossmann have had some questions about
fft/ifft patches.

It is true that dealing with the "raw data" that the fft~ emits is not very
fun.  And, yes, the principal patches available are basically just the
cross-convolution, etc... examples in the msp tutorial.

I think the first obstacle to overcome is the fact that fft~ outputs "real"
and "imaginary" values for each frequency band, and this is not instantly
meaningful, musically speaking...  The first thing that you need to do is
convert this information into amplitude (magnitude) and phase values.  the
amplitude conversion is simple and is easily found in the cross convolution
examples that come with MSP:

amp = sqrt(real*real +imag*imag)

getting the phase values is slightly more tricky, because it requires the
arctangent function (which is not yet a standard part of the MSP object
package):

phase = atan(imag/real)

(usually one uses the C function: atan2(imag, real), because it makes
provisions for the case where real = 0 by turning it into pi or -pi as
appropriate)

an arctan2~ object already exists as part of IRCAM's jimmies or ISPW
compatibility library or something, but it's a real brain-dead thing to
program, so if you can program MSP objects, you can whip one up yourself in
about two minutes by modifying the "plus~" code example that comes with MSP.

OK, so we've converted our real/imaginary to amplitude/phase.

Some cool things you can do with this info:

filter out parts of the spectrum based on the AMPLITUDE of that part of the
spectrum (by using the <~ or >~ obejcts) or do some kind of automatic
panning based on the PHASE of the fft bins! (you might need to divide by
3.14 or by 6.28 or something) Cort Lippe did something like this once upon
a time, I think.

To convert back to real/imaginary values for the ifft~ object, you need to
do this:

real = amp * cos(phase)
imag = amp * sin(phase)

here's a pach which shows you how to do all of this - it's not a very
useful patch, but it gives you all the practical information you need to
start playing with the fft~ object's output (provided you have an atan2
object of some kind...) -- also, note how the sine and cosine functions can
efficiently be done by using the right inlet of the cycle~ obejct:

-------------------
max v2;
#N vpatcher 63 74 851 621;
#P flonum 326 396 35 9 0 0 0 3;
#P newex 326 419 27 196617 sig~;
#P flonum 525 506 69 9 0 0 0 3;
#P flonum 451 506 69 9 0 0 0 3;
#P user number~ 364 506 426 521 9 3 3 2 0. 0. 0 0. 250 0.;
#P user number~ 298 506 360 521 9 3 3 2 0. 0. 0 0. 250 0.;
#P newex 326 441 68 196617 /~ 6.283184;
#P newex 525 463 69 196617 expr sin($f1);
#P newex 451 463 71 196617 expr cos($f1);
#P newex 392 463 44 196617 +~ 0.75;
#P newex 364 484 38 196617 cycle~;
#P newex 298 484 38 196617 cycle~;
#P comment 99 382 14 196617 X;
#P comment 245 382 14 196617 Y;
#P comment 200 70 14 196617 Y;
#P user number~ 257 208 319 223 9 3 3 2 0. 0. 0 0. 250 0.;
#P newex 257 171 49 196617 arctan2~;
#P newex 490 85 27 196617 t b f;
#P flonum 633 240 55 9 0 0 0 3;
#N vpatcher 30 45 426 470;
#P newex 80 237 55 196617 + 3.14159;
#P newex 80 327 55 196617 * 6.28318;
#P newex 80 305 27 196617 - 1.;
#P newex 80 260 55 196617 / 6.28318;
#P newex 80 282 27 196617 t f i;
#P newex 102 144 27 196617 - 1;
#P newex 102 123 27 196617 * 2;
#P newex 102 101 27 196617 > 0.;
#P newex 80 186 32 196617 * 1.;
#P newex 80 145 20 196617 t b;
#P message 80 167 45 196617 3.14159;
#P inlet 263 39 13 0;
#P newex 263 63 27 196617 t f f;
#P newex 280 115 55 196617 * 3.14159;
#P newex 280 89 27 196617 < 0.;
#P newex 79 58 165 196617 if $f1 == 0. then out2 $f1 else $f1;
#P inlet 79 38 15 0;
#P newex 80 356 55 196617 - 3.14159;
#P outlet 80 387 15 0;
#P newex 174 180 27 196617 + 0.;
#P newex 174 153 95 196617 expr atan($f2/$f1);
#P connect 4 0 5 0;
#P connect 5 1 11 0;
#P connect 11 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 20 0;
#P connect 1 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 16 0;
#P connect 16 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 3 0;
#P connect 3 0 2 0;
#P connect 16 1 18 1;
#P connect 9 0 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 12 1;
#P connect 5 0 0 0;
#P connect 0 0 1 0;
#P connect 7 0 1 1;
#P connect 8 0 0 1;
#P connect 9 0 8 0;
#P connect 8 1 6 0;
#P connect 6 0 7 0;
#P pop;
#P newobj 633 201 41 196617 p atan2;
#P newex 34 338 27 196617 *~;
#P user number~ 34 382 96 397 9 3 3 2 0. 0. 0 0. 250 0.;
#P newex 51 314 29 196617 cos~;
#P flonum 675 320 70 9 0 0 0 3;
#P flonum 617 344 35 9 0 0 0 3;
#P user number~ 193 208 255 223 9 3 3 2 0. 0. 0 0. 250 0.;
#P user ezdac~ 13 39 57 72 64;
#P comment 653 345 100 196617 angle in degrees;
#P comment 575 124 14 196617 Y;
#P comment 468 124 14 196617 X;
#P comment 579 264 125 196617 theta (angle in pi-radians);
#P comment 461 264 35 196617 radius;
#P newex 402 201 115 196617 expr sqrt(($f1*$f1) + ($f2*$f2));
#P flonum 402 124 62 9 0 0 0 3;
#P flonum 507 124 65 9 0 0 0 3;
#P flonum 402 264 57 9 0 0 0 3;
#P newex 523 201 105 196617 expr atan2($f2\\\,$f1);
#P flonum 523 264 55 9 0 0 0 3;
#P newex 617 287 80 196617 / 3.141593;
#P newex 617 317 39 196617 * 180.;
#P newex 475 321 58 196617 expr $f1 * sin($f2);
#P flonum 475 382 69 9 0 0 0 3;
#P flonum 402 382 69 9 0 0 0 3;
#P newex 402 321 60 196617 expr $f1 * cos($f2);
#P comment 386 382 14 196617 X;
#P comment 546 382 14 196617 Y;
#P flonum 164 69 35 9 0 0 0 3;
#P flonum 116 69 35 9 0 0 0 3;
#P user number~ 182 382 244 397 9 3 3 2 0. 0. 0 0. 250 0.;
#P user number~ 116 382 178 397 9 3 3 2 0. 0. 0 0. 250 0.;
#P user number~ 264 264 326 279 9 3 3 2 0. 0. 0 0. 250 0.;
#P user number~ 25 264 87 279 9 3 3 2 0. 0. 0 0. 250 0.;
#P comment 255 249 100 196617 angle/phase (0 to 1);
#P newex 133 314 38 196617 cycle~;
#P newex 182 231 68 196617 /~ 6.283184;
#P newex 116 338 27 196617 *~;
#P newex 227 290 44 196617 +~ 0.75;
#P newex 199 314 38 196617 cycle~;
#P newex 182 338 27 196617 *~;
#P newex 182 171 39 196617 atan2~;
#P newex 116 191 29 196617 *~;
#P newex 147 191 27 196617 *~;
#P newex 116 231 33 196617 sqrt~;
#P comment 16 246 85 196617 radius/amplitude;
#P newex 116 124 27 196617 sig~;
#P newex 164 124 27 196617 sig~;
#P comment 8 15 371 196622 real/imaginary to amplitude/phase and back again;
#P comment 125 54 78 196617 real \, imaginary;
#P comment 101 70 14 196617 X;
#P comment 5 194 109 196617 amp = sqrt(X^2 + Y^2);
#P comment 270 191 90 196617 phase = atan(y/x);
#P comment 678 203 80 196617 <-- here's the long way to do it;
#P comment 26 400 58 196617 (using cos~ object);
#P comment 129 400 40 196617 using cycle~;
#P comment 222 339 85 196617 X = a*cos(theta) \, Y = a*sin(theta);
#P comment 227 71 159 196617 In this patch \, the "arctan2~" object is part
of the Ircam ISPW compatibility lib \, and the atan2~ object is a quick
hack based on the MSP plus~ example code... and it actually works!! (you
might not have these objects...);
#P comment 289 38 100 196617 c1999 \, Xoaz Dudas;
#P comment 185 460 100 196617 this shows how cycle~ can be used to
efficiently compute the sine and coseine functions -->;
#P comment 421 22 171 196617 this patch shows the same calculation in both
the signal world of MSP and the event world of Max.;
#P connect 16 0 27 0;
#P connect 16 0 58 0;
#P connect 58 0 57 0;
#P connect 24 0 56 0;
#P connect 56 0 58 1;
#P connect 31 0 14 0;
#P connect 14 0 18 0;
#P connect 17 0 16 0;
#P connect 18 0 16 0;
#P connect 16 0 23 0;
#P connect 23 0 29 0;
#P connect 25 0 23 1;
#P connect 14 0 18 1;
#P connect 13 0 17 0;
#P connect 24 0 25 1;
#P connect 32 0 13 0;
#P connect 13 0 17 1;
#P connect 14 0 19 0;
#P connect 19 0 24 0;
#P connect 16 0 20 0;
#P connect 20 0 30 0;
#P connect 19 0 53 0;
#P connect 21 0 20 1;
#P connect 13 0 19 1;
#P connect 24 0 22 0;
#P connect 22 0 21 1;
#P connect 13 0 62 0;
#P connect 62 0 63 0;
#P connect 24 0 28 0;
#P connect 14 0 62 1;
#P connect 67 0 73 0;
#P connect 78 0 77 0;
#P connect 77 0 72 0;
#P connect 72 0 67 1;
#P connect 68 0 74 0;
#P connect 72 0 69 0;
#P connect 69 0 68 1;
#P connect 31 0 45 0;
#P connect 61 0 45 0;
#P connect 45 0 46 0;
#P connect 46 0 43 0;
#P connect 43 0 35 0;
#P connect 35 0 36 0;
#P connect 78 0 70 0;
#P connect 70 0 75 0;
#P connect 41 0 35 1;
#P connect 46 0 38 0;
#P connect 38 0 37 0;
#P connect 32 0 61 0;
#P connect 61 1 44 0;
#P connect 44 0 46 1;
#P connect 45 0 42 0;
#P connect 42 0 41 0;
#P connect 41 0 38 1;
#P connect 78 0 71 0;
#P connect 71 0 76 0;
#P connect 41 0 40 0;
#P connect 40 0 39 0;
#P connect 39 0 54 0;
#P connect 44 0 42 1;
#P connect 45 0 59 0;
#P connect 59 0 60 0;
#P connect 44 0 59 1;
#P connect 40 0 55 0;
#P pop;
----------------------------------

There's a tiny bit more:

Many programs that process spectral data, such as Csound, Soundhack or
Audiosculpt, make use of something called the "instantaneous frequency" (or
"phase derivative") to preform transposition, frequency shifting and other
fun filtering and cross-synthesis effects.  The "instantaneous frequency"
is based on the difference in phase between two successive FFT frames, so
it's difficult to calculate in MSP where you usually have two or more fft~
objects calculating successive frames... ('fft~ 512 512 0' and 'fft~ 512
512 256').  In theory it would be possible to temporarily store the fft
phase into a buffer~ to somehow make this calculation... I don't know if
anyone has ever tried and succeeded...

-R

------------------------------

Date:    Mon, 1 Mar 1999 10:34:56 -0800
From:    David Zicarelli 
Subject: Re: Ticks into Date to determine Seed into Random

I think the subject of this message would make a nice
line in a poem.

Anyway, psuedorandom number generators work by successive
multiplications that overflow a 32-bit number so it wraps around
to a lower value.

So any number that it is 2 to the 31 or so (which is the
biggest number you can represent in Max anyway) will
work as a seed. The seed message merely sets the previously
generated random number. It will do its multiplication
by a certain special number on the seed to generate the
next random number.

David Z.

------------------------------

Date:    Mon, 1 Mar 1999 14:53:00 EST
From:    Scott Draves 
Subject: new bomb object

I have made another release of the Bomb visual-music max object.

This one includes more documentation, examples, and bug fixes.  In
particular it has installation instructions (in the file manual.txt),
and instructions on how to change the image database (in the
tutorial), and a way of storing presets.

http://www.cs.cmu.edu/~spot/bomb.html

i would like to know if this release is working or not, so if you
download it please send me email with the results (either positive or
negative). thanks.

------------------------------

Date:    Mon, 1 Mar 1999 15:14:06 -0500
From:    David Bianciardi 
Subject: Re: powerglove

Automatic digest processor wrote on 2/27/99 12:00 AM:

>           2.  Is there an alternative?

i sold a bunch (have no more, also sold my goldbrick to someone else) of
gloves to Emmanuel Flety at IRCAM Emmanuel.Flety@ircam.fr a while ago.
he said he was in the process of making an interface box for them.  i
believe he was stripping the onboard A/D and just grabbing the analog
signal from the flex sensors.  not sure what he's doing about the xyz
ultrasonics.

emmanuel...you out there?

David Bianciardi
tech@idrc.com

212.353.9087
212.353.3947 fax
___________________________________________________________
IDRC || 415 Lafayette St || 2nd floor || NYC, NY 10003-7000

#include 

------------------------------

Date:    Mon, 1 Mar 1999 23:50:45 +0100
From:    Jean Paul Laurent 
Subject: Re: expletive deleted (ie crash)

On 24 Feb 1999, david stevens wrote:

>oh xxxxxxxxx
>
>several days since my last backup - and max just crashed during a save
>operation, which of course has screwed up my patcher (it doesn't load all
the
>way any more).
>
>i have a collectivised version that i made this morning, which ofcourse has
all
>my latest changes and improvements in it, which I can open in Max, but not
>unlock. so the question is, is there a way to unlock a collectivised
patcher?
>
>or do i have to remember what changes i made over the last few days?

I had the same problem last year.
David Zicarelli gave the solution on the list on 11 March 1998:

- - - - - - - - - - - - - - - - - - - - - - -

<<
There is a way to get patchers back
from collectives and standalones (which have the same information
as collectives). The program I would use for this task is
Resorcerer.

If you open a collective/application in Resorcerer, you will find a
bunch of named resources of type 'maxb'--these are the patches
that make up your collective stored as resources. The names
of the resources correspond to the original names of the patchers.
Open a 'maxb' resource with the hex editor and copy all of the text.
Then make a new file. It will show a  0 in it. Open this...
it's the data fork of the file. Position the cursor at the
beginning (there should be no data in it), and paste all of the hex
data you copied from the 'maxb' resource. Finally, choose File
Info from the File menu and set the new file's type to 'maxb'
and the creator to 'max2'. Now you should be able to open this
as a patcher file in Max.

It's possible that you had text-based patcher files, in which
case you can just open the 'TEXT' resource with the desired
name and copy the text out, then paste into your favorite text
editor.

David Z.
>>

- - - - - - - - - - - - - - - - - - - - - - -

------------------------------

Date:    Tue, 2 Mar 1999 10:58:31 +1000
From:    David Rodger 
Subject: Re: Electronic live concert - WebCast (8 Mar 1999)

Karlheinz Essl wrote:
>The composers Richard Barrett and Karlheinz Essl will perform an electronic
>live concert with improvisations at the "rhiz" in Vienna together with the
>e-guitar player Daryl Buckley from the Australian ELISION ensemble. The
>concert will be broadcasted live on the Internet.

Gosh.  I'll have to listen in (if I can get RealAudio re-installed).  I
didn't know Daryl had taken up electric or electronic guitar.

For those who don't know Elision's work, I heartily recommend checking this
out.

Regards, David

David Rodger ------------------------ auricle@alphalink.com.au
Motion Capture on Music  ------- farben.latrobe.edu.au/motion/
Ghanaian Music and Dance ------- www.alphalink.com.au/~adzohu/
==============================================================
I've noticed that people who complain about their imaginations
being stifled or  straightjacketed by some convention or other
are generally easily stifled, mainly due to the fact that they
don't have a lot of imagination to begin with... -- Mark Simon

------------------------------

Date:    Mon, 1 Mar 1999 16:05:34 -0800
From:    David Zicarelli 
Subject: CD object

I believe the source of the trouble with certain machines
and the CD object, including the reliable access of multiple
drives (SCSI + ATAPI) has been located and I am going to be
fixing this in the next day or so. Please remain calm.

David Z.

------------------------------

End of MAX Digest - 28 Feb 1999 to 1 Mar 1999 (#1999-69)
********************************************************