Forums > MaxMSP

VERY basic help with max.

October 27, 2007 | 9:57 pm

I’ve searched the forums and seen alot of examples of what i’m looking for. The only problem is they’re not done via additive synthesis in the very basic way I need (in fact alot of them I just don’t understand what has been done to create the waveforms.)

All I want to do is make 4 buttons which when pushed produced a Square, Triangle, Sine and Sawtooth wave through additive synthesis.

Can anybody explain how ? For example with a sawtooth wave the partials are 1, 1/2, 1/3, 1/4, 1/5 etc, but how do I do this using say a 440Hz sine wave?

I’m completely lost.

I presume I start with Cycle~ 440. But then what would I add for the SawTooth wave etc? ( a number box containing all the partials?)

Thanks for your help and patience because i’m sure it’s frustrating to get asked basic stuff like this but I am completely new.

Thanks again.


October 27, 2007 | 10:27 pm

It depends on how many partials you want. You can either have a Cycle~
object for each partial (each playing a sine-tone) or use poly~, or use an
oscillator bank such as the one found in the CNMAT package:

http://www.cnmat.berkeley.edu/MAX/downloads/

look for sinusoids~.

Also I believe there is an additive synth patch in the msp tutorial.

Peiman

On 27/10/2007, George Stapleton

wrote:
>
>
> I’ve searched the forums and seen alot of examples of what i’m looking
> for. The only problem is they’re not done via additive synthesis in the very
> basic way I need (in fact alot of them I just don’t understand what has been
> done to create the waveforms.)
>
>
> All I want to do is make 4 buttons which when pushed produced a Square,
> Triangle, Sine and Sawtooth wave through additive synthesis.
>
> Can anybody explain how ? For example with a sawtooth wave the partials
> are 1, 1/2, 1/3, 1/4, 1/5 etc, but how do I do this using say a 440Hz sine
> wave?
>
> I’m completely lost.
>
> I presume I start with Cycle~ 440. But then what would I add for the
> SawTooth wave etc? ( a number box containing all the partials?)
>
> Thanks for your help and patience because i’m sure it’s frustrating to get
> asked basic stuff like this but I am completely new.
>
> Thanks again.
>


October 27, 2007 | 10:38 pm

Thanks for your help but would that be

| Cycle~ 440 1, 1/2, 1/3, 1/4, 1/5 |

all in the one box?

I appreciate your help.


October 28, 2007 | 12:12 am

Here is a quick example of an approach you could take. Of course you would need many more partials to approximate a saw wave but you can get some interesting results. Also, using the /~ operator for amplitudes isnt the most efficient approach but I thought it would illustrate the idea clearly.

However, I would like to agree with Peiman and say that the CNMAT osc bank is probably the best way. I’ve been using it for additive synthesis and have been getting great results.

Anyway,copy the following text and go to File -> New From Clipboard
in Max

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 452 211 55 196617 Amplitude;
#P user ezdac~ 45 442 89 475 0;
#P user gain~ 45 287 24 100 158 0 1.071519 7.94321 10.;
#P newex 416 206 34 196617 /~ 8.;
#P newex 363 206 34 196617 /~ 7.;
#P newex 310 206 34 196617 /~ 6.;
#P newex 257 206 34 196617 /~ 5.;
#P newex 204 206 34 196617 /~ 4.;
#P newex 151 206 34 196617 /~ 3.;
#P newex 98 206 34 196617 /~ 2.;
#P newex 416 123 29 196617 * 8.;
#P newex 363 123 29 196617 * 7.;
#P newex 310 123 29 196617 * 6.;
#P newex 257 123 29 196617 * 5.;
#P newex 204 123 29 196617 * 4.;
#P newex 151 123 29 196617 * 3.;
#P newex 98 123 29 196617 * 2.;
#P flonum 45 40 35 9 1. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 416 167 40 196617 cycle~;
#P newex 363 167 40 196617 cycle~;
#P newex 310 167 40 196617 cycle~;
#P newex 257 167 40 196617 cycle~;
#P newex 204 167 40 196617 cycle~;
#P newex 151 167 40 196617 cycle~;
#P newex 98 167 40 196617 cycle~;
#P newex 45 167 40 196617 cycle~;
#P comment 82 42 114 196617 Fundamental Frequency;
#P connect 24 0 25 0;
#P fasten 24 0 25 1 50 425 84 425;
#P fasten 9 0 1 0 50 111 50 111;
#P fasten 9 0 10 0 50 89 103 89;
#P fasten 9 0 11 0 50 89 156 89;
#P fasten 9 0 12 0 50 89 209 89;
#P fasten 9 0 13 0 50 89 262 89;
#P fasten 9 0 14 0 50 89 315 89;
#P fasten 9 0 15 0 50 89 368 89;
#P fasten 9 0 16 0 50 89 421 89;
#P fasten 1 0 24 0 50 235 50 235;
#P fasten 23 0 24 0 421 255 50 255;
#P fasten 22 0 24 0 368 255 50 255;
#P fasten 21 0 24 0 315 255 50 255;
#P fasten 20 0 24 0 262 255 50 255;
#P fasten 19 0 24 0 209 255 50 255;
#P fasten 18 0 24 0 156 255 50 255;
#P fasten 17 0 24 0 103 255 50 255;
#P connect 8 0 23 0;
#P connect 7 0 22 0;
#P connect 6 0 21 0;
#P connect 5 0 20 0;
#P connect 4 0 19 0;
#P connect 3 0 18 0;
#P connect 2 0 17 0;
#P connect 16 0 8 0;
#P connect 15 0 7 0;
#P connect 14 0 6 0;
#P connect 13 0 5 0;
#P connect 12 0 4 0;
#P connect 11 0 3 0;
#P connect 10 0 2 0;
#P window clipboard copycount 27;


