<div dir="ltr">Yeah, thanks José.<div>Is truly a good approach.</div><div>Another thing i've to think about is how to deal with envelopes retriggering at the voice level.</div><div>If the same note is retriggered i guess the approaches can be</div><div>1. "Hard" retrigger. Quit the previous envelope and start the new one</div><div>2. "Not so hard" retrigger. Retrigger the new envelope starting from the same value reached by the previous envelope.</div><div>3. "Soft" retrigger. Make a very quick fade out of the previous envelope while the new one is starting (but this mode should allocate a new voice so the 128 sized array is no more useful)</div><div><br></div><div>a.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><a href="https://elgallorojorecords.bandcamp.com/" target="_blank">www.elgallorojorecords.bandcamp.com/</a><br><div><a href="http://soundcloud.com/alfonsosantimone" target="_blank">soundcloud.com/alfonsosantimone</a></div><div><a href="http://www.facebook.com/alfonsosantimone" target="_blank">www.facebook.com/alfonsosantimone</a><br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 3, 2021 at 11:44 AM José de Abreu <<a href="mailto:abreubacelar@gmail.com">abreubacelar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">i had supercollider in mind too, since clone makes it easier to have 128 voices around, and this example is something they do in SC tutorials (except the sustain pedal part, but i like this state approach)<div dir="auto"><br></div><div dir="auto">and not an overkill since switch~ will help, just a different pattern than relying on poly for tags, clone just works as unique tag per voice out of the box</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em Dom, 3 de jan de 2021 07:16, alfonso santimone <<a href="mailto:alfonso.santimone@gmail.com" target="_blank">alfonso.santimone@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Thanks Jose',<div dir="auto">i used a similar approach in SuperCollider with an array of size 128 for all the possible midi notes. Probably I should build some abstractions to deal with array scanning. And to limit the polyphony to given numbers use another array of size 128 with voice numbers tags. I'll see.</div><div dir="auto">I'm doing some experiment with [else/voices] and [else/suspedal] to. Alexandre Torres Porres is doing a very good work with Else lib. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 3, 2021, 01:35 José de Abreu <<a href="mailto:abreubacelar@gmail.com" rel="noreferrer" target="_blank">abreubacelar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">maybe you can do it without poly at all<div dir="auto"><br></div><div dir="auto">you can clone an abstraction 128 times (and use switch~ to make sure the ones without trigger doesn't use your cpu) then voilá, you have one address per note in midi, if you want to retrigger you just... retrigger it, yay</div><div dir="auto"><br></div><div dir="auto">about sustain pedal, i would do this trick: i would create an array with 128 entries and use this: if i press a note, i give the array value 1 at that index, if note off value 0, BUT IF the sustain pedal is pressed instead of giving 0 at note off event, i would give it 2 and prevent the note to die, soo, when i release the pedal i check this array and all the notes that have state 2 will be released. The ones with state 1 i am still pressing so nothing to do. What do you think?</div><div dir="auto"><br></div><div dir="auto">about retriggering, if a note have state 2 and i do a note on, i retrigger it and give the state 1 again so sustain pedal doesn't release it afterwards</div><div dir="auto"><br></div><div dir="auto">this way you don't need poly and bag, but will need clone and a separate interface with arrays and untils to simulate the states of a note (0 for no sound and no press, 1 for pressing, 2 for not pressing but sustained by the pedal and ready to be released)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em Sáb, 2 de jan de 2021 14:41, alfonso santimone <<a href="mailto:alfonso.santimone@gmail.com" rel="noreferrer noreferrer" target="_blank">alfonso.santimone@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Christof!<div>I surely hope that your proposal will be heard. Those would be essential additions to vanilla's [poly] for polyphonic instrument building.</div><div>As for the [bag] object i tried but in the way i built the patch it only works if the sustain pedal is pressed before note on arrives. I have to find a way to make it work the same way when is pressed after a note on.</div><div>The same note retriggering is  another essential feature.</div><div><br></div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><a href="https://elgallorojorecords.bandcamp.com/" rel="noreferrer noreferrer noreferrer" target="_blank">www.elgallorojorecords.bandcamp.com/</a><br><div><a href="http://soundcloud.com/alfonsosantimone" rel="noreferrer noreferrer noreferrer" target="_blank">soundcloud.com/alfonsosantimone</a></div><div><a href="http://www.facebook.com/alfonsosantimone" rel="noreferrer noreferrer noreferrer" target="_blank">www.facebook.com/alfonsosantimone</a><br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 2, 2021 at 6:29 PM Christof Ressi <<a href="mailto:info@christofressi.com" rel="noreferrer noreferrer noreferrer" target="_blank">info@christofressi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Not a direct answer to your question, but I've proposed a few
      additional features for the [poly] object, including a [sustain(
      message: <a href="https://github.com/pure-data/pure-data/pull/661" rel="noreferrer noreferrer noreferrer" target="_blank">https://github.com/pure-data/pure-data/pull/661</a></p>
    <p>For implementing a sustain pedal in Pd vanilla, the [bag] object
      will probably help. Unfortunately, I don't have time at the moment
      to come up with a full solution.<br>
    </p>
    <p>Christof<br>
    </p>
    <div>On 02.01.2021 18:07, alfonso santimone
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi all,
        <div>i'm trying to build a polyphonic voice allocation patch
          that include sustain pedal (MIDI CC(64) ).</div>
        <div>Is there any abstraction that i can look into?</div>
        <div>My problems are :</div>
        <div><br>
        </div>
        <div>1. How to deal with [poly] when the same note number is
          received (i.e, three C4 in a row)</div>
        <div>[poly] always assign a new voice slot to the incoming
          notes.</div>
        <div>I'm trying to make it assign the same voice slot when the
          same note number is received consecutively. I guess that i
          should mess with some arrays keeping track of note numbers and
          voice slots.</div>
        <div><br>
        </div>
        <div>2. How to deal with sustain pedal.</div>
        <div>In the "real" world as with keyboard instruments like
          piano, rhodes etc. the sustain pedal is used in different ways
          but the most common one is to press the pedal
          immediately after a chord or note is played and then release
          it when a new chord is played.</div>
        <div>It can be used in more "effect" oriented ways.</div>
        <div>Is there any patch or abstraction that i can look into? I
          guess i should use a combination of [stripnote] and
          arrays/table/list to keep track of the notes on and off
          events.</div>
        <div>How this can be integrated with a polyphonic voice
          management with stealing algorithm etc. etc.?</div>
        <div><br>
        </div>
        <div>thanks and all the best<br clear="all">
          <div>
            <div dir="ltr">
              <div dir="ltr">
                <div>
                  <div dir="ltr"><a href="https://elgallorojorecords.bandcamp.com/" rel="noreferrer noreferrer noreferrer" target="_blank">www.elgallorojorecords.bandcamp.com/</a><br>
                    <div><a href="http://soundcloud.com/alfonsosantimone" rel="noreferrer noreferrer noreferrer" target="_blank">soundcloud.com/alfonsosantimone</a></div>
                    <div><a href="http://www.facebook.com/alfonsosantimone" rel="noreferrer noreferrer noreferrer" target="_blank">www.facebook.com/alfonsosantimone</a><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
<a href="mailto:Pd-list@lists.iem.at" rel="noreferrer noreferrer noreferrer" target="_blank">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" rel="noreferrer noreferrer noreferrer" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" rel="noreferrer noreferrer noreferrer" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" rel="noreferrer" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>
</blockquote></div>