How can I transfer my makenote velocity and duration to phasor's signal?
-
phasor-makenote connection
-
I think makenote outputs a midi note number out of the leftmost outlet, and phasor~ needs a frequency value. So I suggest putting a mtof object between them.
I don't know how you can get the velocity to a phasor, maybe it can be scaled to a volume control.
For the duration, maybe send that to a delay object, and when the delay object is triggered it can send a 0 frequency into the phasor. I hope this helps
-
@mkdewolf I recommend you take a step by step approach from the bottom up rather than from the top down because the first way you only have to learn one small thing at a time whereas the second way you have to learn many things at once. If you approach it this way then if something goes wrong at one of those small steps, you can just examine the few things you added or changed to find where the problem is.
Start by simply controlling [phasor~] with a frequency slider. Put a number display box between your slider and the phasor so you can see what's going on. You will immediately notice that frequency is different than pitch, and that a frequency of 10 sounds more like a beat than a tone. Next you could look for a way to convert a pitch number (i.e. MIDI) to a frequency. @nicnut suggested something you could use. Next take a look at that tutorial I suggested in your other topic, A02.amplitude.pd. The key insight here is that you can make the note turn on by taking the volume from 0 to some positive value, and the positive value it ends up on represents velocity. Conversely, you can make the note turn off by turning the volume back down to 0. The timing between when the note turns on and when it turns off is your duration, so you would next need a way to automate that. A delay from when the note turns on is one possibility, but you've already discovered [makenote], so that's another way. @nicnut's suggestion, setting the frequency to 0 after some delay, is another possibility for note off but I'd bet that it has side effects you wouldn't like. (Or maybe you would--that's up to you!)
Even if you do all these steps, the result will still be pretty crude, but you can continue refining one bit at a time and get closer and closer to something good at each step. You can get ideas about how to refine your patch by looking at some of the other tutorials, e.g. C10.monophonic.synth.pd and J08.classicsynth.pd. Once you have something that you like well enough, then you can add note-velocity-duration sequences (maybe using [text] as @whale-av suggested in your other topic), and finally, you can work on generating sequences that are serialized.
PS: if you're really only interested in serialization (and don't really care about making a synth from scratch) then there are other options available to you. Reply if so and then I or someone else can suggest alternatives.
-
here is the answer to your question - makenote sends the note on the left and the velocity on the right as midi 1-127, then waits the delay and sends the note again with 0 to make the note off, so you can just use that to make a cheap envelope using [*~ ] after the phasor where 1 is on and 0 is off
feel free to play around with it howtoDonkaDonk.pd
-
@fishcrystals @mkdewolf
control rate [line] output updates every 64th sample
signalrate [line~] does continuous ramp on each sample