[PD] iemmatrix - "rotate" matrix

IOhannes m zmoelnig zmoelnig at iem.at
Tue Jul 9 09:50:21 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-07-09 03:14, João Pais wrote:
> Hello,
> 
> I'm programming a gui for [mtx_mul~], and it's almost finished.
> One

the one and only proper way to do signal matrix multiplication with
"iemmatrix" is to use [mtx_*~] (rather than [mtx_mul~],
[mtx_mul_line~] or [matrix~]).

> thing is missing, and I wanted to know if someone already has a
> solution for it, before I break my head trying to find one.
> 
> I need to find a way to "rotate" matrixes, in order to coordenate
> the controler display, and matrix's format. Following the logic of
> max's matrixctrl object, and an usual DAW's display of audio
> matrixes, the lines are the inputs, and the columns are the
> outputs. But, Pd's [matrix] practise is the opposite.

the original matrix-multiplication object had this notation, but it
was deprecated because you will find virtually no literature that does
it like this.

[mtx_*~] follows the notation you will find in pretty much any
scientific publication, that deals with matrix multiplication of signals:
  y = A * x
with x = input signals, A = matrix, y = output signals.

if you want to matrix 4 inputs into 2 outputs, your matrix must look like:
  [2,N] = [2,4] * [4,N]
    out  =   A   *   in
  see http://en.wikipedia.org/wiki/Matrix_multiplication
(for the sake of simplicity N would be one, though in practice it's
the blocksize=64; anyhow, we can pretty much ignore it).

as you can see, this is a matrix with 2 lines and 4 columns.

(the original matrix multiplication object had reversed the
multiplication (y = x * A) which nicely gave you A=[4,2], but was so
uncommon a notation, that i found all of my collegues constantly
looking up the help-patches when their code would not work - esp. when
using square matrices)


whether this matches the DAW experience or not, is something else.
in order to transform an [m,n] matrix into an [n,m] matrix, you can
simply apply a "transpose" operation.
  see http://en.wikipedia.org/wiki/Transpose

be careful with your wording in matrix world: pretty much everything
is standardized and traditional (like the "proper" way to multiply a
bunch of signals by a matrix - the reason why [mtx_*~] behaves as it
does).
"matrix rotation" usually means something along the lines of
mulitplying a coordinate set with a special matrix in order to achieve
a spatial rotation of the coordinates:
 http://en.wikipedia.org/wiki/Matrix_rotation


fgamsdr
IOhannes



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlHbwLkACgkQkX2Xpv6ydvQ5QwCfTTm9+VK0KEMm32QQIowCaecq
DPUAn07SmN3Ib2ZcGlW5tLoQSRE4CvMm
=3MSv
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list