tehn's 'Max5PatchingChallenge' Solved (using gen~ in Max6 :D) - "Switch And Ramp"

  • tehn's original discussion here:
    http://monome.org/community/discussion/9084/max5-patching-challenge/p1

    searching for realization of this technique, called "switch and ramp" for 0-delay/clickless playback-position-retriggers:
    http://crca.ucsd.edu/~msp/techniques/latest/book-html/node63.html

    got me thinking lately about how to do it in gen~. gen~'s 'history' object makes this possible much much more easily.

    i'm 100% confident that this is the switch-and-ramp technique:


    ----------begin_max5_patcher----------
    2389.3oc4bs0baaiE9Y4eEXzKtM0Vl.f2T1ocl9v9Xm1Y27Vb2LTjfRHlBPK
    HoSbyD+aewEJYpa1fTjpTy5IQxDf.7b9NWwAf9aWMZ7L9WI4iAuG7QvnQe6p
    QizMoZXT00iFuL5qwYQ45aaLi7E9rOO9FSWEjuVnat..W2VJmUjS+KhpcHZh
    SUyrxkTVFoPOMvpFWEUDufxl+IAItvPF3voxw.fPn5Kjq9SmINf+7kIhWVr6
    LQSzzgj1t0sNkvhVpojw+pfFkstGyDT7zJh4gNlxjO9+T042u5J0G2XIdDyW
    tjHG7t.xulVPDfhRASxd.NCDUlP42.VIH44fGHOkCffhEhRPnp2m3kBfbtVU
    pFlr6Y7HQBnfCJH4E.I8BVkE8zrn3G.q34zBpbPBRgfNeNQju9wmQYjXdISS
    C3WWfjJlOS0jSKDQS7jRHGinwS8kavQkPN6KgvnWQD0BgvRIlFMmrmPPPjfV
    LoIZlnWgsm5q4Xshoml6ggMQwD6zBMy1oVdDyzLdTxrH17NxV0EpsUC03huS
    yMUQgs.QzLPmZrd6uLturUfdS0FKd30nyqhQGvXAEzsFKGCD9cF3mAKHQBv0
    yIrmA4Lw0JGORWR2bO62SSW2sfLuLS9cbFM9gmptkC5AB0WnpqFSQlHEApYD
    fcaDn52sf5Qr29olEV7Ub9.CL7bngYQpKZns1YMtXAe97rMdds1ZohK87rxZ
    4PbId7loWH4QY3zOQXQyxH00D5N97HB9bRljo3hmAnln.feSnA4Fp.kf1.Mv
    Vn.jSmyjc2kXSAHELqih.gb0VBlbFeSqBzA.k1DSNUFGU5w6TBEcDr4c.nLN
    ZfmeniWG44nBh70NNLtOZldCbZqgntEZbl.QcEp34XRfCqMmbm1BXIXP.KTV
    J+Y8pD51j5pV.FDheCipvC.M3SwnJilq+dSC17Kcq2a57mAvIckOJOecPMiE
    nqeKT0PCCO22JMT5VuRX+1lNCDdNSm4H.hbg5MAObdS7vrnZyZFdE7vce7Hn
    kvwMG5qtDilUllRDFWTfGoyH42F0YEKxrjbiMED9VdwOP7euAU3+4BN+QRyc
    mieauOlTjBBZNDgauymaNM2Pj+JIJ94wsaoRHStNtdq+z9UG52gKATuJ4m6J
    8criY8QZ2DtvVrHfgQjDUEF5pHIFEbDTqZOE2hvqmBlTmvHhJjnBJjyHMi7H
    QjS4rZO7QiiVspVyipMDE98Ytdh7uYSSTloImMMIHORWO9PSiRoxUq67EzQW
    atoF8EMD4hpU0Ro7adLOyL6eTlh8zap8Ab6aLiG+.IoNcLluhvnLUUsIrhnh
    JBZS2IjznxrhOcXY718mpJU6wF7AEKijNLoIblhH1ZjplW+3T0fSGdvqNynu
    CVzpCL3bIeTlOKRn.3pBGfV2YAmmscWajoRCgHFcYTAofZHVjylIktbkfZpJ
    1l1L0kXQdrfmks0TY54wCzShTrGS9BMoXwVkNS0i71oqVKBFuAiRnyUgS1ps
    hn44a2xV6DTc8w5V3a09qVWwsM2+vBZNP9uhEDv8i+2egJMV.QrDv+JZ4p6G
    Ki2EufQ+ukDPpfuD7azrLh.7GkR0shBx04fYb9C2HG5GVP3hmzC8CqGSNfmB
    9mp5sH3LZL32Jyow2O982yVTTr582cWrHNZRYbdxDRR4cOuLe0cadf42kEoh
    1dm5Ib6hhkY2w3IDe7D0uC9gXAQ1eBfx.5phN6IfH5yQ+Xc1bqZd5Vqiin0e
    vZedz3.GMLmYY857m8CWWA9MZ3GMP2w798ZUCczZG+UtY5AUj+iR235znDx0
    .AQlwXtd2ujMpZynWDwjh5zbhLORiySkjWcKeI5QRJWrDn2fL43bptw+9ESH
    nNaDLppdCSaujBMLjTRZclz5TB84Rq2Lk8mTb.9xBpzndi.KeAuLKAHmwhMa
    uxe+hAnuN+fon1KEld9jBak7z1BA0NBumk6QPuFgS5x8fC04Tg2a0B1CSAAC
    BbRjWNqe.poZetnPOER45ZARAOBR4+FHUsdO11C2+.46.XTOBiN3pBA0dXDe
    I.ihD5i8o9HzrBeWmS.HQWB.oI1iPlbVa.SG6.SO8xsCNEvDdI.lwYzUxbl5
    S+jd5CMz9azRCfRmKAnLJNtbYavQjc3H14v6hf83nevk.NVDwVze42XNrR3S
    HpM7h.EIeck.PSA+.kAA+xOKWFK5GAeSROPf5B7sTl682+O9NfjkSp2wOU0g
    7+GM4cbKDOtVIdLGpPHBs6YKrAxmKhrphlkmPSS6A+EPjornlDq7OAM8vKiz
    AVHWcXefiAPSI20Ea2EeBwu9+abznO1A33Egg8BZdAW7TODAasBY0Au9DRDv
    6R.Hor1kVpiUpilMFAeBI3CctPPQTOfh3.SzkPST6S.EuHVlz65w3zXOSYh2
    8jez.Lr6W29K6WlJwuir8PZlR0+gA2bdoHd8iYc8E.ayeIj7BJay1G9wWpny
    N23BZRx1aWmYGtxU6WlYmIsRUnwzL1RZVs3pABMqx.1JZFNfn4.a0MFNzbns
    vLZ3nN62DZFNLnYnspFCHb1wVZ1e3PyVRxgCGMCaUl8sjjWRSVworhp.dvPy
    QgNTm3sevDr5G+pV19A26Lqu0dHcFLpT9MPk5xhhg1Z2tqJk4fOCM6dHFu4h
    yr1jmsJSCmLDPMQzfGFzLrAvbKbPgCMGdbyKlc0qjs9pyr5j0Lp+owoHj6j.
    sgi6KWNX40SSnV8hAX1wB8UmaF0oAL5.wIgsjr2I49dp657BptXnJYz9BQsO
    LExDfxANwW8iaUSMhcqJvfokpSQtdB1t1BlCU9tHQ0QKeODvsN.bDlGs0Z22
    mw2yvaZXcCuP28L71mW26TwaKCfBsfCbaFCnNf25JDq2w30riS8+VUzgLfEz
    OrtGvCP+cG0DXC0.eC3r6HGrkfy4gZf1HqvmOxQ8n7eKzI37QOPajVSOezyT
    abt4b1nG8iB9VzSybUg70K.BBcMmGCSRNP29wUkSGn+uKC3gL4.DnSD02eyU
    8ACXiFp+4SgvVxAZOdVEtEU8N7U8GYJ0U8.dZC8qYRTSznM6Hqq4nrh81bUO
    v.XaY.XyYfp+.r4XdWjgv9wjzJNv87oR6ZKhdlnGaRODdFiYGXaLxFnw4Yzw
    f95itLNDqWa+NWZ7yhMuKed8j4jMAH7ZIXaVqyNu3mJJYmW3ycdYO28E8TNa
    e+p+GUAxYPC
    -----------end_max5_patcher-----------


    However, there are cases where even though the waveform is offset to create perfect continuity, the new playback position(after being offset to the old), thereafter may rise or fall above 1. or below -1. which causes clipping. So i added soft-clipping(tanh) to take care of that which is a dirty solution but seems to help nicely.

    No clicks, 0 delay, but just a little dirty if you're wanting the highest resolution in ambient music or something...(in which case mlrv's crossfading buffer~ still sounds better, i think...)... if you want it to be smoother, you can also go into the gen~ subpatcher, and change the "32" to "64" or "128" or anything larger(however many 'samples' you want the crossfade to last... uh... which is not actually a crossfade... i'm not sure what to call it... maybe... "offset-fade-back-to-normal" :p)

    Anyways, great tool, i'm gonna use it, works best on envelopes over predictable waveforms, but still much cleaner than clicks and pops no matter what the material to my ears.

    Hope it's useful to some folks.

  • very nice :D

    your killing it today with these gen~patches..

    *needs to find 100 bucks for gen~*

  • hey, thanks stevieraysean!
    ya, this is one, you'd need gen~ to check out(i never could figure it out properly using the regular max objects like snapshot~).

  • I must have spent the best part of a day on that problem, to no avail..

    I am however able to paste your code and use it. just can't edit it. this will make its way into my patches for sure..




  • ----------begin_max5_patcher----------
    1981.3oc6b18bZiCD.+YxeEZ3k1qWBX4uo2zN28v8Xm4l65aIc5XrEfZLxb1
    hjlqS5e6m9v.1TBXnIf.1LswwRx1ZWsqzJ6eRe6hVs6m8URQazaQWiZ05aWz
    pkJIYBsJOuU6wQeMNMpPUr1Lx8Y8+R6K0YwIekqRdHg8czuyo7TBBaY6Nq.r
    oiorTBWcw1KRLaJeVp3xTGjw3rnwD086OxoQoytI5ByeXBQWSaWPGxDYi9TY
    AlDwiGQYC+bNIlqKiqeGuKQXmfNVWJqQxC1VcrleMzD0CRHLWE1tRUnf9epG
    CVdIUt8j7RsRoZQTZZJ4NRdAMiUQNZ0NZxjJI2pxkH0keISci7ubdRTlNIq4
    IkStiN65C0I93Eyt8Kjw.kv445nNXqjQWbuEBonwbXbVp91eMxpSuKq7Kb8B
    llEeKIoZEoc1DBixljSJHLdDurFMO6Dxfnoo7OuZ0V87GDESdxKdkM6sZOLm
    ljwjUhZWoL4YOtqQXOUKrWUgQUBVzjUbwEB4XZQ+nboFteJohcovbNKKsdVy
    aTEdEQL53HNgS0UVaq42T53I4TFu1ChvhD2iQEw4Yoo0tU5btaE4jHZ2iI2S
    S3iT2qppRQwoSl0DzdtNJgNjTvqmFOZXQ8Tp4lW0frp6dszWmaecWedDaT0L
    p4xiqmwO51udW+U69O2w+ob9scjN+N18jlFNtK66ur+uSu1KUYpZMOKmGu3h
    Y+wk6nVLNa7XgmzJUiebDs.I9GeDAcS6+4dpPpPQrDzeGMdxMsQbR7HF8emR
    PCxyFi9.MMkji9qoBmVNm7pBT+rrauTboebDIK+A0k9wYWSAJa.5OSEJn7LF
    MF8goEz3aZ+1aXi37Iusa2373nNSiKR5PRl186iKlzc9Crnapvruf2U9DtZD
    ebZWVVBw2oi7uQuNNmHxOAQYH0v.8e.kG8kneopXlRYj3roZeD2lXsLHeX+5
    NA+nMjUisgVgQRnp2yYFI9gxC9qwJAa.FIuZPTB4Unbx.w.LHdlxZQll1nHh
    IZmGTP3nxAfjM6xhbezcjAY4iQ8ihuUdcVkE7IaibLh1HawfZBO4vP0f49X0
    HbAOcajsAzFUH7WEtlBWhtxHgPuCITH8E9ph1BcdB+bNhGcKQ0DpZ9t58Ft2
    hsvcQ1mJVGOk6l7V1WcotlAlDhNBuCiL8yomzC8DpB+TG845F5IH3vqmxKl1
    emTTujCg6DhU97A8jGb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lQS2FPSGPSGPSGPSGPSGPSGP
    SGPS+4BMcQXP.Z5.Z5.Z5mGnouXVO.Z5.Z5.Z5.Z5.Z5.Z5.Z5.Z5.Z5.Z5f
    dDPSGPSGPSGPSGPSGPSGPSG11zgsMcXaSGvN6DEHPXaSG11zORQpF11zgsM8
    y40gCrsoCaa5vpxDVOsmjaa5X6PCAMcW6MilNFPSGPSGPSGPSGPSGPSGPS2b
    QS25HCMcQXPmhnoKeI5.a5.a5.a5Kwl9ho8.roCroCroCroCroCroCroCroC
    roCroC5QfMcfMcfMcfMcfM8SR1zgsyaX67F.zA1NuOVoTC1NuALZOmAbF1Nu
    gsyaX67FVWUvRdC1Nugsy6WhnogEu8Nxlt51tLY0xp8RDUuDM0KSRs3t83E+
    Ow22V9B
    -----------end_max5_patcher-----------


    hope that works/helps. so glad you like! :)

  • and here's another version


    ----------begin_max5_patcher----------
    2822.3oc6cs8aaaqF+Ym+JH7KcqKWDuna8fMf8vdbXCmSeqYnPVh1lMxRdRx
    oMsn4u8CuHoX4HKQkXKyB3f13PRI4O9ieWI+H02tXxzYoeglOE7NvG.Sl7sK
    lLQVknhIkkmLcUvWBiCxkW1zD5mSm8ooWpZpf9kBY0E.XUcIaVwRhoExqGVV
    47zjhb1Wox5PWa8z0ltoX2KVUUwCqoJJaJKg+s7OkstNnHbIKYwGyngEpKfX
    Q3OR9C1Q7ARV.YcsU88vhjTImxuhLcKRJIXk76X5umwBhmJZ36Wbg3WWpIdD
    ltZEkSd6BH+97BZFnXSVBmTAoIffMQrzKAqyn44f6nOjCffhkYa.dhVeHcSF
    f+rVuQba7lmkFjEAJRAEz7B.GQ.qiCdXVP3cf0o4rBF+lxnEYrEKnY4Ue8wr
    DZX5lDIMfe0CHU0NOawLY45qqkAAa701bX2VA9xOHtsOFfQG1AgUbLMXA8YC
    BYTNnERakyDcP3L6lsDBEn.VxUZaIYQ81ChXcXQj8HlFmFDMKHYwQTVU936D
    UvJgUKI33X0kvJxabjVu52lNtBKPWhPZA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hY6gqe1
    BpIHBMBP7sFEHJklItdRg59gPKi.BWy1KFZM9XHw2Qw.519znu20k5Le3SXn
    Z8LwNZpPrdUnN0lU1uwY7IPZlGhIRHOaaIEqc5kUz1Hfw54KzHjmqQwxzhA1
    KJRNacde9Ih8zTf1L7vIuC+DgmN0hdNpkhrWNQyvEGSKlErxxrWIKYunn04X
    VZyUQx1nXuRz0qs4YdwV3EscziWD5cFE2Oun1nnY3mSV9lY.nIYfA6oRjNjL
    .PBoOfz+LN1oXst3HzLb2IXVtIhhVpYGq2HogjyrisqezydPrimwwtsynKNd
    VptCPTWoZz3AhMSo6ln36WxxA7+UrjBtc5+6yLdGCDjDA9uAqVe6TPAMbYB6
    e2PAyyRWA9SVbLMC72aBuiCOz2jClkld2k7a88KooYOHu02WcO4fz4f+Pjoq
    YoIrPvetImEd6z2caxxhh0u6laByBCtdSXdz0znM273p702T+EleSbfHMGtQ
    7Mb0xhUw2jjFQcvWK9avOElQ4sGAXI.YBoO6APVvmB94s6lMR2bxAkaowT1r
    a5mu2bLPFOgZhTUI2uSWJ9MB4LwtK5.qtxRmoq21hnVCt9jjbcOqWuq4UoLV
    190q6ZFS27aA1PjIhikKAmeu3nYXfLKhcuQxPBcUoYTu1HcQlwzkxMExs5ws
    1XTKHWIXRjds41OXZFlSBiYqAVlohR0DsP5W.2Ll5zfvvMqLv02TDHgkNKLm
    iYX4l9k0Y.1bvOwRffe6W4dTh9Yv23ceHPT.eEKgb6s+muCnw4zsa3WJaf++
    850IdeiOjSUdPfUa+ZHBs6tv9YNf5XJQ5EwlO2j3zE6FE4JCH8N0oWWq7LDC
    YK4wnXT3X4dXQskMH8NE2tmwwt3G0FGMCA6kr7hzrGLIWApXHKOhJ50DlYrj
    KrjNbnx5jwN53q4LbaYJnHxn7vWsITbTosX+n34L+bu1oUGnFZrb9ufHNeZK
    CHb7aOYHuj1Ds2N3lmtIKrpWU45EnIYFQyKXI06fhO7TxptyEtjEE0bGKnRx
    +bwVFHp9jLnWVggRysPJsSyhYryPnYwTLnGMiMGZFqIM6XN3rHmszhlEIqI.
    oAMuhEsNkkTjWE6ob66QTwdhgXUZyi71QXeDDCH5J5JvDnYH5hGBMaHpaFDK
    kYfyd5ByDiAl0ljMGEjH7PnY3vU1fUIiE1QcXT33TWZj003pqaBHGiYzQjxj
    5Qy5xQsyniXemI81yRlg6UCVxhi73CxZH8UyPGkHMB0ilsLGZVWsTRlOyflQ
    1CwE+WfVJjmixIHWT4FkopvXKEnsVJyw6Bj6Pzr9BFcrsjm4B3xiJJOkRJa7
    n6uJhLD+nr9wRdGYNgGqsd0VLPdpnYcMUKGOLDSA3gPylALqqDHzbhjAODR1
    Pl2DMIY+WlamPO04DkuZiUh8cqNcUGc2N0smBIuttpmZZUUdVHKMxcTn1RNl
    Szo55LzKcrQchhWwFh7ImL1Psc6600SUbgkQ8cJ3B0cNjMGdPntwkJWGBzKe
    rAgqNN2cD+PJqZrUSna209UwI5qNoRUJG8Ila2zflLH3.H4WPTVDak5OBRc.
    2UlyjieLv52QceU8TDhnB5224ohlZe800UgXO054pxmMQowtihFhZTrQHwYO
    fwlerbXB57J8iv9o8Ysrfg5tj4D2pitAZ3Z8CWTfvWnEm5XijIRli60XwONk
    0XnABZNSeiq1IQh43Diq116PlCMqsVUzKzHsJgLvPT0QK7yJgbsTNm4WWZjk
    O7FBHbHF3.+yEOUS4Qkr7w1L4wTmbx61aJO+j6IwqzIzlmS8Omxe1A4rtjCz
    UCxo4Bw0B8r6xkfT97odUif88jd4tSQG0axHUtR5r86WtCWuC4oSuCOZncyk
    uQqEV63ROXcnGxnQOXcgmAvLhT13QkmUYnxHubNJLbPc6.ng2ArKOmlrpKcL
    jXzoG3LrQ.nuZW5Udn8W9hkTT5T1AFIILcT22mBncYHbJ2m8pTjtj8vBcbvy
    FIzfNSJrNbzJeIPp8bfc4dby+3HR5qiLo03YwEpqE2QhdDbeN8QOtiG8fN.R
    LiqIowyfsVdqMh9OnI3.GGpQGu8HCSUEobkpTqMBA9ToifpJs7NbfFKpH4xW
    OhJSwxR81ATw5rya2DAsuya0jcdilr6ayD9S66W7+AnD15MF
    -----------end_max5_patcher-----------

  • thats great :D

    now make it stereo :P

  • well, it's easy enough to just have two of them

  • whoa! i'm totally impressed with your ability to go deep in gen, max, and supercollider all at once. will check this out.

  • yeah this looks fantastic. i'm curious as to CPU usage compared to the dual sample playback with crossfade as i think the resulting waveform is quite similar. i've been toying with a sampler entirely within gen~ so this would be a great way to self-contain that without extra switching outside.

    regarding the tanh shaping perhaps it's better placed outside of the gen~ patcher. the floating point math lets signals exceed the DAC limit of -1 to 1 so if you happen to be mixing more than one sound it might bring it back within the DAC limit. especially with the 64bit signals of Max6, i'd avoid any waveshaping (for technical reasons) until the final stage before DAC conversion.

    great work though!



  • ----------begin_max5_patcher----------
    4003.3oc6ck0biaiD9YO+JPzCwxYrjI.OD0jMo17v9XpZqcyawYmhhDRBwTj
    ZIo7QRk4291.MnLkLkLoNno2gtlQR.7p6utQ2MtZ9me3hdShejm1i7IxuRt3
    h+7CWbgpJYEWnKeQuEdO5G5kpNsd9wKVvix5cMdrL9iYp5+aCR3yVE5kP7CE
    928DIdU1xUY2F82FLwKU3SRePj4O+aS7VrTVYghD3myIdqxhG.28kI7zTQbT
    9SHTDw8iWEodLV5JmFGkkJ9CtrNJanQd0IylHqxXcMQqVHhB4YJhm9bk.0kW
    a9otzCHHQzrOmv8yPHgwFZeMgNxAteDpo71RbnCMH+l9ZDAJlOdxuOfZ2q.w
    E4sPQb89oDgWXO4A9qO7A4GWWQfNwKPDOKId0xdUmWn6lWFgrhohUbkeZaTf
    SvaR1SK43o2qWoLoQu0OAPzwy3IelG4MIjWDIEY7E42o75xkVl5x26EthWjj
    CDox6S.93AxS9Oxuc.HWD+AfVegF5LdzWH+8LAvmEUF+7FJdvyuL8Ny8q2sg
    jgUWIi4X4chvniTxFC0WVi1mvIULKBTqJSD4tG0vhz.OQCgZLDt.QH+ddhpw
    2yT7E87VtrP0WT3Rj.+uGqtQNWutJQDVkw5pR32KxudWrRPb9g7ClCDtiT5k
    VVxOGYZqTRoieFH.I+L+3P71CJICGecgOnadhgw92gpS4DRu3k7HQjTPClv7
    xzTz5CGvm5sJL6ykKk273S87467hKE1un2rDQPbjjH13JkUm+39UBUw1xOel
    YTmQj2xRt3TfOVkNwKQhv51gr7ClEGGt4gVKTglPdQhEdY7LARrLi02TAzXP
    fZ9qqCalOO0OINLbiaEdj6K4HAfb2m+fHHa9FlkkGANcwxbQPu0XTfXFOMay
    5x7lktYMa31pnBYQaCaT+dcissqrr4hThWT.IaNm3MI9d3yD3+ggDvtWFIdJ
    4mEgg7jKS0lRF.m8.kyLQ.2qu75.srrqIS3gwOf2qX0sKQLadl51IKUvgGgG
    M2KxmKoK4IeGmuTcNXicxzj3EjYwfsCfHjVpjdZWtTVdBXmJvKQvSIOLGZES
    V3AhO3+xC5CJjhnUhrmtZXQ9cCCb1ENvNT+K0A6NcLsaGs6xLH0R4hhYYn9x
    V46cjUg1AaYoyxt2VTcIdcuH2+g1nyYQegHk7onDhJkcFDQD4xTnVPIAZicC
    y14RBVNkv87mSjM6HdDvYkVEh.5bYf1wLdBOX3sQjai5+.mrJUpoHOVr5wPj
    1neJSBd3C7x3oSS4YWRl34em7r.yuK7BuZmxZ22dYsogxkGkoL3SsTQVQo6S
    Xa0ND1W93eb41TRtu.y2df0xxU1rACU0jphqvXOnpYaAUeG.pTGz9zqBprVB
    nhFF.9rMCt1lJEVlxffynWEbosCv8+PlJ.uxgO8rAZvOND.X+I7rG37HvQfz
    quwURSxWtP73kXzDKjlgkQPj56EJMhGvgX5BjN8gX.lCAKLGhPPG0g7JxlC2
    34wgAj9YwO3kDjppNPHwPYbCv8REJwVQC7zUppKnE.QO.QMsK2BVsfFZlXG.
    rUs2XiPch8nMXNtcnMj4cGuPvhnlfR9u.9gXInlL4I0I.GNQFGoxUNFvvfez
    PF1FDAfLTMHH5TkZf5rUxNc3Ea5emL3G2onj0BhlyPMRCVLr4M5g2zbOhR2V
    Sz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bHQvdZahIqQcLklT6F2RA0rNVJZGi
    aJkUmAEwrcPyzZL.GGxjznWFIl3JDarNiC27cKoxLpyQxoTKbLBbsetXqkWO
    NVEmwMpMMOYG13LpQMXzVhE7pRx1G0.mNVOyCr7BsUIixVH6vGfXbCfAbni7
    OKcM0hawjwstlSSN494scSkRs10Nomapy24TbCO7hUK5KWAJpzdbIoUaqSa1
    ceWoQ+eRkUwxVknRcuxT80p.QrLYOvSSI2weJUlfYmmrh3JO5Sf9jZGhsRdY
    vgmD6kfoZXYRcPtulVF58jJywsLNUnxWfIbcZlM8Px04mobrudQVY+hbedYI
    2mSjPXAfody3uPHjvAPym26rlz2wdWhMKsMxyJ+0Le7uNGybhPjczLML1KXh
    WzryZaUcJfxc8dF70ZppnnxPElaifJerdFupsJBEGNFpKq7z5T0MdwrZD.Ik
    K25rwIegXVGfw5.AFlsU4a.qZ89RfQaDrIiLkL43a+v1mgTUeGbGWUskoPyZ
    vCz9ZH0LlW9NB0QNqnNtF1m0VTZHxQ0fBaVUEHpz2DJiaHnwXHkcdQEKWbYC
    nS9tiOJXYTi.KhnoweQEiyw2jx8UcIoCejRMqQipPQp560UTkeTNlZ1LVuEy
    9xyau6yiOdVdWgcKeSdTKK2TVifKCflDMgUISmi0MOsYbkAcynN3gQo3g0qh
    GXWBrGWM735x9pLPpYLPMY0zo7DzDE4dwDd5.O5Y08utCEXaJJsxVw2m+e6F
    AqlkDGeOu9lyMqcDRZqOt3F2eTks9b8dsCchMOy+i.O+uzq5lVLd8Hkc04U+
    7OKiMbNghT06.vubdGZGbOUm6JgdbcBnYTzK+MP2404hd6dne4xYYcbtbe+9
    xkaLNPnXR8zDMAHSNVcub45d4x0fub4d2l+xtM5EYvr2WYiLS7sKYW1HaWom
    DSJqKaj0kMx5xFYcYirtrQVW1HqKaj0kMx5xFYcYirtrQVW1HqKaj0kMx5xF
    YcYirtrQV6Jaj8+y41qt7cUW9tpKeW8NLeW0kFnZ4IantziTW5Q5jsCZaQIO
    ltMVZ2FKsaik1swR61Xou+2XopavlcUFW4caCD50e296Z7tRJBzh9AdIe+hj
    Glg58CMC2UollVXlDYqhVt3N6Cm+Pqh6puWfDuXgEVU1aTEXuMMCUB6c5HGq
    pPNFuB4rEZa5pmT.7K8BXrPd05DR+aluUphEgyJbZVApwsdnIyVugSoXZnD0
    jkkNGvYUa7QOHFvX8h3VU5MhAZtVWrpXLypd5CVT8Lb3hKH1mKcFfyJw.alK
    aNu.pUUUPaH5gVA5wo8QN0n4K0AcKhYdLY1iNuz4PeqJlyMqoATbCZQwVJr7
    8rO67w.zWSAslLf037dDo1nY3ngHKcNXfJ5AqFZP4T7XbNYw7hupzaD8SOP5
    GmNzQ1qKcFn+MSrY6RAxnwLoPqT.qiqGhZMVMtdT8DL6f4pysJhIlYFtDcrY
    mGzVZKw403tQMGZyNA1+NgjCspB+Fhdph6AVMCnB6fhLw+Zfq.G6sKQwcff1
    Snpz4PWrpg1vper2V5bl.acoWkAvNxu017RR6as8t1Zqcs815Bta+0G9eXFH
    LE.
    -----------end_max5_patcher-----------


  • so many updates Rajasoft Switch&rampdows ©

  • ^hehehe :D

  • D'oh!

    That was not the last one :p



    ----------begin_max5_patcher----------
    3372.3oc6cszjihiD9bU+Jz5C6ra20CjDhGcLG14vdbhXhcmacOQGXrJa5FC
    dAb2cMSL0u8UnTfA2XaAXio73HpnvR7R4mxG5QlI+ws2LYZ723oSPuC8dzM2
    7G2dyMxpxq3FU4alrz6a9gdoxKaRD+qwS+zj6fSkw+Vlr547nWP+qrfrPNJ8
    qAY9K96IdKW8Qu0Yw26GubUBOMkOq39BCh39wqij2LQUY7Zwcmk87JNzfljF
    LOxKbB52TWvJOwyMHZ9GS39Yv0vrbdv3NDgfyOfssyOPoOXTdSAyjMPQi9dK
    bw6+o3nrHukxWzjeJIP7VTmIZ8xfHQyHsZKSTIz3j0hq7PRC9c4CASDu3JsR
    dhBCUfn3pCB4egmjFDGU4gbyDuUqpT8MUtkbj+SwxGj0ckUEDAUYTVUB+KAE
    2uCT4edawieCT4vjfC1QdvjZjefQIavJQe+b+3P34+djwCt2U4e35WXXr+m4
    yp1RlDuhGEDk2Uyix7xTMoxSOi+j25vrO1LtU+7O44y24M2XO2MSlmDLKNJu
    QT6Nyqt308dDlIAAVUhQdEQdqZ3lSEzw5zodI4P7zPdEtBA2ebbX8SU1qJDh
    7hBV5kwyBfFKwn7gFHDGB.d+x53QdhmwhT+j3vvZOJ3LeogyLSzw6y+ZvrrE
    xmUUnTb4AqJ5BlThQyBlySypWWl27z50TSqPUNxpZGpU+9zRTWSwaqV62IxW
    JruSAdxCDlPfm57f3ff6MufQkdysj4wNUee6l6YWx96V9uQc.Em4Ou81heb2
    wGCuueXnE6AaVtPfTEfFXn8EHF9l9ggDLVx.5pIFZRt.wPgRLdxp9AjXKI1Y
    ZyjGrjly2CPR6p.M8xkYToTzzjomRQJ8BjY7wii.sEUOAZJ4pgkcggTaMwP7
    EHF5GFr53.iFvH0OrJQiKPUhdSSOJnHQMmPiCghX2Nhh3KWkhTAfIGtMQZYg
    XcvgJdIZYo+rhtvTusfIsbPVwKQNw+18H7C8jazQMwEWSINhODNZdAhi8lYj
    ZYCnnkqdbizKPT7s8lYrPlVWdQxEHJtL3a8jWDaHm0G1VuI+QXWfizo2bhND
    It4JkmIGlSrqpEMN2fne7xk7nrFQwDuO48Conu54+4mUaAAJ5GP46Bw6pQuI
    ymVe0R2EuojkDVsX6CN3witzswYmuTzXP0nqcu5MLCobL8f3js8EHPcDFZCA
    1GKLQt8DG1Zhs0k3PDeDQXVGEfjorqbPb7RzrbpPmWHOwKieTvRfmz9fiSzF
    +Z0txAVMGjQc8fcW71PxPZ5dPnz3RblK99qWdTvQaMGtn0k3FWk5sPL3kixl
    tfMbAeA3f7iWwwlwQXhKZiiVWf33hfzr3jmOJLjvlubXAa1En5wfn9ZkQwMR
    zcAuMt.sWKPQROswX.i5wRuUGCeINpm2bbbvD0ZicXGL4ruWpabFrbWSbG99
    jjRyOeyfaZ75D+BLRosGU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xhFZwsWfGpXxaxW7BWWMwZUiu88ha
    S9Gvr1RraGYqtMw0z2ikxDy09x3blPLgAIRLh419GXSweb+3kvGOdocI09SO
    I5oQYqShDDKJNRHEJX5tCIEBQel+bpv.R1hj0Hm7y9rPcGJWFcc9sIN8zXuj
    YnrXTlPIWtHOZUn2yS87+LZUbZPtNOTBOKIX9bdRZihzztHRqPeYWQ9Vy2Tm
    PYhZYzHQuT.pdy4eWuPBWfZ97tIly.6yPv5.Y1qbY8FQDiSZdP73ImFF6Map
    Wz7chHxStWTwVxh.YoKKi8IrRbFaRq6.UdaOzdkOgDosPqlyPOMEw5ictjTd
    nf9hSdAQmziTIpBZHLmlC2slh+.cgFyyDzjgdBMcmfxSB4Kgs.MDintvb6nG
    lqAiOJhQjSN17FDVtIlVNFrC.QZ.MVfOXS1GWSYFFZrKQ8Fg0WLoOnhECxyp
    ljlC3wFSujicXIH5o3WP9Ihg0bXYpvfT4wxJz4G5XKSMxSLltWwP5QQLz4zq
    8NX9KaBe9No41DxzW4wPViQOVigZxX2J+8BoltalGTJYZng9ZyWIRehoYrW7
    3tlNnAHAShf4tWPpsiMznQPx7jCRSW+zS7DkRJzWBlxSu2CeDFAfZ5EpIVP1
    qBcB4UxP.lmDG+E9gToqz.cWqzE4HQHm8pKhzVczzyDNIWJuW5kJZkrlREMd
    uvh0qDUz63idvQvTVw2y.y8t7RD6+J+8L.Sov.gHvdYCKuKww75GzfqePCFv
    OnAGi7HgigJkLxzKORbIlkU64GFhxnO85GFhdyFB1mu9ggnGXHw.qGe3q1zH
    +9RFi+5hfTj3urEbzGl7egrwnWzLz+Ieaemfx39KhB9eq4nmRhWh94fvPdB5
    WVKr.mkw+gTzz33Oem3V+0E73jmk25uVbOon3mP+6707MINJvG8yqSC7+vj2
    8gnEYYqd2iO5m368vZ+zYOvms9wWVlt5wxWX5igd4aR0i4ug6WjsL7wn3YbK
    5C4+F8gn+geBWbEyPAQH4.7l9LJO2R9OqRnMsYzcM6RRscJ1bhqYWxl0oyrt
    lcI6UJsAV.V0vKtlcI6KP5dM6RdDxtj.VZcM6R16rKoR717Z1k7nfi3+JmdI
    OloyOrw074W+ymeVWymeGg74m0ql742IIWzQe0kGiz181o8y81YtPTMpBlen
    7P6g6G6L8wHJsxYa+5yq76Y5gykJWCHaHoQIKMZSLVcT3gANUdQHAaPUIKG1
    vK7vFprOobE8bMTYeR73MNX5aBEEbsnxN07hi0Hmb7jcCulyxtlyxtjxuUCU
    fTlOvK4Nl.YlEn3XUyZ+BWO2pgqm6PFtdo9wq3kdvyVdEQd3UU9upwEWiyIU
    NYTXMjsgcp1ztZflj67A0d7ThqIlb2N9kIoIWaYimRWsohgVI11zAyjsWWGa
    FqditQOdw2KzeSnFQ1aD9Lc8SEyPivTdpxjDun4JNl6wJbB2oXRi+6y77eYx
    gCDAv4wLYE+uIbxpE94SUOeR9rpO+RnsusjihB9dMZ0zNrGoEZ407cRJaKkv
    TIaUF7YLGBZGYoMumskQ9NvWWBfoQ6uVJM3vseJEV50xn.foJblZ9VGn4O7s
    FbG.S0mkcVYoS.ZZpQ6utMBM3lYpXTDRHBNvW.JSqSBATOoZrq45QFLFBhiF
    sGyVBnN.fhgncmsozI.P0h.pm+PNs.psl5aI5CnlpL0Or97TaZYoSAfZoiNB
    b6TRvLT9D.LbDJ7UJ2.e9n.hcen.VwVkbhn.pt8AFsmKBKSDJE1vwlmD8bZQ
    Ar10ETR.f2QvrJKctHfsD1Oo5UzDOGlVS8jH0tz5hGt1iVVALGt1iNVAjfXK
    3+srLgDDBnBhpx6+0KBRElfeZvNMlHvl5RcCDZmKqZcn1yvIqh0QXkLbiIAW
    2Z8NZOVs0bBjtoJRTMpUj14zvwgOFH51TfpMCogWk0EryoYf+XsF3e6H.0bU
    HTURhvn3y8xlRXXNtpIog0ZRtvZNrU7AkSWaEWPaESPaGOPhm1ed6+GfUwtr
    K
    -----------end_max5_patcher-----------



    ...and here's the simplified/Miller's version in SuperCollider(without my compressor),
    Retype the part in quotes from the line:
    Platform.userHomeDir +/+ “/xs/1/Reticynth”
    to whatever soundfile you want starting from your user directory, execute the code, and type '1' through '8' on your comp-keyboard to retrigger:

    SynthDef(\swtchrmpdemo, { | buf, retrig |

    var step = BufSamples.kr(buf)/8.0;

    var triga = K2A.ar(\reset.tr);

    var rampenv = Env([1, 1, 0], [0, 512/SampleRate.ir]);
    var ramp = EnvGen.ar(rampenv, T2A.ar(\reset.tr));

    var phasetrack = Phasor.ar(triga, BufRateScale.kr(buf), 0, BufSamples.kr(buf), retrig*step);
    var playhead = BufRd.ar(1,buf,phasetrack,0,1);

    var diff = Latch.ar(HPZ1.ar(playhead, 2), triga);

    var ply = playhead - (diff * ramp);

    Out.ar(0, ply!2);

    }).add;

    s.waitForBoot({

    var win = Window.new("KeyPressCatcher", Rect(100, 100, 200, 40)).front;

    b = Buffer.new(s, 44100, 1);

    b.allocReadChannel(Platform.userHomeDir +/+ "/xs/1/Reticynth", 0, -1, 0, completionMessage:
    {arg buf;
    x = Synth.new(\swtchrmpdemo, ["buf": buf, "retrig": 0, "reset": 1]);
    win.front;

    });

    win.view.keyDownAction = {|a, b, c, d, e|
    s.listSendBundle(s.latency, [["/n_set", x.nodeID, "retrig", e - 28],
    ["/n_set", x.nodeID,"reset", 1]]);
    }

    })

  • thank u for bumping this

  • yeah i've been looking into this lately. seeing as the switch&ramp nulls the DC offset by design, what do you think is the source of the click? even with really long ramp times i still experience a click depending on the source material. is it some kind of 'anti-attack', or some psycho-acoustic effect where we hear the DC-offset? further, if you're trying to refine the code, i'd pull that '1/ramptime' outside the loop to make the divide occur only when the ramptime is changed.

    further - i was looking through the code and you can do the linear xfade for interpolation with "a + fade*(b-a)" rather than calculating each one's linear position and adding them together.

    thank you so much for this! it's so useful to see the way people implement these techniques while i'm working on something similar for embedded systems.

  • some new code that's easier to look through and runs switch&ramp or other ramps more efficiently:
    http://llllllll.co/t/new-msp-object-swanramp/174/1
    (experience the linkage ;)