[cycle~] and phase...

    May 15 2010 | 2:57 pm
    In first, sorry for my english, I'm french...
    I recently started MaxMSP via live, building a small synthesizer and I block the use of the object [cycle ~]...
    If I understand correctly, [cycle ~] generates a continuous signal. Then, it works with the envelope, ADSR for example, via a midi signal to control the attack and the duration of the audio.
    What I want is the phase of the signal generated by [cycle ~] resets, or rather parte exactly 0, each trigger a midi note, so as to have an identical signal attack on each note.
    And if possible I would like to address this attack: 0, 0.25, 0.50, ect ... to 1.
    Thank you in advance for your help!

    • May 15 2010 | 5:39 pm
      as the help file says, the phase of the cycle~ object can be set with a signal or a floating point value in the right inlet. If you want it to start at zero, use a trigger object to send the value 0. to the right inlet of the cycle~ object whenever you trigger the note.
    • May 15 2010 | 6:15 pm
      Thank you for your reply.
      I started with MaxMSP, and I can not apply what you suggest.
      I send you my patch. If you can help me, it would be really nice.
    • May 15 2010 | 6:17 pm
      Je t'envoie également un schéma de mon problème, pour mieux comprendre.
    • May 15 2010 | 6:18 pm
      I send also a diagram of my problem for better understanding.
    • May 15 2010 | 7:15 pm
      bad bad jazz indeed, i spent a while staring intently at almost exactly the same pictures thinking fuck! what is going on?
    • May 15 2010 | 7:16 pm
      yes this is a silly confusing thing that is not explained in the docs (and works differently to pd's osc~ object). When using a float in the right hand inlet of cycle~ it sets a phase offset, but it cannot be used to reset the phase of the oscillator. If you want to reset the phase you can do so like this (i think):
    • May 15 2010 | 8:12 pm
      Thank you very much for your answers, specially at Oli Larkin, for his patch!
      It works! Now the attack signal is regular.
      But how to control this attack, 0-1?
      If you can help me again, it would be great!
      I send you another diagram explaining power.
      My project is to create a small FM synth to make micro percussion, with precision, so the control of the attack signal is important.
    • May 15 2010 | 8:31 pm
      There is an easier way to do all this :) Unlike cycle~, phasor~ does update immediately to a new phase offset.
    • May 15 2010 | 9:13 pm
      Thanks for you reply
      But i'm not very gifted with maxmsp, and i don't know how to connect your patch on this patch :
      sorry, i'm really a newbie...
    • May 15 2010 | 9:21 pm
      Don't worry about being a newbie :P everyone starts there. I recommend going through all of the tutorials if you haven't already. I need to finish doing that as well!
    • May 15 2010 | 9:47 pm
      Thank you very much!
      It's really nice.
      I try to move to the FM synthesis now, to modulate the signal with the same regularity...
      Surely I'll post my new problem(s)a few days ...
      Thank you
    • May 17 2010 | 3:25 pm
      the usual way is to "play" the cycle obejct from a [phasor~] - which accepts signal for the phase.
    • May 17 2010 | 8:16 pm
      Again I ask you some questions ...
      So my plan is to make a small FM synthesizer with ADSR envelope on the first frequency and often one on the modulating frequency, and a control signal for the attack (phase, 0-1)on each of two frequency.
      Thanks to Tim Lloyd, I managed to control the attack signal (phase, 0-1 ...) with the [phasor ~] box. The signal then resets each time I play a midi note.
      But now, how to control pitch independently of the midi note played (+1,
      +12, -5, etc. ...)?
      Because if I plug a box number on the left inlet of the [cycle ~] box, (frequency), I lose the control of the attack signal (0-1).
      And, of course, the siganl is not modulated in the same way with the right inlet (phase) with the left input (frequency). How to modulate the signal with the frequency without losing control of the attack signal?
      If you can help me (again), it would be nice!
      I send you my patch for better understanding.
      Thank you!
    • May 17 2010 | 8:31 pm
      I have a Simple_FM_Synth example on my Max Examples page: http://xfade.com/max/
    • May 17 2010 | 8:39 pm
      I look that!
      But I would like to realise my synth!
      I want to learn!
      If you have an idea...
    • May 17 2010 | 8:50 pm
      If you simply need to have a variable midi pitch offset parameter to adjust the range of your midi input, then you need to add whatever value before the FM process, ie right before the [mtof ] object. It also looks like you need to go through the FM tutorial patch and Chris's example so that you know what is actually going on when you start enveloping parameters.
    • May 17 2010 | 9:07 pm
      Yes, I left the tutorial on the FM synthesizer.
      But if I connect a number box before [mtof], it takes the value of the midi and is not controlable.
      Finally, I lack this parameter to be able to make a basic syhnth fm. I think I can then build the knowledge envelloppes with the tutorials.
    • May 17 2010 | 9:18 pm
      ....whisper ...."tutorials"......... :P
      The reason for the trigger object will become clear after some more tutorials.......
    • May 17 2010 | 9:29 pm
      Thank you
      few moments before you send me the patch, I came to the realization that simply use the [+] object... :)
      and it's better with the trigger object
      thanks ...
    • May 17 2010 | 9:40 pm
      And for fm modulation the [+~] object is between the [t f b] and the [phasor~].
      Thank you very much, Tim Lloyd!
    • May 17 2010 | 9:53 pm
    • May 17 2010 | 9:56 pm
      I just wanted to do that.
      Thanks you everyone!
      I can go to sleep now...
    • May 20 2010 | 9:04 am
      btw, there is nothing wrong with doing FM with free running oscillators, try it out,
      you might like the variance in notes with hard attacks.
    • Nov 30 2013 | 6:47 pm
      I think I can clarify a couple things for you.
      1) When an inlet is capable of accepting either a signal or a float, as in the case of the right inlet of a cycle~ object, and a signal patch cord is connected to that inlet (say, for example, coming from a phasor~), float messages are ignored. The signal and the float are not combined in any way. You can use one or the other but not both.
      2) It is more correct to think of the value supplied in the right inlet of cycle~ not as the instantaneous phase, but rather as the phase OFFSET that is applied to the otherwise independent operation of the cycle~.
      Some examples might help to make that last sentence clear.
      a) A cycle~ object generates a cosine wave at the specified frequency and with the specified phase offset whenever MSP audio is on. A cycle~ object with no frequency specified as an argument and no frequency info coming in its inlet has a default frequency of 0 Hz. Likewise, its phase offset is 0 by default. Since its frequency is 0, it does not increment through the waveform at all. So, a cycle~ object with no arguments and nothing connected to its inlets will generate a constant output signal of 1 (the 0 phase position of a cosine function).
      b) A 0 Hz cycle~ with a phasor~ connected to its right inlet will be totally controlled by the phasor~. Its frequency will be equal to that of the phasor~. Its instantaneous position within the cosine function will depend on the signal being supplied in its right inlet; when the phasor~ is at 0.5, for example, the cycle~ will be sending out -1 (1/2 cycle through the cosine function).
      c) Each time MSP audio is turned on, cycle~ starts at 0 phase plus whatever phase offset is supplied in its right inlet. If a cycle~ is running at some nonzero frequency and you later send it a float phase offset of 0 hoping to set it back to its initial default phase, you will be disappointed because all you have done is change its phase offset (or not changed it at all if its phase offset was already 0) relative to where it was in its cycle at that instant; it will continue to run from wherever it was (offset by whatever phase offset has been specified for it).
      d) A float message in the right inlet of a phasor~ object is different. It does reset the phasor~ to whatever phase you specify, at the moment that it receives a float in its right inlet. So let's say you want to apply a sinusoidal vibrato to a note, and you want it always to begin on the center frequency of the vibrato. You would therefore want to ensure that your LFO is in sine phase at the moment the note is played. You could control your LFO with a phasor~, and set the phase of the phasor to 0.75 (specifying sine phase for the cosinusoidal cycle~ object) at the moment each note is played.
    • Jan 05 2014 | 11:34 pm
      this is all very good information!