aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-03-09 03:51:28 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-03-09 03:51:28 +0000
commit50a389bea35a91ddae1394c5d35a6f1c703f5bdd (patch)
tree345af9da1a2432cdde199637af884d0cb744cf40
parent6f58df1602bc981858c874a55c73dab0e76258cc (diff)
Checked in Olaf's 1.5.2 sources. Here are the changes:
v 1.5.2 (17. december 2003): - modified netclient for not to drop received data: use of syspollfn instead of clock to poll for incoming data, circular recv buffer v 1.5 (18. october 2003): - added some usefull features to arraycopy (i.e. copying just parts of an array and copying to specified position in destination array) - new object: nchange - IRIX 6.5 port (for GCC 3.3) - OS X binary (Jaguar 10.2.6) v 1.4 (22. may 2003): - updated sources to compile with Pd0.37-test4 - new object: arraycopy v 1.3 (12. april 2003): - new objects: sync listfifo - all setup routines renamed to maxlib_<object>_setup() to avoid name clashes, old names still work via class_addcreator() - some improvements for the help files svn path=/trunk/externals/maxlib/; revision=1394
-rw-r--r--HISTORY175
-rw-r--r--README2
-rw-r--r--help/automata.txt356
-rw-r--r--help/examplescore.txt48
-rw-r--r--help/help-maxlib.pd242
-rw-r--r--makefile150
-rw-r--r--maxlib.c30
-rw-r--r--src/allow.c14
-rw-r--r--src/arbran.c27
-rw-r--r--src/arraycopy.c26
-rw-r--r--src/beta.c18
-rw-r--r--src/chord.c4
-rw-r--r--src/deny.c14
-rw-r--r--src/expo.c10
-rw-r--r--src/fifo.c2
-rw-r--r--src/gestalt.c3
-rw-r--r--src/lifo.c2
-rw-r--r--src/linear.c10
-rw-r--r--src/listfifo.c2
-rw-r--r--src/mlife.c2
-rw-r--r--src/nchange.c2
-rw-r--r--src/netclient.c184
-rw-r--r--src/netrec.c4
-rw-r--r--src/netserver.c4
-rw-r--r--src/nroute.c92
-rw-r--r--src/pitch.c2
-rw-r--r--src/plus.c2
-rw-r--r--src/poisson.c10
-rw-r--r--src/pong.c14
-rw-r--r--src/pulse.c2
-rw-r--r--src/remote.c2
-rw-r--r--src/rewrap.c2
-rw-r--r--src/rhythm.c3
-rw-r--r--src/score.c2
-rw-r--r--src/step.c2
-rw-r--r--src/subst.c2
-rw-r--r--src/sync.c2
-rw-r--r--src/temperature.c2
-rw-r--r--src/tilt.c2
-rw-r--r--src/triang.c10
-rw-r--r--src/unroute.c2
-rw-r--r--src/urn.c8
42 files changed, 826 insertions, 666 deletions
diff --git a/HISTORY b/HISTORY
index b878d2b..c90963f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,79 +1,100 @@
version history of maxlib library for pure-data
-v 1.2 (27.january 2003):
-- new objects: unroute urn split wrap rewrap timebang
-- another fix for the makefile
-- fixed a bug in netserver (sockets remained open when netserver closed)
-- added a 'prepend' option (with additional creation argument) to remote,
- patch was supplied by Maurizio Umberto Puxeddu
-
-v 1.1b2 (23. oktober 2002):
-- corrected two small bugs in the makefile (linux only!), thanks to
- Hans-Christoph Steiner
-
-v 1.1b (12. september 2002):
-- new object: limit
-- match and speedlim have been replaced with the objects from cyclone library
-- deleted the (unwanted) debugging printout from nroute
-
-v 1.1 (26. august 2002):
-- new objects: nroute, pong, edge
-- arbran 0.1b now allows to (re-)set the arrays dynamically
-- match 0.3 now matches any type of data (floats, lists, symbols, anything)
-- scale 0.2 allows to dynamically change the creation arguments and to choose
- between linear (default) and exponential scale
-- MSVC++ workspace contains configuration for Intel Compiler with Pentium 4
- optimizations ("maxlib - Win32 Intel")
-- makefile and binary release for Mac OS X (10.1.5)
-- BUG FIX: corrected path to helpfiles in rand objects
-- BUG FIX: corrected makefile to work under Linux again
-
-v 1.0 (9th august 2002):
-- new objects: netserver, netclient, arbran, beta, bilex, cauchy, expo,
- gauss, linear, poisson, triang, weibull
-- the help patches now live in doc/5.reference/maxlib, thanks to
- Frank Barknecht for suggesting that and for modifying the sources
-
-v 0.9 (25th july 2002):
-- new objects: tilt gestalt temperature
-
-v 0.8b (21st july 2002):
-- now compiles on Linux, thanks to Martin Pi
-- new objects: listfunnel
-
-v 0.8 (4th july 2002):
-- new objects: history netrec scale delta velocity
-- some small changes to speedlim
-
-v 0.7 (24th june 2002):
-- fixed a bug in average, thanks to Joćo Miguel Pais
-- new chord algorhythm: supports up to 67 chord types now
-
-v 0.6 (7th june 2002):
-- added objects: beat rhythm
-
-v 0.5 (28th mai 2002):
-- added objects: netdist mlife subst
-- netdist uses the pthreads-win32 library for POSIX multithreading
- under NT, thus at least pd0.35-test17 is needed under NT
-- made a MSVC++ 6.0 project file
-
-v 0.4 (16th mai 2002):
-- match now also takes lists of floats
-- added objects: dist remote step
-
-v 0.3b (14th mai 2002):
-- fixed a zero-division bug in pulse, thanks to Frank Barknecht
-
-v 0.3 (13th mai 2002):
-- added objects: divmod, fifo, iso, lifo, pulse
-- made divide, minus, multi & plus 'multi-inlet-ready'
-
-v 0.2 (7th mai 2002):
-- added objects: average, chord, score
-
-v 0.1b (24th apr. 2002):
-- added objects: divide, minus, multi, plus
-
-v 0.1a (15th apr. 2002, first public release):
-- included objects: borax, ignore, match, pitch, speedlim \ No newline at end of file
+v 1.5.2 (17. december 2003):
+- modified netclient for not to drop received data: use of syspollfn
+ instead of clock to poll for incoming data, circular recv buffer
+
+v 1.5 (18. october 2003):
+- added some usefull features to arraycopy (i.e. copying just parts of
+ an array and copying to specified position in destination array)
+- new object: nchange
+- IRIX 6.5 port (for GCC 3.3)
+- OS X binary (Jaguar 10.2.6)
+
+v 1.4 (22. may 2003):
+- updated sources to compile with Pd0.37-test4
+- new object: arraycopy
+
+v 1.3 (12. april 2003):
+- new objects: sync listfifo
+- all setup routines renamed to maxlib_<object>_setup() to avoid name
+ clashes, old names still work via class_addcreator()
+- some improvements for the help files
+
+v 1.2 (30. january 2003):
+- new objects: unroute urn split wrap rewrap timebang
+- another fix for the makefile
+- fixed a bug in netserver (sockets remained open when netserver closed)
+- added a 'prepend' option (with additional creation argument) to remote,
+ patch was supplied by Maurizio Umberto Puxeddu
+
+v 1.1b2 (23. oktober 2002):
+- corrected two small bugs in the makefile (linux only!), thanks to
+ Hans-Christoph Steiner
+
+v 1.1b (12. september 2002):
+- new object: limit
+- match and speedlim have been replaced with the objects from cyclone library
+- deleted the (unwanted) debugging printout from nroute
+
+v 1.1 (26. august 2002):
+- new objects: nroute, pong, edge
+- arbran 0.1b now allows to (re-)set the arrays dynamically
+- match 0.3 now matches any type of data (floats, lists, symbols, anything)
+- scale 0.2 allows to dynamically change the creation arguments and to choose
+ between linear (default) and exponential scale
+- MSVC++ workspace contains configuration for Intel Compiler with Pentium 4
+ optimizations ("maxlib - Win32 Intel")
+- makefile and binary release for Mac OS X (10.1.5)
+- BUG FIX: corrected path to helpfiles in rand objects
+- BUG FIX: corrected makefile to work under Linux again
+
+v 1.0 (9th august 2002):
+- new objects: netserver, netclient, arbran, beta, bilex, cauchy, expo,
+ gauss, linear, poisson, triang, weibull
+- the help patches now live in doc/5.reference/maxlib, thanks to
+ Frank Barknecht for suggesting that and for modifying the sources
+
+v 0.9 (25th july 2002):
+- new objects: tilt gestalt temperature
+
+v 0.8b (21st july 2002):
+- now compiles on Linux, thanks to Martin Pi
+- new objects: listfunnel
+
+v 0.8 (4th july 2002):
+- new objects: history netrec scale delta velocity
+- some small changes to speedlim
+
+v 0.7 (24th june 2002):
+- fixed a bug in average, thanks to Joćo Miguel Pais
+- new chord algorhythm: supports up to 67 chord types now
+
+v 0.6 (7th june 2002):
+- added objects: beat rhythm
+
+v 0.5 (28th mai 2002):
+- added objects: netdist mlife subst
+- netdist uses the pthreads-win32 library for POSIX multithreading
+ under NT, thus at least pd0.35-test17 is needed under NT
+- made a MSVC++ 6.0 project file
+
+v 0.4 (16th mai 2002):
+- match now also takes lists of floats
+- added objects: dist remote step
+
+v 0.3b (14th mai 2002):
+- fixed a zero-division bug in pulse, thanks to Frank Barknecht
+
+v 0.3 (13th mai 2002):
+- added objects: divmod, fifo, iso, lifo, pulse
+- made divide, minus, multi & plus 'multi-inlet-ready'
+
+v 0.2 (7th mai 2002):
+- added objects: average, chord, score
+
+v 0.1b (24th apr. 2002):
+- added objects: divide, minus, multi, plus
+
+v 0.1a (15th apr. 2002, first public release):
+- included objects: borax, ignore, match, pitch, speedlim
diff --git a/README b/README
index b270f04..b1afdc3 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-maxlib - music analysis extensions library, version 1.2
+maxlib - music analysis extensions library, version 1.5.2
copyright (c) 2002-2003 by Olaf Matthes
maxlib is a library of non-tilde externals for pd (by Miller Puckette).
diff --git a/help/automata.txt b/help/automata.txt
index afa5e9e..3f5ff21 100644
--- a/help/automata.txt
+++ b/help/automata.txt
@@ -1,178 +1,178 @@
-[The following note originally appeared on the emusic-l mailing list. It is
-reprinted here with the author's permission]
-
-From xrjdm@FARSIDE.GSFC.NASA.GOV Wed Nov 23 11:26:39 1994
-Date: Tue, 4 Oct 1994 15:09:23 -0500
-From: Joe McMahon <xrjdm@FARSIDE.GSFC.NASA.GOV>
-Reply to: Electronic Music Discussion List <EMUSIC-L@AMERICAN.EDU>
-To: Multiple recipients of list EMUSIC-L <EMUSIC-L@AMERICAN.EDU>
-Subject: Automata: the long-awaited summary
-
-Back in August, I think, I promised to post a quick intro to cellular
-automata and how they can be used as a sound-generation tool. Since I'm
-going to take a couple of different sources and sum them up with little or
-no direct attribution, combined with my own opinions, I'll give everybody
-my references *first* so they can delete the article and draw their own
-conclusions if they so prefer.
-
-The primary reference that got me started on all this is one in the CMJ:
-Vol 14, No. 4, Winter 1990: "Digital Synthesis of Self-modifying Waveforms
-by Means of Cellular Automata" (Jacques Chareyon). Those who are already
-familiar with automata may just skip to that article and forget about the
-rest of this one.
-Note: the article gives a mail address for M. Chareyon, but he did not
-answer an inquiry about any available recordings using this technique in
-1990.
-
-So. Anyone still here? Good.
-
-Cellular automata are a mathematical concept first introduced in the late
-1940's. Generally speaking, a cellular automaton consists of a grid of
-cells. Each cell may take on any of a number of values - binary automata
-(cell on or cell off) are the most commonly studied. Each cell has a
-neighborhood, defined more simply as other cells which influence its state.
-The exact nature of this influence is defined by what are called transition
-rules. The cellular automaton starts off with some cells in any of the
-allowable states. for each "step" in the automaton's history, the
-neighborhood of every cell is checked, and the state of the cell is
-updated. All updates occur simultaneously.
-
-The transition rule must describe the resulting state of a cell for every
-possible configuration of other cells in the neighborhood. For large
-numbers of states, the amount of memory required to hold the transition
-rule becomes increasingly large, Therefore, some automata use what is known
-as a "totalistic" rule. These rules simply sum the values of the cells in
-the neighborhood and then assign a result on this basis. The resulting
-tables are far smaller.
-
-Many readers may already be familiar with John Horton Conway's game of
-"Life". This is a two-dimensional binary automaton with a totalistic rule.
-This makes for a very small rule set:
-
- i) If fewer than two filled cells (cells with value 1) surround a cell,
- it becomes empty next generation.
- ii) If more than three filled cells surround a cell, it becomes empty
- next generation.
-iii) If exactly three cells filled cells surround a cell, it becomes
- filled on the next generation.
-
-This corresponds to a totalistic rule set with a total of 8(2-1)+1 or 9
-rules (one each for the sum values of 0 (no cells with a value) through 9
-(all cells with a value) ).If the transition rule were represented as a
-non-totalistic one, the rule set would need 2**8 or 256 entries. There are
-many interesting totalistic automata, so giving up detailed description of
-every nuance of the transitions to save memory space isn't a big sacrifice.
-
-Interesting as two dimensional automata are, they really aren't terribly
-useful for music making. There have been some experiments which have
-attempted to use a two-dimensional automaton to generate MIDI events -
-synthesis at the note level, using :
-
-Battista, T. and M. Giri, 1988. "Composizione Tramite Automi Cellulari."
-Atti del VII Cooloquio di Informatica Musicale. Rome, Italy: Edizione Arti
-Grafiche Ambrosini, pp. 181-182.
-
-Edgar, R. and J. Ryan, 1986. "LINA" Exhibition of the 1986 International
-Computer Music Conference, San Francisco: Computer Music Association.
-
-I have not heard any of the music from these efforts, so I certainly can't
-pass any judgement on them. For the purposes of this summary, we'll just
-look at one-dimensional automata. These use a linear array of cells, with
-the neighborhood generally being one or two cells on either side of each
-cell.
-(This is the type of automaton dealt with in M. Chareyon's article, which I
-will be paraphrasing broadly hereafter).
-
-M. Chareyon's automata are wavetables. A digitized signal is stored as a
-linear array of numbers in memory. A totalistic rule is used to determine a
-lookup value which indexes into an array containing the resulting value;
-this is saved into a second array. After the first array is completely
-processed, the roles of the two are swapped and the process is repeated.
-
-The limiting factor in this process is the number of bits of resolution
-being used to generate the sound. For a totalistic rule using a two-cell
-neighborhood and 12-bit individual samples, we have 3*(2*12) = 12288
-entries in the rule table. At 2 bytes each, this is 24K of storage. If we
-go to 16-bit sample resolution, we have 196608 entries at 2 bytes each for
-a total of 393216 bytes, or 384K.
-
-The key point of M. Charyeon's method is the use of small neighborhoods
-with large numbers of cellular states. Since the computation of the new
-wavetable is all table lookup, very complex transition rules can be
-precomputed and loaded into the tables, allowing the synthesis to
-essentially be a fast sum-and-lookup loop to calculate each new wavesample.
->From the article, it appears that M. Chareyon was able to produce 2 or 3
-voices in realtime on a Mac II with a Digidesign Sound Accelerator board.
-It seems that it would probably be possible to use an AV Mac to do it
-without the board.
-
-This LASy (Linear Automaton Synthesis) method is closely related to the
-Karplus-Strong plucked-string algorithm, in that a wavesample is run
-through an algorithm which recirculates the samples to "self-modify" the
-wave. In fact, a judicious choice of table entries allows one to very
-simply simulate the K-S algoritm directly.
-
-So what are the sounds like? Some automata produce waveforms which quickly
-"ramp-up" to complex spectra and then drop off quickly. Others move to a
-steady state and then remain there. Yet others produce never-ending and
-unpredictable waveforms, whose harmonic content is constantly changing.
-
-Obviously enough, the original wavesample can be obtained mathematically,
-or by actual sampling and using LASy as a waveshaper. As M. Chareyon notes,
-a quick estimate of the number of possible automata for a 2-neighbor
-totalistic rule using a 256-entry wavetable with 12-bit entries is
-(2**12)**256 * (2**12)**(3*2**12) or about 10**4500 possible automata. Of
-course, many, many of these would not be suitable for music (e.g., the 4096
-automata in which all values go to one vlaue in one step, etc.); however,
-the number of musically useful automata is still likely to be an immense
-number.
-
-M. Chareyon provides a number of examples of ways to fill out the rule
-tables and a number of hints on creating wave tables - generally speaking,
-one can create a function which is used to compute the values to be placed
-into the table and then fill it so it can simply be loaded and used by the
-basic algorithm. His experience in using LASy is that he manages
-approximately 50% of the time to produce sounds with the desired
-characteristics, and that about 10% of the remaining time he gets
-unexpected but useful results which can be used as starting points for
-further exploration.
-
-Again, the important point is that the basic automaton uses wavesamples at
-full resolution, calculating a new wavesample for each step of the
-automaton; the next wavesample can be played while the new one is being
-calculated. Because of the large number of states, mathematical tools for
-the analysis of automata and the construction of automata with specifically
-desired qualities require too much storage and compute time to make them
-useful for LASy purposes.
-
-Again, much of this article is paraphrased from M. Chareyon's article; I
-take no credit for any of the work in this note. I'm just summarizing.
-
-The following other articles were referenced by M. Chareyon's article:
-
-Burks, A., ed. 1970. Essays on Cellular Automata. Champaign/Urbana, IL:
-University of Illinois Press.
-
-Chareyon, J. 1988a. "Sound Synthesis and Processing by Means of Linear
-Cellular Automata." Proceedings of the 1988 Internation Computer Music
-Conference. San Francisco: Computer Music Association.
-
-Chareyon, J. 1988b. "Wavetable come Automa Cellulare: una Nuova Tecnica di
-Sintesi." Atti del VII Colloquio di Informatica Musicale, Rome, Italy:
-Edizioni Arti Grafiche Ambrosini, pp. 174-177.
-
-Farmer, D., T. Toffoli, and S. Wolfram, eds. 1984. Cellular Automata.
-North-Holland Physics Publishing. [One of the definitive works on cellular
-automata - fairly heavy math, not a popular presentation - JM]
-
-Gardner, M. 1970. "The Fantastic Combinations of John Conway's New Solitare
-Game 'Life'". Scientific American 223(4) 120-123. [A good introduction to
-cellular automata, focusing on 'life' in specific. Useful intro if my
-1-paragraph summary of automata was confusing :) - JM]
-
- --- Joe M.
-
---
-"At the end of the hour, we'll have information on the sedatives used by
-the artists,,," (MST3K)
-
+[The following note originally appeared on the emusic-l mailing list. It is
+reprinted here with the author's permission]
+
+From xrjdm@FARSIDE.GSFC.NASA.GOV Wed Nov 23 11:26:39 1994
+Date: Tue, 4 Oct 1994 15:09:23 -0500
+From: Joe McMahon <xrjdm@FARSIDE.GSFC.NASA.GOV>
+Reply to: Electronic Music Discussion List <EMUSIC-L@AMERICAN.EDU>
+To: Multiple recipients of list EMUSIC-L <EMUSIC-L@AMERICAN.EDU>
+Subject: Automata: the long-awaited summary
+
+Back in August, I think, I promised to post a quick intro to cellular
+automata and how they can be used as a sound-generation tool. Since I'm
+going to take a couple of different sources and sum them up with little or
+no direct attribution, combined with my own opinions, I'll give everybody
+my references *first* so they can delete the article and draw their own
+conclusions if they so prefer.
+
+The primary reference that got me started on all this is one in the CMJ:
+Vol 14, No. 4, Winter 1990: "Digital Synthesis of Self-modifying Waveforms
+by Means of Cellular Automata" (Jacques Chareyon). Those who are already
+familiar with automata may just skip to that article and forget about the
+rest of this one.
+Note: the article gives a mail address for M. Chareyon, but he did not
+answer an inquiry about any available recordings using this technique in
+1990.
+
+So. Anyone still here? Good.
+
+Cellular automata are a mathematical concept first introduced in the late
+1940's. Generally speaking, a cellular automaton consists of a grid of
+cells. Each cell may take on any of a number of values - binary automata
+(cell on or cell off) are the most commonly studied. Each cell has a
+neighborhood, defined more simply as other cells which influence its state.
+The exact nature of this influence is defined by what are called transition
+rules. The cellular automaton starts off with some cells in any of the
+allowable states. for each "step" in the automaton's history, the
+neighborhood of every cell is checked, and the state of the cell is
+updated. All updates occur simultaneously.
+
+The transition rule must describe the resulting state of a cell for every
+possible configuration of other cells in the neighborhood. For large
+numbers of states, the amount of memory required to hold the transition
+rule becomes increasingly large, Therefore, some automata use what is known
+as a "totalistic" rule. These rules simply sum the values of the cells in
+the neighborhood and then assign a result on this basis. The resulting
+tables are far smaller.
+
+Many readers may already be familiar with John Horton Conway's game of
+"Life". This is a two-dimensional binary automaton with a totalistic rule.
+This makes for a very small rule set:
+
+ i) If fewer than two filled cells (cells with value 1) surround a cell,
+ it becomes empty next generation.
+ ii) If more than three filled cells surround a cell, it becomes empty
+ next generation.
+iii) If exactly three cells filled cells surround a cell, it becomes
+ filled on the next generation.
+
+This corresponds to a totalistic rule set with a total of 8(2-1)+1 or 9
+rules (one each for the sum values of 0 (no cells with a value) through 9
+(all cells with a value) ).If the transition rule were represented as a
+non-totalistic one, the rule set would need 2**8 or 256 entries. There are
+many interesting totalistic automata, so giving up detailed description of
+every nuance of the transitions to save memory space isn't a big sacrifice.
+
+Interesting as two dimensional automata are, they really aren't terribly
+useful for music making. There have been some experiments which have
+attempted to use a two-dimensional automaton to generate MIDI events -
+synthesis at the note level, using :
+
+Battista, T. and M. Giri, 1988. "Composizione Tramite Automi Cellulari."
+Atti del VII Cooloquio di Informatica Musicale. Rome, Italy: Edizione Arti
+Grafiche Ambrosini, pp. 181-182.
+
+Edgar, R. and J. Ryan, 1986. "LINA" Exhibition of the 1986 International
+Computer Music Conference, San Francisco: Computer Music Association.
+
+I have not heard any of the music from these efforts, so I certainly can't
+pass any judgement on them. For the purposes of this summary, we'll just
+look at one-dimensional automata. These use a linear array of cells, with
+the neighborhood generally being one or two cells on either side of each
+cell.
+(This is the type of automaton dealt with in M. Chareyon's article, which I
+will be paraphrasing broadly hereafter).
+
+M. Chareyon's automata are wavetables. A digitized signal is stored as a
+linear array of numbers in memory. A totalistic rule is used to determine a
+lookup value which indexes into an array containing the resulting value;
+this is saved into a second array. After the first array is completely
+processed, the roles of the two are swapped and the process is repeated.
+
+The limiting factor in this process is the number of bits of resolution
+being used to generate the sound. For a totalistic rule using a two-cell
+neighborhood and 12-bit individual samples, we have 3*(2*12) = 12288
+entries in the rule table. At 2 bytes each, this is 24K of storage. If we
+go to 16-bit sample resolution, we have 196608 entries at 2 bytes each for
+a total of 393216 bytes, or 384K.
+
+The key point of M. Charyeon's method is the use of small neighborhoods
+with large numbers of cellular states. Since the computation of the new
+wavetable is all table lookup, very complex transition rules can be
+precomputed and loaded into the tables, allowing the synthesis to
+essentially be a fast sum-and-lookup loop to calculate each new wavesample.
+>From the article, it appears that M. Chareyon was able to produce 2 or 3
+voices in realtime on a Mac II with a Digidesign Sound Accelerator board.
+It seems that it would probably be possible to use an AV Mac to do it
+without the board.
+
+This LASy (Linear Automaton Synthesis) method is closely related to the
+Karplus-Strong plucked-string algorithm, in that a wavesample is run
+through an algorithm which recirculates the samples to "self-modify" the
+wave. In fact, a judicious choice of table entries allows one to very
+simply simulate the K-S algoritm directly.
+
+So what are the sounds like? Some automata produce waveforms which quickly
+"ramp-up" to complex spectra and then drop off quickly. Others move to a
+steady state and then remain there. Yet others produce never-ending and
+unpredictable waveforms, whose harmonic content is constantly changing.
+
+Obviously enough, the original wavesample can be obtained mathematically,
+or by actual sampling and using LASy as a waveshaper. As M. Chareyon notes,
+a quick estimate of the number of possible automata for a 2-neighbor
+totalistic rule using a 256-entry wavetable with 12-bit entries is
+(2**12)**256 * (2**12)**(3*2**12) or about 10**4500 possible automata. Of
+course, many, many of these would not be suitable for music (e.g., the 4096
+automata in which all values go to one vlaue in one step, etc.); however,
+the number of musically useful automata is still likely to be an immense
+number.
+
+M. Chareyon provides a number of examples of ways to fill out the rule
+tables and a number of hints on creating wave tables - generally speaking,
+one can create a function which is used to compute the values to be placed
+into the table and then fill it so it can simply be loaded and used by the
+basic algorithm. His experience in using LASy is that he manages
+approximately 50% of the time to produce sounds with the desired
+characteristics, and that about 10% of the remaining time he gets
+unexpected but useful results which can be used as starting points for
+further exploration.
+
+Again, the important point is that the basic automaton uses wavesamples at
+full resolution, calculating a new wavesample for each step of the
+automaton; the next wavesample can be played while the new one is being
+calculated. Because of the large number of states, mathematical tools for
+the analysis of automata and the construction of automata with specifically
+desired qualities require too much storage and compute time to make them
+useful for LASy purposes.
+
+Again, much of this article is paraphrased from M. Chareyon's article; I
+take no credit for any of the work in this note. I'm just summarizing.
+
+The following other articles were referenced by M. Chareyon's article:
+
+Burks, A., ed. 1970. Essays on Cellular Automata. Champaign/Urbana, IL:
+University of Illinois Press.
+
+Chareyon, J. 1988a. "Sound Synthesis and Processing by Means of Linear
+Cellular Automata." Proceedings of the 1988 Internation Computer Music
+Conference. San Francisco: Computer Music Association.
+
+Chareyon, J. 1988b. "Wavetable come Automa Cellulare: una Nuova Tecnica di
+Sintesi." Atti del VII Colloquio di Informatica Musicale, Rome, Italy:
+Edizioni Arti Grafiche Ambrosini, pp. 174-177.
+
+Farmer, D., T. Toffoli, and S. Wolfram, eds. 1984. Cellular Automata.
+North-Holland Physics Publishing. [One of the definitive works on cellular
+automata - fairly heavy math, not a popular presentation - JM]
+
+Gardner, M. 1970. "The Fantastic Combinations of John Conway's New Solitare
+Game 'Life'". Scientific American 223(4) 120-123. [A good introduction to
+cellular automata, focusing on 'life' in specific. Useful intro if my
+1-paragraph summary of automata was confusing :) - JM]
+
+ --- Joe M.
+
+--
+"At the end of the hour, we'll have information on the sedatives used by
+the artists,,," (MST3K)
+
diff --git a/help/examplescore.txt b/help/examplescore.txt
index 78afd45..27002f1 100644
--- a/help/examplescore.txt
+++ b/help/examplescore.txt
@@ -1,25 +1,25 @@
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-71
-70
-69
-68
-67
-66
-65
-64
-63
-62
-61
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+71
+70
+69
+68
+67
+66
+65
+64
+63
+62
+61
60 \ No newline at end of file
diff --git a/help/help-maxlib.pd b/help/help-maxlib.pd
index dfe8564..4beb23d 100644
--- a/help/help-maxlib.pd
+++ b/help/help-maxlib.pd
@@ -1,119 +1,123 @@
-#N canvas 11 6 1106 717 12;
-#X obj 274 260 average;
-#X obj 18 150 beat;
-#X obj 18 175 borax;
-#X obj 18 125 chord;
-#X obj 15 551 dist;
-#X obj 274 155 divide;
-#X obj 274 129 divmod;
-#X obj 599 149 fifo;
-#X obj 274 286 history;
-#X obj 601 503 ignore;
-#X obj 601 477 iso;
-#X obj 598 123 lifo;
-#X obj 274 312 match;
-#X obj 274 180 minus;
-#X obj 600 257 mlife;
-#X obj 274 207 multi;
-#X obj 15 576 netdist;
-#X obj 18 251 pitch;
-#X obj 274 234 plus;
-#X obj 601 425 pulse;
-#X obj 15 600 remote;
-#X obj 18 200 rhythm;
-#X obj 18 225 score array01;
-#X obj 601 451 speedlim;
-#X obj 601 529 step;
-#X obj 600 232 subst;
-#X text 140 44 written by Olaf Matthes <olaf.matthes@gmx.de>;
-#X text 71 125 chord detection;
-#X text 68 150 beat tracking;
-#X text 77 201 beat detection;
-#X text 72 176 music analysis;
-#X text 135 225 score following;
-#X text 72 251 pitch information;
-#X text 19 94 MUSIC / MIDI ANALYSIS;
-#X text 274 93 MATH;
-#X text 341 130 calculate / and %;
-#X text 339 155 / for several inputs;
-#X text 333 235 + for several inputs;
-#X text 333 207 * for several inputs;
-#X text 337 181 - for several inputs;
-#X text 345 259 average of last N values;
-#X text 346 285 average over last N seconds;
-#X text 329 312 match input to list of numbers;
-#X text 601 399 TIME;
-#X text 678 452 lets input through every N milliseconds;
-#X text 640 479 play sequence of MIDI notes;
-#X text 662 504 ignore too fast changing input;
-#X text 63 550 send to list of receive objects;
-#X text 84 574 same for netreceive;
-#X text 74 599 send to one receive object;
-#X text 597 96 BUFFER;
-#X text 648 531 a line object that steps;
-#X text 599 208 OTHER / EXPERIMENTAL;
-#X text 657 231 self-similar substitution;
-#X text 656 257 cellular automaton;
-#X obj 274 338 scale;
-#X text 656 425 a 'better' metro;
-#X obj 601 555 history;
-#X obj 601 581 velocity;
-#X text 670 555 average over last N milliseconds;
-#X text 677 581 velocity of input in digits per second;
-#X obj 15 624 netrec;
-#X text 74 625 netreceive with extra info about sender;
-#X obj 274 364 delta;
-#X text 139 61 download at http://www.akustische-kunst.org/puredata/maxlib
-;
-#X obj 599 174 listfifo;
-#X text 677 173 first in first out for lists;
-#X text 646 148 first in first out for floats;
-#X text 643 123 last in first out for floats;
-#X obj 600 607 sync;
-#X text 645 609 extended trigger object;
-#X text 328 338 scale input to output range;
-#X text 13 528 (REMOTE)CONTROL;
-#X obj 16 649 netserver;
-#X obj 16 676 netclient;
-#X text 103 654 bidirectional communication;
-#X text 112 669 (client / server based);
-#X obj 274 392 wrap;
-#X obj 274 419 rewrap;
-#X text 320 392 warp a number in a range;
-#X text 337 420 warp it back and forth;
-#X text 30 26 maxlib 1.3 :: Music Analysis eXtensions LIBrary;
-#X text 328 364 calculate 1st or 2nd order diff.;
-#X text 600 288 RANDOM;
-#X obj 600 312 gauss;
-#X obj 600 337 poisson;
-#X obj 666 312 linear;
-#X obj 666 337 bilex;
-#X obj 736 311 expo;
-#X obj 785 311 beta;
-#X obj 834 312 cauchy;
-#X obj 737 338 arbran array01 array02;
-#X obj 18 278 gestalt;
-#X obj 18 303 edge;
-#X text 56 306 detect rising/falling edge;
-#X text 84 278 'gestalt' of music;
-#X obj 599 365 urn;
-#X text 632 366 urn selection model;
-#X obj 601 635 timebang;
-#X text 680 635 send a bang at given time of day;
-#X obj 15 390 split;
-#X obj 15 439 unroute;
-#X text 81 440 opposit to route;
-#X text 67 392 split according to range;
-#X obj 15 463 limit;
-#X text 63 464 limiter for floats;
-#X obj 15 415 nroute;
-#X text 69 416 r. according to Nth elem.;
-#X text 24 363 ROUTING / CHECKING;
-#X obj 600 661 pong;
-#X obj 18 330 tilt;
-#X obj 600 686 temperature;
-#X text 698 687 amount of input changes per time;
-#X text 646 662 a bouncing ball model;
-#X text 66 333 meassure tilt of input;
-#X obj 16 489 listfunnel;
-#X text 107 490 Max's funnel for lists;
+#N canvas 75 -12 1161 819 10;
+#X obj 307 260 average;
+#X obj 18 150 beat;
+#X obj 18 175 borax;
+#X obj 18 125 chord;
+#X obj 14 588 dist;
+#X obj 307 155 divide;
+#X obj 307 129 divmod;
+#X obj 656 148 fifo;
+#X obj 307 286 history;
+#X obj 403 577 ignore;
+#X obj 403 552 iso;
+#X obj 655 122 lifo;
+#X obj 307 312 match;
+#X obj 307 180 minus;
+#X obj 660 343 mlife;
+#X obj 307 207 multi;
+#X obj 14 613 netdist;
+#X obj 18 251 pitch;
+#X obj 307 234 plus;
+#X obj 403 499 pulse;
+#X obj 14 637 remote;
+#X obj 18 200 rhythm;
+#X obj 18 225 score array01;
+#X obj 403 525 speedlim;
+#X obj 403 603 step;
+#X obj 660 318 subst;
+#X text 140 44 written by Olaf Matthes <olaf.matthes@gmx.de>;
+#X text 71 125 chord detection;
+#X text 68 150 beat tracking;
+#X text 77 201 beat detection;
+#X text 72 176 music analysis;
+#X text 135 225 score following;
+#X text 72 251 pitch information;
+#X text 19 94 MUSIC / MIDI ANALYSIS;
+#X text 310 91 MATH;
+#X text 374 130 calculate / and %;
+#X text 372 155 / for several inputs;
+#X text 366 235 + for several inputs;
+#X text 366 207 * for several inputs;
+#X text 370 181 - for several inputs;
+#X text 378 259 average of last N values;
+#X text 379 285 average over last N seconds;
+#X text 362 312 match input to list of numbers;
+#X text 403 473 TIME;
+#X text 480 526 lets input through every N milliseconds;
+#X text 442 553 play sequence of MIDI notes;
+#X text 464 578 ignore too fast changing input;
+#X text 62 587 send to list of receive objects;
+#X text 83 611 same for netreceive;
+#X text 73 636 send to one receive object;
+#X text 654 95 BUFFER;
+#X text 450 605 a line object that steps;
+#X text 659 294 OTHER / EXPERIMENTAL;
+#X text 717 317 self-similar substitution;
+#X text 716 343 cellular automaton;
+#X obj 307 338 scale;
+#X text 458 499 a 'better' metro;
+#X obj 403 629 history;
+#X obj 403 655 velocity;
+#X text 472 629 average over last N milliseconds;
+#X text 479 655 velocity of input in digits per second;
+#X obj 14 661 netrec;
+#X text 73 662 netreceive with extra info about sender;
+#X obj 307 364 delta;
+#X text 139 61 download at http://www.akustische-kunst.org/puredata/maxlib
+;
+#X obj 656 173 listfifo;
+#X text 734 172 first in first out for lists;
+#X text 703 147 first in first out for floats;
+#X text 700 122 last in first out for floats;
+#X obj 402 681 sync;
+#X text 447 683 extended trigger object;
+#X text 361 338 scale input to output range;
+#X text 12 565 (REMOTE)CONTROL;
+#X obj 15 686 netserver;
+#X obj 15 713 netclient;
+#X text 102 691 bidirectional communication;
+#X text 111 706 (client / server based);
+#X obj 307 392 wrap;
+#X obj 307 419 rewrap;
+#X text 353 392 warp a number in a range;
+#X text 370 420 warp it back and forth;
+#X text 361 364 calculate 1st or 2nd order diff.;
+#X text 660 374 RANDOM;
+#X obj 660 398 gauss;
+#X obj 660 423 poisson;
+#X obj 726 398 linear;
+#X obj 726 423 bilex;
+#X obj 796 397 expo;
+#X obj 845 397 beta;
+#X obj 894 398 cauchy;
+#X obj 797 424 arbran array01 array02;
+#X obj 18 278 gestalt;
+#X obj 18 303 edge;
+#X text 66 307 detect rising/falling edge;
+#X text 84 278 'gestalt' of music;
+#X obj 659 452 urn;
+#X text 692 452 urn selection model;
+#X obj 403 709 timebang;
+#X text 482 709 send a bang at given time of day;
+#X obj 15 390 split;
+#X obj 15 439 unroute;
+#X text 81 440 opposit to route;
+#X text 74 392 split according to range;
+#X obj 15 463 limit;
+#X text 63 464 limiter for floats;
+#X obj 15 415 nroute;
+#X text 80 414 r. according to Nth elem.;
+#X text 24 363 ROUTING / CHECKING;
+#X obj 402 735 pong;
+#X obj 18 330 tilt;
+#X obj 402 760 temperature;
+#X text 500 761 amount of input changes per time;
+#X text 448 736 a bouncing ball model;
+#X text 66 333 meassure tilt of input;
+#X obj 16 489 listfunnel;
+#X text 107 490 Max's funnel for lists;
+#X text 30 26 maxlib 1.5 :: Music Analysis eXtensions LIBrary;
+#X obj 656 201 arraycopy;
+#X text 741 202 copy from one array to another;
+#X obj 17 525 nchange s;
+#X text 89 526 change that exepts any kind of input;
diff --git a/makefile b/makefile
index 74c4e15..adcbfa9 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,7 @@
NAME=maxlib
CSYM=maxlib
-current: pd_nt pd_linux pd_darwin
+current: pd_irix6
# ----------------------- NT -----------------------
@@ -9,7 +9,8 @@ pd_nt: $(NAME).dll
.SUFFIXES: .dll
-PDNTCFLAGS = /W3 /WX /MD /O2 /G6 /DNT /DPD /DMAXLIB /nologo
+# define PD_0_36 to compilie with pd0.36 and below
+PDNTCFLAGS = /W3 /WX /MD /O2 /G6 /DNT /DPD /DPD_0_36 /DMAXLIB /nologo
VC="C:\Programme\Microsoft Visual Studio\VC98"
PDNTINCLUDE = /I. /Ic:\pd\tcl\include /Ic:\pd\src /I$(VC)\include /Iinclude
@@ -33,10 +34,13 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
cauchy.obj expo.obj gauss.obj linear.obj poisson.obj triang.obj \
weibull.obj netserver.obj netclient.obj nroute.obj remote.obj \
edge.obj subst.obj pong.obj mlife.obj limit.obj unroute.obj \
- urn.obj split.obj wrap.obj rewrap.obj timebang.obj
+ urn.obj split.obj wrap.obj rewrap.obj timebang.obj sync.obj \
+ listfifo.obj arraycopy.obj allow.obj deny.obj nchange.obj
.c.dll:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\allow.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\arbran.c
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\arraycopy.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\average.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\beat.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\beta.c
@@ -45,6 +49,7 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\cauchy.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\chord.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\delta.c
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\deny.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\dist.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\divide.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\divmod.c
@@ -57,6 +62,7 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\ignore.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\iso.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\linear.c
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\listfifo.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\listfunnel.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\lifo.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\limit.c
@@ -64,6 +70,7 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\minus.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\mlife.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\multi.c
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\nchange.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\netclient.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\netdist.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\netrec.c
@@ -83,6 +90,7 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\split.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\step.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\subst.c
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\sync.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\temperature.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\tilt.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c src\timebang.c
@@ -96,6 +104,101 @@ PDNTEXTERNALS = borax.obj divide.obj ignore.obj match.obj pitch.obj speedlim.obj
link /dll /export:$(CSYM)_setup $*.obj $(PDNTEXTERNALS) $(PDNTLIB)
+# ----------------------- IRIX 6.5 -----------------------
+
+pd_irix6: $(NAME).pd_irix6
+
+.SUFFIXES: .pd_irix6
+
+SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -Ofast=ip32 -r12000 -shared
+
+SGIINCLUDE = -I../../src
+
+SGIGCFLAGS = -mabi=n32 -DPD -DMAXLIB -DUNIX -DIRIX -DN32 -O3 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wshadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch -mips4
+
+SGIEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
+ plus.o minus.o divide.o multi.o average.o chord.o \
+ score.o divmod.o pulse.o fifo.o lifo.o iso.o dist.o \
+ remote.o step.o netdist.o beat.o rhythm.o history.o \
+ netrec.o scale.o delta.o velocity.o mlife.o subst.o \
+ listfunnel.o tilt.o gestalt.o temperature.o arbran.o \
+ beta.o bilex.o cauchy.o expo.o gauss.o linear.o poisson.o \
+ triang.o weibull.o netserver.o netclient.o nroute.o \
+ edge.o pong.o limit.o unroute.o urn.o split.o wrap.o \
+ rewrap.o timebang.o sync.o listfifo.o arraycopy.o \
+ allow.o deny.o nchange.o
+
+.c.pd_irix6:
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/allow.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/arbran.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/arraycopy.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/average.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/beat.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/beta.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/bilex.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/borax.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/cauchy.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/chord.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/delta.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/deny.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/dist.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/divide.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/divmod.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/edge.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/expo.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/fifo.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/gauss.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/gestalt.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/history.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/ignore.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/iso.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/lifo.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/limit.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/linear.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/listfifo.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/listfunnel.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/match.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/minus.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/mlife.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/multi.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/nchange.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/netclient.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/netdist.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/netrec.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/netserver.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/nroute.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/plus.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/pong.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/poisson.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/pulse.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/pitch.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/remote.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/rewrap.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/rhythm.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/scale.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/score.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/speedlim.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/split.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/step.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/subst.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/sync.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/temperature.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/tilt.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/timebang.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/triang.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/unroute.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/urn.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/velocity.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/weibull.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c src/wrap.c
+ gcc $(SGIGCFLAGS) $(SGIINCLUDE) -c $*.c
+ ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o $(SGIEXTERNALS)
+ rm $*.o
+
# ----------------------- Mac OS X (Darwin) -----------------------
@@ -104,7 +207,7 @@ pd_darwin: $(NAME).pd_darwin
.SUFFIXES: .pd_darwin
DARWINCFLAGS = -DPD -DMAXLIB -DUNIX -DMACOSX -O2 \
- -Wall -W -Wno-shadow -Wstrict-prototypes \
+ -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
# where is your m_pd.h ???
@@ -119,10 +222,13 @@ DARWINEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
beta.o bilex.o cauchy.o expo.o gauss.o linear.o poisson.o \
triang.o weibull.o netserver.o netclient.o nroute.o \
edge.o pong.o limit.o unroute.o urn.o split.o wrap.o \
- rewrap.o timebang.o
+ rewrap.o timebang.o sync.o listfifo.o arraycopy.o \
+ allow.o deny.o nchange.o
.c.pd_darwin:
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/allow.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/arbran.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/arraycopy.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/average.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/beat.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/beta.c
@@ -131,6 +237,7 @@ DARWINEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/cauchy.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/chord.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/delta.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/deny.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/dist.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/divide.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/divmod.c
@@ -145,11 +252,13 @@ DARWINEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/lifo.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/limit.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/linear.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/listfifo.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/listfunnel.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/match.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/minus.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/mlife.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/multi.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/nchange.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/netclient.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/netdist.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/netrec.c
@@ -166,10 +275,11 @@ DARWINEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/scale.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/score.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/speedlim.c
- cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/step.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/weibull.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/split.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/step.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/subst.c
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/sync.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/temperature.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/tilt.c
cc $(DARWINCFLAGS) $(DARWININCLUDE) -c src/timebang.c
@@ -184,20 +294,6 @@ DARWINEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
rm -f $*.o ../$*.pd_darwin
ln -s $*/$*.pd_darwin ..
-darwin_package: pd_darwin
- test -d root/doc/5.reference || mkdir -p root/doc/5.reference
- -cp help/* root/doc/5.reference
- test -d root/extra || mkdir -p root/extra
- install -m644 *.pd_darwin root/extra
- open darwin_package.pmsp
-
-darwin_altpackage: pd_darwin
- test -d root/Help || mkdir -p root/Help
- -cp help/* root/Help
- test -d root/Externals || mkdir -p root/Externals
- install -m644 *.pd_darwin root/Externals
- open darwin_altpackage.pmsp
-
# ----------------------- LINUX i386 -----------------------
pd_linux: $(NAME).pd_linux
@@ -205,12 +301,11 @@ pd_linux: $(NAME).pd_linux
.SUFFIXES: .pd_linux
LINUXCFLAGS = -DPD -DMAXLIB -DUNIX -O2 -funroll-loops -fomit-frame-pointer \
-# LINUXCFLAGS = -DPD -DUNIX -O2 -funroll-loops -fomit-frame-pointer \
-Wall -W -Wshadow \
-Wno-unused -Wno-parentheses -Wno-switch
# where is your m_pd.h ???
-LINUXINCLUDE = -I/usr/local/include -I./include -I../../pd/src
+LINUXINCLUDE = -I/usr/local/include -I./include
LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
plus.o minus.o divide.o multi.o average.o chord.o \
@@ -221,10 +316,13 @@ LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
beta.o bilex.o cauchy.o expo.o gauss.o linear.o poisson.o \
triang.o weibull.o netserver.o netclient.o nroute.o \
edge.o pong.o limit.o unroute.o urn.o split.o wrap.o \
- rewrap.o timebang.o
+ rewrap.o timebang.o sync.o listfifo.o arraycopy.o \
+ allow.o deny.o nchange.o
.c.pd_linux:
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/allow.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/arbran.c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/arraycopy.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/average.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/beat.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/beta.c
@@ -233,6 +331,7 @@ LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/cauchy.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/chord.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/delta.c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/deny.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/dist.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/divide.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/divmod.c
@@ -247,11 +346,13 @@ LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/lifo.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/limit.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/linear.c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/listfifo.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/listfunnel.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/match.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/minus.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/mlife.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/multi.c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/nchange.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/netclient.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/netdist.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/netrec.c
@@ -271,6 +372,7 @@ LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/split.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/step.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/subst.c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/sync.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/temperature.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/tilt.c
cc $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/timebang.c
@@ -286,7 +388,7 @@ LINUXEXTERNALS = borax.o ignore.o match.o pitch.o speedlim.o \
# ----------------------------------------------------------
-PDDIR=/usr/lib/pd
+PDDIR=/usr/local/lib/pd
install:
install -d $(PDDIR)/doc/5.reference/maxlib
diff --git a/maxlib.c b/maxlib.c
index e2242a2..14b1b83 100644
--- a/maxlib.c
+++ b/maxlib.c
@@ -22,7 +22,7 @@
/* */
/* ---------------------------------------------------------------------------- */
#ifndef VERSION
-#define VERSION "1.2"
+#define VERSION "1.5.2"
#endif
#include "m_pd.h"
@@ -40,7 +40,9 @@ typedef struct _maxlib
static t_class* maxlib_class;
/* objects */
+void maxlib_allow_setup();
void maxlib_arbran_setup();
+void maxlib_arraycopy_setup();
void maxlib_average_setup();
void maxlib_beat_setup();
void maxlib_beta_setup();
@@ -49,6 +51,7 @@ void maxlib_borax_setup();
void maxlib_cauchy_setup();
void maxlib_chord_setup();
void maxlib_delta_setup();
+void maxlib_deny_setup();
void maxlib_dist_setup();
void maxlib_divide_setup();
void maxlib_divmod_setup();
@@ -63,11 +66,13 @@ void maxlib_iso_setup();
void maxlib_lifo_setup();
void maxlib_limit_setup();
void maxlib_linear_setup();
+void maxlib_listfifo_setup();
void maxlib_listfunnel_setup();
void maxlib_match_setup();
void maxlib_minus_setup();
void maxlib_mlife_setup();
void maxlib_multi_setup();
+void maxlib_nchange_setup();
void maxlib_netclient_setup();
void maxlib_netdist_setup();
void maxlib_netrec_setup();
@@ -87,6 +92,7 @@ void maxlib_speedlim_setup();
void maxlib_split_setup();
void maxlib_step_setup();
void maxlib_subst_setup();
+void maxlib_sync_setup();
void maxlib_temperature_setup();
void maxlib_tilt_setup();
void maxlib_timebang_setup();
@@ -108,7 +114,9 @@ void maxlib_setup(void)
maxlib_class = class_new(gensym("maxlib"), (t_newmethod)maxlib_new, 0,
sizeof(t_maxlib), 0,0);
- maxlib_arbran_setup();
+ maxlib_allow_setup();
+ maxlib_arbran_setup();
+ maxlib_arraycopy_setup();
maxlib_average_setup();
maxlib_beat_setup();
maxlib_beta_setup();
@@ -117,6 +125,7 @@ void maxlib_setup(void)
maxlib_cauchy_setup();
maxlib_chord_setup();
maxlib_delta_setup();
+ maxlib_deny_setup();
maxlib_dist_setup();
maxlib_divide_setup();
maxlib_divmod_setup();
@@ -131,11 +140,13 @@ void maxlib_setup(void)
maxlib_lifo_setup();
maxlib_limit_setup();
maxlib_linear_setup();
+ maxlib_listfifo_setup();
maxlib_listfunnel_setup();
maxlib_match_setup();
maxlib_minus_setup();
maxlib_mlife_setup();
maxlib_multi_setup();
+ maxlib_nchange_setup();
maxlib_netclient_setup();
maxlib_netdist_setup();
maxlib_netrec_setup();
@@ -155,6 +166,7 @@ void maxlib_setup(void)
maxlib_split_setup();
maxlib_step_setup();
maxlib_subst_setup();
+ maxlib_sync_setup();
maxlib_temperature_setup();
maxlib_tilt_setup();
maxlib_timebang_setup();
@@ -170,11 +182,11 @@ void maxlib_setup(void)
post(" version "VERSION);
post(" compiled "__DATE__);
post(" latest version at http://www.akustische-kunst.org/puredata/maxlib/");
- post(" objects: arbran average beat beta bilex borax cauchy chord delta dist ");
- post(" divide divmod edge expo fifo gauss gestalt history ignore iso ");
- post(" lifo linear listfunnel match minus mlife multi netclient ");
- post(" netdist netrec netserver nroute pitch plus poisson pong pulse ");
- post(" remote rewrap rhythm scale score speedlim split step subst ");
- post(" temperature tilt timebang triang unroute urn velocity weibull ");
- post(" wrap\n");
+ post(" objects: allow arbran arraycopy average beat beta bilex borax cauchy ");
+ post(" chord delta deny dist divide divmod edge expo fifo gauss ");
+ post(" gestalt history ignore iso lifo linear listfifo listfunnel ");
+ post(" match minus mlife multi nchange netclient netdist netrec ");
+ post(" netserver nroute pitch plus poisson pong pulse remote rewrap ");
+ post(" rhythm scale score speedlim split step subst sync temperature ");
+ post(" tilt timebang triang unroute urn velocity weibull wrap\n");
}
diff --git a/src/allow.c b/src/allow.c
index c5d57ac..f835dc5 100644
--- a/src/allow.c
+++ b/src/allow.c
@@ -27,12 +27,12 @@
static char *version = "allow v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>";
-typedef struct allow
-{
+typedef struct allow
+{
t_object x_obj;
t_outlet *x_out;
t_atom *x_elem; // list of elemets that are allowed to pass
- t_int x_numelem; // the number of elemetns in our allow-list
+ t_int x_numelem; // the number of elemetns in our allow-list
} t_allow;
/* we got a symbol... */
@@ -73,7 +73,7 @@ static void allow_free(t_allow *x)
}
static void *allow_new(t_symbol *s, int argc, t_atom *argv)
-{
+{
t_allow *x = (t_allow *)pd_new(allow_class);
x->x_numelem = argc; // get the number of elements
@@ -84,10 +84,10 @@ static void *allow_new(t_symbol *s, int argc, t_atom *argv)
// post("allow: got %d elements", x->x_numelem);
- return (x);
+ return (x);
}
-#ifndef MAXLIB
+#ifndef MAXLIB
void allow_setup(void)
{
/* the object's class: */
@@ -109,4 +109,4 @@ void maxlib_allow_setup(void)
#else
class_sethelpsymbol(allow_class, gensym("maxlib/help-allow.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/arbran.c b/src/arbran.c
index cb39963..ba19976 100644
--- a/src/arbran.c
+++ b/src/arbran.c
@@ -58,14 +58,7 @@ static void rand_arbran_pdfscale(t_rand_arbran *x)
t_int k = 0;
t_float *tx, *tp;
t_int ix, ip;
-
- if(!bx || !bp)
- {
- post("arbran: no arrays: pdfscale!");
- return;
- }
-
- if (!garray_getfloatarray(bx, &ix, &tx))
+ if (!garray_getfloatarray(bx, &ix, &tx))
{
post("arbran: couldn't read from array!");
return;
@@ -94,19 +87,11 @@ static void rand_arbran_bang(t_rand_arbran *x)
t_int k = 0;
t_float *tx, *tp;
t_int ix, ip;
-
- if(!bx || !bp)
- {
- post("arbran: no arrays: bang!");
- return;
- }
-
- if (!garray_getfloatarray(bx, &ix, &tx))
+ if (!garray_getfloatarray(bx, &ix, &tx))
{
post("arbran: couldn't read from array!");
return;
}
-
if (!garray_getfloatarray(bp, &ip, &tp))
{
post("arbran: couldn't read from array!");
@@ -114,6 +99,7 @@ static void rand_arbran_bang(t_rand_arbran *x)
}
a = 0;
+ a0 = 0;
u = fran();
while(u > a)
{
@@ -173,10 +159,9 @@ static void *rand_arbran_new(t_symbol *s1, t_symbol *s2)
t_rand_arbran *x = (t_rand_arbran *)pd_new(rand_arbran_class);
srand( (unsigned)time( NULL ) );
outlet_new(&x->x_obj, &s_float);
- rand_arbran_setarrays(x, s1, s2);
- /* x->x_x = s1;
- x->x_p = s2;
- rand_arbran_set(x); */
+ x->x_x = s1;
+ x->x_p = s2;
+ rand_arbran_set(x);
return (x);
}
diff --git a/src/arraycopy.c b/src/arraycopy.c
index cc36913..b71f7f3 100644
--- a/src/arraycopy.c
+++ b/src/arraycopy.c
@@ -27,9 +27,9 @@
static char *version = "arraycopy v0.2, written by Olaf Matthes <olaf.matthes@gmx.de>";
-typedef struct arraycopy
-{
- t_object x_obj;
+typedef struct arraycopy
+{
+ t_object x_obj;
t_symbol *x_destarray;
t_symbol *x_sourcearray;
t_garray *x_destbuf;
@@ -78,7 +78,7 @@ static void arraycopy_setsourcearray(t_arraycopy *x, t_symbol *s)
/* this is the routine that actually does the copying */
/* get's called directly when we get a 'bang' */
-static void arraycopy_docopy(t_arraycopy *x)
+static void arraycopy_docopy(t_arraycopy *x)
{
t_garray *b; /* make local copy of array */
t_float *tab; /* the content itselfe */
@@ -147,8 +147,8 @@ static void arraycopy_docopy(t_arraycopy *x)
if(x->x_print)post("arraycopy: copied %d values from array \"%s\" to array \"%s\"",
x->x_end-x->x_start, x->x_sourcearray->s_name, x->x_destarray->s_name);
}
-}
-
+}
+
static void arraycopy_list(t_arraycopy *x, t_symbol *s, int argc, t_atom *argv)
{
if(argc > 1) {
@@ -242,19 +242,19 @@ static void arraycopy_copy(t_arraycopy *x, t_symbol *s, int argc, t_atom *argv)
static t_class *arraycopy_class;
static void *arraycopy_new(t_symbol *s, int argc, t_atom *argv)
-{
+{
t_arraycopy *x = (t_arraycopy *)pd_new(arraycopy_class);
- if (argc > 0) {
+ if (argc > 0) {
x->x_destarray = atom_getsymbolarg(0, argc, argv);
- arraycopy_setdestarray(x, x->x_destarray);
+ arraycopy_setdestarray(x, x->x_destarray);
}
inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("dest"));
- x->x_start = x->x_end = x->x_pos = x->x_print = 0;
- return (x);
+ x->x_start = x->x_end = x->x_pos = x->x_print = 0;
+ return (x);
}
-#ifndef MAXLIB
+#ifndef MAXLIB
void arraycopy_setup(void)
{
/* the object's class: */
@@ -280,4 +280,4 @@ void maxlib_arraycopy_setup(void)
#else
class_sethelpsymbol(arraycopy_class, gensym("maxlib/help-arraycopy.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/beta.c b/src/beta.c
index ebc7a14..391dc48 100644
--- a/src/beta.c
+++ b/src/beta.c
@@ -22,8 +22,8 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
@@ -32,10 +32,10 @@
#ifndef M_PI
#define M_PI 3.1415927
#endif
-
+
static char *version = "beta v0.1, generates a beta distributed random variable\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- rand_beta ------------------------------ */
static t_class *rand_beta_class;
@@ -61,7 +61,7 @@ static void *rand_beta_new(t_floatarg a, t_floatarg b)
static void rand_beta_bang(t_rand_beta *x)
{
- t_float u1, u2, y1, y2, sum, a, b, ainv, binv;
+ t_float u1, u2, y01, y2, sum, a, b, ainv, binv;
a = (x->x_a <= 0 ? 0.0001 : x->x_a);
b = (x->x_b <= 0 ? 0.0001 : x->x_b);
ainv = 1/a;
@@ -78,12 +78,12 @@ static void rand_beta_bang(t_rand_beta *x)
u2 = fran();
}
while(u2 == 0);
- y1 = pow(u1, ainv);
+ y01 = pow(u1, ainv);
y2 = pow(u2, binv);
- sum = y1 + y2;
+ sum = y01 + y2;
}
while(sum > 1);
- outlet_float(x->x_obj.ob_outlet, y1/sum);
+ outlet_float(x->x_obj.ob_outlet, y01/sum);
}
#ifndef MAXLIB
@@ -104,4 +104,4 @@ void maxlib_beta_setup(void)
class_addcreator((t_newmethod)rand_beta_new, gensym("beta"), A_DEFFLOAT, A_DEFFLOAT, 0);
class_sethelpsymbol(rand_beta_class, gensym("maxlib/help-beta.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/chord.c b/src/chord.c
index f0dc4a3..670ac0a 100644
--- a/src/chord.c
+++ b/src/chord.c
@@ -25,6 +25,10 @@
#include "m_pd.h"
#include <stdio.h>
#include <string.h>
+#ifdef UNIX
+#include <stdlib.h>
+#endif
+
#define MAX_POLY 32 /* maximum number of notes played at a time */
diff --git a/src/deny.c b/src/deny.c
index 9d0ef35..d447adc 100644
--- a/src/deny.c
+++ b/src/deny.c
@@ -27,12 +27,12 @@
static char *version = "deny v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>";
-typedef struct deny
-{
+typedef struct deny
+{
t_object x_obj;
t_outlet *x_out;
t_atom *x_elem; // list of elemets that are denyed to pass
- t_int x_numelem; // the number of elemetns in our deny-list
+ t_int x_numelem; // the number of elemetns in our deny-list
} t_deny;
/* we got a symbol... */
@@ -75,7 +75,7 @@ static void deny_free(t_deny *x)
}
static void *deny_new(t_symbol *s, int argc, t_atom *argv)
-{
+{
t_deny *x = (t_deny *)pd_new(deny_class);
x->x_numelem = argc; // get the number of elements
@@ -86,10 +86,10 @@ static void *deny_new(t_symbol *s, int argc, t_atom *argv)
// post("deny: got %d elements", x->x_numelem);
- return (x);
+ return (x);
}
-#ifndef MAXLIB
+#ifndef MAXLIB
void deny_setup(void)
{
/* the object's class: */
@@ -111,4 +111,4 @@ void maxlib_deny_setup(void)
#else
class_sethelpsymbol(deny_class, gensym("maxlib/help-deny.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/expo.c b/src/expo.c
index 7100417..7ba78cb 100644
--- a/src/expo.c
+++ b/src/expo.c
@@ -22,17 +22,17 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define fran() (t_float)rand()/(t_float)RAND_MAX
-
+
static char *version = "expo v0.1, generates exponentially distributed random variable\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- rand_expo ------------------------------ */
static t_class *rand_expo_class;
@@ -83,4 +83,4 @@ void maxlib_expo_setup(void)
class_addcreator((t_newmethod)rand_expo_new, gensym("expo"), A_DEFFLOAT, 0);
class_sethelpsymbol(rand_expo_class, gensym("maxlib/help-expo.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/fifo.c b/src/fifo.c
index c0f73be..246205e 100644
--- a/src/fifo.c
+++ b/src/fifo.c
@@ -93,4 +93,4 @@ void maxlib_fifo_setup(void)
class_addbang(fifo_class, fifo_bang);
class_sethelpsymbol(fifo_class, gensym("maxlib/help-fifo.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/gestalt.c b/src/gestalt.c
index 650efdb..b8e0af8 100644
--- a/src/gestalt.c
+++ b/src/gestalt.c
@@ -25,6 +25,9 @@
#include "m_pd.h"
#include <math.h>
#include <stdio.h>
+#ifdef UNIX
+#include <stdlib.h>
+#endif
static char *version = "gestalt v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>";
diff --git a/src/lifo.c b/src/lifo.c
index d2983e4..beb0eda 100644
--- a/src/lifo.c
+++ b/src/lifo.c
@@ -104,4 +104,4 @@ void maxlib_lifo_setup(void)
class_addmethod(lifo_class, (t_method)lifo_clear, gensym("clear"), 0);
class_sethelpsymbol(lifo_class, gensym("maxlib/help-lifo.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/linear.c b/src/linear.c
index a5869a2..cbac438 100644
--- a/src/linear.c
+++ b/src/linear.c
@@ -22,17 +22,17 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define fran() (t_float)rand()/(t_float)RAND_MAX
-
+
static char *version = "linear v0.1, generates linearly distributed random variable\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- rand_linear ------------------------------ */
static t_class *rand_linear_class;
@@ -78,4 +78,4 @@ void maxlib_linear_setup(void)
class_addbang(rand_linear_class, rand_linear_bang);
class_sethelpsymbol(rand_linear_class, gensym("maxlib/help-linear.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/listfifo.c b/src/listfifo.c
index dda9eeb..5daf908 100644
--- a/src/listfifo.c
+++ b/src/listfifo.c
@@ -106,4 +106,4 @@ void maxlib_listfifo_setup(void)
class_addlist(listfifo_class, listfifo_list);
class_sethelpsymbol(listfifo_class, gensym("maxlib/help-listfifo.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/mlife.c b/src/mlife.c
index 47960dd..f592672 100644
--- a/src/mlife.c
+++ b/src/mlife.c
@@ -512,4 +512,4 @@ void maxlib_mlife_setup(void)
class_addbang(mlife_class, ml_bang);
class_sethelpsymbol(mlife_class, gensym("maxlib/help-mlife.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/nchange.c b/src/nchange.c
index a7e7eb5..4f4c2fe 100644
--- a/src/nchange.c
+++ b/src/nchange.c
@@ -202,4 +202,4 @@ void maxlib_nchange_setup(void)
class_addmethod(nchange_class, (t_method)nchange_set, gensym("set"), A_GIMME, 0);
class_sethelpsymbol(nchange_class, gensym("maxlib/help-nchange.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/netclient.c b/src/netclient.c
index 406ae19..35658ba 100644
--- a/src/netclient.c
+++ b/src/netclient.c
@@ -22,14 +22,20 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
+/* Changes: use circular message buffer for receive */
+/* using pollfunction instead of clock (suggested by HCS) */
-
+#ifdef PD_0_37
#include "m_pd.h"
+#include "s_stuff.h"
+#endif
+#include "m_imp.h"
#include <sys/types.h>
#include <string.h>
#include <pthread.h>
#ifdef UNIX
+#include <sys/time.h>
#include <sys/socket.h>
#include <sys/errno.h>
#include <netinet/in.h>
@@ -41,18 +47,17 @@
#include <winsock.h>
#endif
-#define STRBUF_SIZE 32 /* maximum numbers of characters to read */
-#define DEFPOLLTIME 20 /* check for input every 20 ms */
+#define INBUFSIZE 4096 /* maximum numbers of characters to read */
-static char *version = "netclient v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>";
+static char *version = "netclient v0.3, written by Olaf Matthes <olaf.matthes@gmx.de>";
static t_class *netclient_class;
+static t_binbuf *inbinbuf;
typedef struct _netclient
{
t_object x_obj;
t_clock *x_clock;
- t_clock *x_poll;
t_outlet *x_outdata;
t_outlet *x_outconnect;
int x_fd;
@@ -60,37 +65,28 @@ typedef struct _netclient
int x_connectstate;
int x_port;
int x_protocol;
+ char x_inbuf[INBUFSIZE]; /* circular message buffer for received data */
+ int x_intail;
+ int x_inhead;
/* multithread stuff */
pthread_t x_threadid; /* id of child thread */
pthread_attr_t x_threadattr; /* attributes of child thread */
} t_netclient;
-static void sys_sockerror(char *s)
-{
-#ifdef NT
- int err = WSAGetLastError();
- if (err == 10054) return;
-#endif
-#ifdef UNIX
- int err = errno;
+#ifdef USE_CIRCULAR
+static t_binbuf *inbinbuf;
#endif
- post("%s: %s (%d)\n", s, strerror(err), err);
-}
-static void sys_closesocket(int fd) {
-
-#ifdef UNIX
- close(fd);
-#endif
-#ifdef NT
- closesocket(fd);
-#endif
-}
+ /* one lonlely prototype */
+static void netclient_rcv(t_netclient *x);
+ /* get's called when connection has been made */
static void netclient_tick(t_netclient *x)
{
outlet_float(x->x_outconnect, 1);
+ /* add pollfunction for checking for input */
+ sys_addpollfn(x->x_fd, (t_fdpollfn)netclient_rcv, x);
}
static void *netclient_child_connect(void *w)
@@ -163,6 +159,7 @@ static void netclient_disconnect(t_netclient *x)
{
if (x->x_fd >= 0)
{
+ sys_rmpollfn(x->x_fd);
sys_closesocket(x->x_fd);
x->x_fd = -1;
x->x_connectstate = 0;
@@ -219,14 +216,39 @@ static void netclient_send(t_netclient *x, t_symbol *s, int argc, t_atom *argv)
else error("netclient: not connected");
}
+ /* this is in a separately called subroutine so that the buffer isn't
+ sitting on the stack while the messages are getting passed. */
+static int netclient_doread(t_netclient *x)
+{
+ char messbuf[INBUFSIZE], *bp = messbuf;
+ int indx;
+ int inhead = x->x_inhead;
+ int intail = x->x_intail;
+ char *inbuf = x->x_inbuf;
+ if (intail == inhead) return (0);
+ for (indx = intail; indx != inhead; indx = (indx+1)&(INBUFSIZE-1))
+ {
+ char c = *bp++ = inbuf[indx];
+ if (c == ';' && (!indx || inbuf[indx-1] != '\\'))
+ {
+ intail = (indx+1)&(INBUFSIZE-1);
+ binbuf_text(inbinbuf, messbuf, bp - messbuf);
+ x->x_inhead = inhead;
+ x->x_intail = intail;
+ return (1);
+ }
+ }
+ return (0);
+}
+
static void netclient_rcv(t_netclient *x)
{
- int sockfd = x->x_fd;
+ int fd = x->x_fd;
int ret;
- char resp[STRBUF_SIZE];
+ char resp[INBUFSIZE];
fd_set readset;
fd_set exceptset;
- struct timeval ztout;
+ struct timeval ztout;
/* output data */
t_binbuf *binbuf;
t_atom messbuf[1024];
@@ -239,83 +261,88 @@ static void netclient_rcv(t_netclient *x)
/* check if we can read/write from/to the socket */
FD_ZERO(&readset);
FD_ZERO(&exceptset);
- FD_SET(x->x_fd, &readset );
- FD_SET(x->x_fd, &exceptset );
+ FD_SET(fd, &readset );
+ FD_SET(fd, &exceptset );
ztout.tv_sec = 0;
ztout.tv_usec = 0;
-
- ret = select(sockfd+1, &readset, NULL, &exceptset, &ztout);
+ ret = select(fd+1, &readset, NULL, &exceptset, &ztout);
if(ret < 0)
{
error("netclient: can not read from socket");
- sys_closesocket(sockfd);
+ sys_closesocket(fd);
return;
}
- if(FD_ISSET(sockfd, &readset) || FD_ISSET(sockfd, &exceptset))
+ if(FD_ISSET(fd, &readset) || FD_ISSET(fd, &exceptset))
{
- /* read from server */
- ret = recv(sockfd, resp, STRBUF_SIZE, 0);
- if(ret > 0)
+ int readto = (x->x_inhead >= x->x_intail ? INBUFSIZE : x->x_intail-1);
+
+ ret = recv(fd, x->x_inbuf + x->x_inhead, readto - x->x_inhead, 0);
+ if (ret < 0)
+ {
+ sys_sockerror("recv");
+ sys_rmpollfn(fd);
+ sys_closesocket(fd);
+ }
+ else if (ret == 0)
+ {
+ post("netclient: connection closed on socket %d", fd);
+ sys_rmpollfn(fd);
+ sys_closesocket(fd);
+ }
+ else
{
- // post("netclient: received: %s, %d bytes, %d stringlen", resp, ret, strlen(resp));
- /* convert string into atoms using a binbuf */
- binbuf = binbuf_new();
- binbuf_text(binbuf, resp, ret); //strlen(resp));
- natom = binbuf_getnatom(binbuf); /* get number of atoms */
- at = binbuf_getvec(binbuf); /* get the atoms */
- /* now split it into several parts at every A_SEMI because
- we probably received more than one message at a time */
- for (msg = 0; msg < natom;)
+ x->x_inhead += ret;
+ if (x->x_inhead >= INBUFSIZE) x->x_inhead = 0;
+ while (netclient_doread(x))
{
- int emsg;
- for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA
- && at[emsg].a_type != A_SEMI; emsg++);
-
- if (emsg > msg)
+ /* output binbuf */
+ natom = binbuf_getnatom(inbinbuf); /* get number of atoms */
+ at = binbuf_getvec(inbinbuf); /* get the atoms */
+ /* now split it into several parts at every A_SEMI because
+ we probably received more than one message at a time */
+ for (msg = 0; msg < natom;)
{
- int ii;
- for (ii = msg; ii < emsg; ii++)
- if (at[ii].a_type == A_DOLLAR || at[ii].a_type == A_DOLLSYM)
+ int emsg;
+ for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA
+ && at[emsg].a_type != A_SEMI; emsg++);
+
+ if (emsg > msg)
+ {
+ int ii;
+ for (ii = msg; ii < emsg; ii++)
+ if (at[ii].a_type == A_DOLLAR || at[ii].a_type == A_DOLLSYM)
+ {
+ pd_error(x, "netserver: -- got dollar sign in message");
+ goto nodice;
+ }
+ if (at[msg].a_type == A_FLOAT)
{
- pd_error(x, "netserver: -- got dollar sign in message");
- goto nodice;
+ if (emsg > msg + 1)
+ outlet_list(x->x_outdata, 0, emsg-msg, at + msg);
+ else outlet_float(x->x_outdata, at[msg].a_w.w_float);
}
- if (at[msg].a_type == A_FLOAT)
- {
- if (emsg > msg + 1)
- outlet_list(x->x_outdata, 0, emsg-msg, at + msg);
- else outlet_float(x->x_outdata, at[msg].a_w.w_float);
+ else if (at[msg].a_type == A_SYMBOL)
+ outlet_anything(x->x_outdata, at[msg].a_w.w_symbol,
+ emsg-msg-1, at + msg + 1);
}
- else if (at[msg].a_type == A_SYMBOL)
- outlet_anything(x->x_outdata, at[msg].a_w.w_symbol,
- emsg-msg-1, at + msg + 1);
+ nodice:
+ msg = emsg + 1;
}
- nodice:
- msg = emsg + 1;
- }
- binbuf_free(binbuf);
+ }
}
- else post("netclient: read() did not return any data");
}
}
else post("netclient: not connected");
}
-static void netclient_poll(t_netclient *x)
-{
- if(x->x_connectstate)
- netclient_rcv(x); /* try to read in case we're connected */
- clock_delay(x->x_poll, DEFPOLLTIME); /* see you later */
-}
-
static void *netclient_new(t_floatarg udpflag)
{
t_netclient *x = (t_netclient *)pd_new(netclient_class);
x->x_outdata = outlet_new(&x->x_obj, &s_anything); /* received data */
x->x_outconnect = outlet_new(&x->x_obj, &s_float); /* connection state */
x->x_clock = clock_new(x, (t_method)netclient_tick);
- x->x_poll = clock_new(x, (t_method)netclient_poll);
+ inbinbuf = binbuf_new();
x->x_fd = -1;
x->x_protocol = (udpflag != 0 ? SOCK_DGRAM : SOCK_STREAM);
/* prepare child thread */
@@ -323,15 +350,14 @@ static void *netclient_new(t_floatarg udpflag)
post("netclient: warning: could not prepare child thread" );
if(pthread_attr_setdetachstate(&x->x_threadattr, PTHREAD_CREATE_DETACHED) < 0)
post("netclient: warning: could not prepare child thread" );
- clock_delay(x->x_poll, 0); /* start polling the input */
return (x);
}
static void netclient_free(t_netclient *x)
{
netclient_disconnect(x);
- clock_free(x->x_poll);
clock_free(x->x_clock);
+ binbuf_free(inbinbuf);
}
#ifndef MAXLIB
@@ -362,4 +388,4 @@ void maxlib_netclient_setup(void)
class_addmethod(netclient_class, (t_method)netclient_rcv, gensym("rcv"), 0);
class_sethelpsymbol(netclient_class, gensym("maxlib/help-netclient.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/netrec.c b/src/netrec.c
index c747736..dc8e44f 100644
--- a/src/netrec.c
+++ b/src/netrec.c
@@ -22,7 +22,7 @@
/* */
/* ---------------------------------------------------------------------------- */
-#ifndef PD_0_36
+#ifdef PD_0_37
#include "m_pd.h"
#include "s_stuff.h"
#endif
@@ -446,4 +446,4 @@ void maxlib_netrec_setup(void)
class_addmethod(netrec_class, (t_method)netrec_print, gensym("print"), 0);
class_sethelpsymbol(netrec_class, gensym("maxlib/help-netrec.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/netserver.c b/src/netserver.c
index c8e22f6..1141cb9 100644
--- a/src/netserver.c
+++ b/src/netserver.c
@@ -23,7 +23,7 @@
/* */
/* ---------------------------------------------------------------------------- */
-#ifndef PD_0_36
+#ifdef PD_0_37
#include "m_pd.h"
#include "s_stuff.h"
#endif
@@ -582,4 +582,4 @@ void maxlib_netserver_setup(void)
class_addmethod(netserver_class, (t_method)netserver_broadcast, gensym("broadcast"), A_GIMME, 0);
class_sethelpsymbol(netserver_class, gensym("maxlib/help-netserver.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/nroute.c b/src/nroute.c
index c8c94c5..e0f6ea4 100644
--- a/src/nroute.c
+++ b/src/nroute.c
@@ -35,12 +35,12 @@
static char *version = "nroute v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>";
-typedef struct nroute
-{
- t_object x_obj;
- t_outlet *out1;
+typedef struct nroute
+{
+ t_object x_obj;
+ t_outlet *out1;
t_outlet *out2;
- t_int pos;
+ t_int pos;
t_atom match;
} t_nroute;
@@ -54,36 +54,36 @@ typedef struct proxy
/* this is the routine that actually does the routing / matching */
/* it get's called by all other routines that get any input and */
- /* even handles the second (proxy) inlet ! */
-static void nroute_any(t_nroute *x, t_symbol *s, int argc, t_atom *argv)
+ /* even handles the second (proxy) inlet ! */
+static void nroute_any(t_nroute *x, t_symbol *s, int argc, t_atom *argv)
{
if(s)
{
- if (x->pos == 1 && x->match.a_type == A_SYMBOL && x->match.a_w.w_symbol == s)
- outlet_anything (x->out1,s,argc,argv);
- else if (x->pos > 1 && x->pos <= argc + 1 &&
- argv[x->pos-2].a_type == x->match.a_type &&
- argv[x->pos-2].a_w.w_float == x->match.a_w.w_float)
- outlet_anything (x->out1,s,argc,argv);
- else outlet_anything (x->out2,s,argc,argv);
- }
+ if (x->pos == 1 && x->match.a_type == A_SYMBOL && x->match.a_w.w_symbol == s)
+ outlet_anything (x->out1,s,argc,argv);
+ else if (x->pos > 1 && x->pos <= argc + 1 &&
+ argv[x->pos-2].a_type == x->match.a_type &&
+ argv[x->pos-2].a_w.w_float == x->match.a_w.w_float)
+ outlet_anything (x->out1,s,argc,argv);
+ else outlet_anything (x->out2,s,argc,argv);
+ }
else
- {
- if (x->pos > 0 && x->pos <= argc &&
- argv[x->pos-1].a_type == x->match.a_type &&
- argv[x->pos-1].a_w.w_float == x->match.a_w.w_float)
- outlet_list (x->out1,0,argc,argv);
- else outlet_list (x->out2,0,argc,argv);
- }
-}
-
-static void nroute_float(t_nroute *x, float f)
-{
- t_atom a;
+ {
+ if (x->pos > 0 && x->pos <= argc &&
+ argv[x->pos-1].a_type == x->match.a_type &&
+ argv[x->pos-1].a_w.w_float == x->match.a_w.w_float)
+ outlet_list (x->out1,0,argc,argv);
+ else outlet_list (x->out2,0,argc,argv);
+ }
+}
+
+static void nroute_float(t_nroute *x, float f)
+{
+ t_atom a;
- SETFLOAT (&a,f);
- nroute_any(x,0,1,&a);
-}
+ SETFLOAT (&a,f);
+ nroute_any(x,0,1,&a);
+}
static void nroute_list(t_nroute *x, t_symbol *s, int argc, t_atom *argv)
{
@@ -120,34 +120,34 @@ static t_class *nroute_class;
static t_class *proxy_class;
static void *nroute_new(t_symbol *s, int argc, t_atom *argv)
-{
+{
t_nroute *x = (t_nroute *)pd_new(nroute_class);
t_proxy *inlet = (t_proxy *)pd_new(proxy_class); /* for the proxy inlet */
inlet->x = x; /* make x visible to the proxy inlets */
- x->pos = 1;
- x->match.a_type = A_NULL;
- if (argc > 2) { error ("nroute: extra arguments"); return 0; }
- if (argc > 1) {
- if (argv[1].a_type == A_FLOAT) x->pos = argv[1].a_w.w_float;
- else { post ("nroute: second argument must be (int) position"); return 0; }
- }
- if (argc > 0) {
- x->match.a_type = argv[0].a_type;
- x->match.a_w.w_float = argv[0].a_w.w_float;
- }
+ x->pos = 1;
+ x->match.a_type = A_NULL;
+ if (argc > 2) { error ("nroute: extra arguments"); return 0; }
+ if (argc > 1) {
+ if (argv[1].a_type == A_FLOAT) x->pos = argv[1].a_w.w_float;
+ else { post ("nroute: second argument must be (int) position"); return 0; }
+ }
+ if (argc > 0) {
+ x->match.a_type = argv[0].a_type;
+ x->match.a_w.w_float = argv[0].a_w.w_float;
+ }
inlet->index = 0; /* we are going to create a proxy inlet no. 0 */
/* it belongs to the object t_nroute but the destination is t_proxy */
inlet_new(&x->x_obj, &inlet->obj.ob_pd, 0,0);
/* and now a 'normal' third inlet */
inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("right"));
- x->out1 = outlet_new(&x->x_obj, gensym("list"));
+ x->out1 = outlet_new(&x->x_obj, gensym("list"));
x->out2 = outlet_new(&x->x_obj, gensym("list"));
- return (x);
+ return (x);
}
-#ifndef MAXLIB
+#ifndef MAXLIB
void nroute_setup(void)
{
/* the object's class: */
@@ -176,4 +176,4 @@ void maxlib_nroute_setup(void)
#else
class_sethelpsymbol(nroute_class, gensym("maxlib/help-nroute.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/pitch.c b/src/pitch.c
index 95fac90..01ab4e4 100644
--- a/src/pitch.c
+++ b/src/pitch.c
@@ -111,4 +111,4 @@ void maxlib_pitch_setup(void)
class_addfloat(pitch_class, pitch_float);
class_sethelpsymbol(pitch_class, gensym("maxlib/help-pitch.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/plus.c b/src/plus.c
index b34ffbf..12a5415 100644
--- a/src/plus.c
+++ b/src/plus.c
@@ -107,4 +107,4 @@ void maxlib_plus_setup(void)
class_addbang(plus_class, (t_method)plus_bang);
class_sethelpsymbol(plus_class, gensym("maxlib/help-plus.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/poisson.c b/src/poisson.c
index d7164ef..92469ad 100644
--- a/src/poisson.c
+++ b/src/poisson.c
@@ -22,8 +22,8 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
@@ -32,10 +32,10 @@
#ifndef M_PI
#define M_PI 3.1415927
#endif
-
+
static char *version = "poisson v0.1, generates a poisson distributed random variable\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- rand_poisson ------------------------------ */
static t_class *rand_poisson_class;
@@ -88,4 +88,4 @@ void maxlib_poisson_setup(void)
class_addbang(rand_poisson_class, rand_poisson_bang);
class_sethelpsymbol(rand_poisson_class, gensym("maxlib/help-poisson.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/pong.c b/src/pong.c
index c2deb50..9d269ab 100644
--- a/src/pong.c
+++ b/src/pong.c
@@ -28,9 +28,9 @@
static char *version = "pong v0.1, ported by Olaf Matthes <olaf.matthes@gmx.de>\n"
" written for Max by Richard Dudas";
-typedef struct pong
-{
- t_object x_obj;
+typedef struct pong
+{
+ t_object x_obj;
t_outlet *p_bounceout;
t_outlet *p_handout;
t_outlet *p_velout;
@@ -250,7 +250,7 @@ static void pong_force(t_pong *x, t_floatarg n)
static t_class *pong_class;
static void *pong_new(t_floatarg n)
-{
+{
t_pong *x = (t_pong *)pd_new(pong_class);
x->p_klok = clock_new(x, (t_method)pong_tick);
@@ -293,10 +293,10 @@ static void *pong_new(t_floatarg n)
x->p_velout = outlet_new(&x->x_obj, gensym("float"));
x->p_heightout = outlet_new(&x->x_obj, gensym("float"));
- return (x);
+ return (x);
}
-#ifndef MAXLIB
+#ifndef MAXLIB
void pong_setup(void)
{
pong_class = class_new(gensym("pong"), (t_newmethod)pong_new,
@@ -329,4 +329,4 @@ void maxlib_pong_setup(void)
#else
class_sethelpsymbol(pong_class, gensym("maxlib/help-pong.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/pulse.c b/src/pulse.c
index afa133c..b188532 100644
--- a/src/pulse.c
+++ b/src/pulse.c
@@ -298,4 +298,4 @@ void maxlib_pulse_setup(void)
class_addbang(pulse_class, pulse_bang);
class_sethelpsymbol(pulse_class, gensym("maxlib/help-pulse.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/remote.c b/src/remote.c
index d4c5771..7c22901 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -105,4 +105,4 @@ void maxlib_remote_setup(void)
class_addanything(remote_class, remote_anything);
class_sethelpsymbol(remote_class, gensym("maxlib/help-remote.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/rewrap.c b/src/rewrap.c
index b8d3242..e02f239 100644
--- a/src/rewrap.c
+++ b/src/rewrap.c
@@ -152,4 +152,4 @@ void maxlib_rewrap_setup(void)
class_addmethod(rewrap_class, (t_method)rewrap_b, gensym("b"), A_FLOAT, 0);
class_sethelpsymbol(rewrap_class, gensym("maxlib/help-rewrap.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/rhythm.c b/src/rhythm.c
index 7796a61..f4dcf6c 100644
--- a/src/rhythm.c
+++ b/src/rhythm.c
@@ -26,6 +26,9 @@
#include "m_pd.h"
#include <stdio.h>
#include <math.h>
+#ifdef UNIX
+#include <stdlib.h>
+#endif
#define ALPHA 10
#define ADAPT_ARRAY_SIZE 1000
diff --git a/src/score.c b/src/score.c
index 0f96229..940bf0b 100644
--- a/src/score.c
+++ b/src/score.c
@@ -306,4 +306,4 @@ void maxlib_score_setup(void)
class_addfloat(score_class, score_float);
class_sethelpsymbol(score_class, gensym("maxlib/help-score.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/step.c b/src/step.c
index 819a157..ecdbe2f 100644
--- a/src/step.c
+++ b/src/step.c
@@ -176,4 +176,4 @@ void maxlib_step_setup(void)
class_addfloat(step_class, (t_method)step_float);
class_sethelpsymbol(step_class, gensym("maxlib/help-step.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/subst.c b/src/subst.c
index f473d53..04219ec 100644
--- a/src/subst.c
+++ b/src/subst.c
@@ -421,4 +421,4 @@ void maxlib_subst_setup(void)
class_addbang(subst_class, subst_bang);
class_sethelpsymbol(subst_class, gensym("maxlib/help-subst.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/sync.c b/src/sync.c
index 21e05f9..810706e 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <math.h>
-#define SYNC_MAX_SIZE (sizeof(unsigned int) * 8)
+#define SYNC_MAX_SIZE (int)(sizeof(unsigned int) * 8)
static char *version = "sync v0.1, written by Olaf Matthes <olaf.matthes@gmx.de>\n"
" based on sync from jMax";
diff --git a/src/temperature.c b/src/temperature.c
index 509db76..7c71c84 100644
--- a/src/temperature.c
+++ b/src/temperature.c
@@ -117,4 +117,4 @@ void maxlib_temperature_setup(void)
class_addanything(temperature_class, temperature_anything);
class_sethelpsymbol(temperature_class, gensym("maxlib/help-temperature.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/tilt.c b/src/tilt.c
index ca67914..c86afe2 100644
--- a/src/tilt.c
+++ b/src/tilt.c
@@ -186,4 +186,4 @@ void maxlib_tilt_setup(void)
class_addmethod(tilt_class, (t_method)tilt_trip_point, gensym("trip"), A_FLOAT, 0);
class_sethelpsymbol(tilt_class, gensym("maxlib/help-tilt.pd"));
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/triang.c b/src/triang.c
index 832bced..c6e4879 100644
--- a/src/triang.c
+++ b/src/triang.c
@@ -22,17 +22,17 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define fran() (t_float)rand()/(t_float)RAND_MAX
-
+
static char *version = "triang v0.1, generates triangularly distributed random variable\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- rand_triang ------------------------------ */
static t_class *rand_triang_class;
@@ -77,4 +77,4 @@ void maxlib_triang_setup(void)
#else
class_sethelpsymbol(rand_triang_class, gensym("maxlib/help-triang.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/unroute.c b/src/unroute.c
index e6131e4..680653d 100644
--- a/src/unroute.c
+++ b/src/unroute.c
@@ -172,4 +172,4 @@ void maxlib_unroute_setup(void)
class_addcreator((t_newmethod)unroute_new, gensym("unroute"), A_GIMME, 0);
class_sethelpsymbol(unroute_class, gensym("maxlib/help-unroute.pd"));
#endif
-} \ No newline at end of file
+}
diff --git a/src/urn.c b/src/urn.c
index a657d42..3bf5f35 100644
--- a/src/urn.c
+++ b/src/urn.c
@@ -22,15 +22,15 @@
/* Based on PureData by Miller Puckette and others. */
/* */
/* ---------------------------------------------------------------------------- */
-
-#include "m_pd.h"
+
+#include "m_pd.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
static char *version = "urn v0.1, urn selection model\n"
" written by Olaf Matthes <olaf.matthes@gmx.de>";
-
+
/* -------------------------- urn ------------------------------ */
static t_class *urn_class;
@@ -149,4 +149,4 @@ void maxlib_urn_setup(void)
#else
class_sethelpsymbol(urn_class, gensym("maxlib/help-urn.pd"));
#endif
-} \ No newline at end of file
+}