October 28, 2007 | 12:36 am


October 28, 2007 | 1:16 am

A quick perusal of any decent computer music text will provide info
on additive synthesis that you can apply within MaxMSP. Dodge &
Jerse’s ‘Computer Music’ (Schirmer) and/or Roads’ ‘The Computer Music
Tutorial’ (MIT Press) are good places to start.

In short, you need as many sine oscillators as you want harmonics in
the composite waveform. You set the frequency of the fundamental
directly, and then set each of the other oscillators by an integer
multiple corresponding to the harmonic number (e.g. second harmonic’s
frequency is the fundamental frequency * 2, third’s is fundamental *
3, etc.). Scale the amplitude of the output of each oscillator
according to the formula for harmonic strength according to which
wave form you are creating (use [*~}, for example). You then add all
of the individual scaled outputs together to create your composite
waveform.

On Oct 27, 2007, at 3:57 PM, George Stapleton wrote:

>
> I’ve searched the forums and seen alot of examples of what i’m
> looking for. The only problem is they’re not done via additive
> synthesis in the very basic way I need (in fact alot of them I just
> don’t understand what has been done to create the waveforms.)
>
>
> All I want to do is make 4 buttons which when pushed produced a
> Square, Triangle, Sine and Sawtooth wave through additive synthesis.
>
> Can anybody explain how ? For example with a sawtooth wave the
> partials are 1, 1/2, 1/3, 1/4, 1/5 etc, but how do I do this using
> say a 440Hz sine wave?
>
> I’m completely lost.
>
> I presume I start with Cycle~ 440. But then what would I add for
> the SawTooth wave etc? ( a number box containing all the partials?)
>
> Thanks for your help and patience because i’m sure it’s frustrating
> to get asked basic stuff like this but I am completely new.
>
> Thanks again.

—-
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe

Home < http://pubweb.csf.edu/~smill>
SFIFEM <
http://sfifem.csf.edu>
Atrium Sound Space <
http://atrium.csf.edu>
OVOS <
http://pubweb.csf.edu/~smill/ovos.html>
CMP <
http://www.csf.edu/csf/academics/cmp/index.html>


October 28, 2007 | 6:04 am

At 3:57 PM -0600 10/27/07, George Stapleton wrote:
>All I want to do is make 4 buttons which when pushed produced a Square, Triangle, Sine and Sawtooth wave through additive synthesis.

I have an example that does just that. I made it quite a while ago, but took your request as a chance to clean it up a little before I uploaded it. I wouldn’t approach the problem in this way, if I was doing it today, as there are a bunch of easier ways to accomplish this sort of additive synthesis. (e.g. some of the CNMAT stuff)

The example is called Partial Workshop, and can be found here: http://www.xfade.com/max/examples/

It generates the fundamental and 63 harmonics. It allows you to draw the amplitude of all the harmonics.

-C


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno


October 28, 2007 | 10:27 am

Has anyone suggested ioscbank~ from CNMAT?

On 10/28/07 2:04 AM, "Chris Muir" wrote:

> At 3:57 PM -0600 10/27/07, George Stapleton wrote:
>> All I want to do is make 4 buttons which when pushed produced a Square,
>> Triangle, Sine and Sawtooth wave through additive synthesis.
>
> I have an example that does just that. I made it quite a while ago, but took
> your request as a chance to clean it up a little before I uploaded it. I
> wouldn’t approach the problem in this way, if I was doing it today, as there
> are a bunch of easier ways to accomplish this sort of additive synthesis.
> (e.g. some of the CNMAT stuff)
>
> The example is called Partial Workshop, and can be found here:
> http://www.xfade.com/max/examples/
>
> It generates the fundamental and 63 harmonics. It allows you to draw the
> amplitude of all the harmonics.
>
> -C

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


October 28, 2007 | 10:28 am

Or gen9 & gen10 from Percoloate?

On 10/28/07 2:04 AM, "Chris Muir" wrote:

> At 3:57 PM -0600 10/27/07, George Stapleton wrote:
>> All I want to do is make 4 buttons which when pushed produced a Square,
>> Triangle, Sine and Sawtooth wave through additive synthesis.
>
> I have an example that does just that. I made it quite a while ago, but took
> your request as a chance to clean it up a little before I uploaded it. I
> wouldn’t approach the problem in this way, if I was doing it today, as there
> are a bunch of easier ways to accomplish this sort of additive synthesis.
> (e.g. some of the CNMAT stuff)
>
> The example is called Partial Workshop, and can be found here:
> http://www.xfade.com/max/examples/
>
> It generates the fundamental and 63 harmonics. It allows you to draw the
> amplitude of all the harmonics.
>
> -C

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


October 28, 2007 | 10:30 am

Sorry, Chris…should have read your suggestion more carefully.

On 10/28/07 2:04 AM, "Chris Muir" wrote:

> At 3:57 PM -0600 10/27/07, George Stapleton wrote:
>> All I want to do is make 4 buttons which when pushed produced a Square,
>> Triangle, Sine and Sawtooth wave through additive synthesis.
>
> I have an example that does just that. I made it quite a while ago, but took
> your request as a chance to clean it up a little before I uploaded it. I
> wouldn’t approach the problem in this way, if I was doing it today, as there
> are a bunch of easier ways to accomplish this sort of additive synthesis.
> (e.g. some of the CNMAT stuff)
>
> The example is called Partial Workshop, and can be found here:
> http://www.xfade.com/max/examples/
>
> It generates the fundamental and 63 harmonics. It allows you to draw the
> amplitude of all the harmonics.
>
> -C

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


October 28, 2007 | 2:13 pm

Thanks for your help – I would have replied sooner but i’m over in the U.K and it was pretty late last night when I actually started the discussion.

I love the simple sawtooth wave creator that’s what i’m looking for and should help me.

I was unaware that to add more partials i only had to do the *1 *2 *3 *4 etc thing.

Also the little Fundamental frequency number box also helped me alot too.

For triangle wave I presume it’s the same sort of stuff but with

*1, 0, *3, 0, *5, 0, *7

/1, 0, /-0.111, 0, /-0.04, 0, /-0.02

?

Thanks for all your help.


October 28, 2007 | 2:19 pm

P.P.S

I have looked up the tutorials especially tutorial 7 but it didn’t help me as much as you actual human lifeforms have with regards to partials creating certain types of waveform, it just gives you examples of how to add whole (cycle~440, cycle~450, cycle~460 etc) tones together – no exact routes in creating square , triangle waves etc ((though it does talk about presets)).


October 28, 2007 | 8:28 pm

Hey guys, an update. I have created a square wave, and sawtooth wave. However – whenever i join them both to the DAC and hit the "X" button . . i heard both at once. So i’ve split them up…but what would i need to alter to make the patches have a button each that plays the sample when clicked?

http://img144.imageshack.us/img144/4438/firstpatchxf1.jpg


October 28, 2007 | 9:01 pm

keep in mind that those [0 ] boxes arent doing anything. To get an amplitude of zero out of the cycle~, use [*~ 0.]. Same with the frequency (use [* 0.] ).

However, if you are not going to use the cyle~ for that waveform, simply don’t include them! All you need is the cycle~’s with the 3x 5x 7x etc.

What you are asking about turning signals on and off is a pretty basic question. I would suggest looking through the MSP tutorials (again?) so get a better hold on how signal flow works in the program. As a hint, take a look at gate~ and/or selector~. You will get a lot farther a lot faster if you have a firm understanding of the fundamentals rather than asking (and waiting for a reponse) on the forum.


Viewing 14 posts - 1 through 14 (of 14 total)