How do you Tempo Sync ADSR?
-
@d-healey Ok great, how do you convert the project tempo to ms? & does that mean the attack will always be set at that tempo? Would a user not be able to use a knob to change from 1/4 or 1/16 etc?
-
@Delamere said in How do you Tempo Sync ADSR?:
how do you convert the project tempo to ms?
As @HISEnberg said above you can use the Transport Handler to get the host tempo.
@Delamere said in How do you Tempo Sync ADSR?:
Would a user not be able to use a knob to change from 1/4 or 1/16 etc?
Yes they can if that's what you want.
-
@d-healey Ok thanks, I just really don't understand it. I just want to be able to have an ADSR Envelope with 4 knobs on the Interface that control the attack, decay, sustain & release. But with the Attack, Decay & Release to be Synced to the tempo of the track in the DAW, instead of ms.
-
@Delamere If the knobs are synced to the DAW what will happen when the user moves the knobs on the interface?
-
@d-healey What I don't understand, is how to sync the knobs to the DAW? I know you said to use the Transport Handler, but I can't understand how to do it.
-
@Delamere The link that @HISEnberg provided earlier takes you to the documentation. On that page there is a snippet that you can load into HISE that demonstrates how to use it.
If you can tell me which part you're struggling with I can give more specific info.
Again though, if the knobs are synced to the DAW, what happens when the user moves the knobs manually?
-
@d-healey I have read the link & opened the snippet but I just don't understand it. I know very little about scripting & I have been building most of the plug-in without it.
Again though, if the knobs are synced to the DAW, what happens when the user moves the knobs manually?
I'm not sure I understand what you mean by this question. I intend for the whole plug-in to be tempo synced to the DAW. If the User moves the knobs manually I want the tempo of the Attack, Decay & Release to change in beats, not ms?
-
@Delamere said in How do you Tempo Sync ADSR?:
I'm not sure I understand what you mean by this question. I intend for the whole plug-in to be tempo synced to the DAW. If the User moves the knobs manually I want the tempo of the Attack, Decay & Release to change in beats, not ms?
Ah I get it now, I was misunderstanding the user interaction.
@Delamere said in How do you Tempo Sync ADSR?:
I know very little about scripting & I have been building most of the plug-in without it.
The transport handler provides a callback that will tell your script when the tempo of the DAW has changed.
TransportHandler.setOnTempoChange(var sync, var f)
In that callback function you can use the tempo, combined with the value of the knob on the UI (1/4, 1/8, etc.) to calculate the number of milliseconds the attack and release should be.
You can use that calculated value to set the attack and release knobs of the envelopes.
This is probably a bit more complicated than beginner level scripting so I recommend you start with something simpler - my scripting 101 video on YouTube might be a good starting point for you depending on where you are at currently.
-
@d-healey Ok thank you for the reply.
I designed the plugins, how I want them to be etc, before joining HISE or learning anything about scripting. The idea is to create Sample Based Instruments from my own instruments that I have recorded & mixed through analog hardware that would have a tempo synced Attack, Decay & Release.
Whenever using other instrument plug-ins I always prefer to use the ones that have this option, like Omnisphere etc. I find having to calculate the ms with a reverb calculator very time consuming and was hoping it would just be simple to change the ADSR from ms to beats.
I don't really have the time at the minute to learn all about Scripting in Hise, what I have already learnt is from previously watching your video you have mentioned on YouTube. Most of what I need to do in order to complete the plugins is possible without scripting, it's just a few things like the Tempo Synced ADSR etc. So I may need to leave it in ms for now & come back to Tempo Syncing at a later date when I have time to learn scripting properly. Either that or it seems to be possible in Scriptnode which looks similar to MAX which I'm familiar with, so I will also look into that.
Thanks.
-
I have tried to Tempo Sync the AHDSR using Scriptnode, Does anyone know the reason this isn't working?
-
@Delamere You've made an effect, you need to make a Script Envelope Modulator.
You should also tell us what you mean when you say "this isn't working", in what way is it not working?
-
@d-healey I did try making it as a Script Envelope Modulator but it comes up with this..
You should also tell us what you mean when you say "this isn't working", in what way is it not working?
So if the Script Envelope Modulator is my Envelope & in Scriptnode there are 4 separate Tempo Syncs, one being sent to the Attack, Hold, Decay & Release of the AHDSR Envelope & a control for each one that changes them in beats. Then when I play a MIDI note, the AHDSR shows that it's triggering, but there's no sound coming out?
Thanks.
-
@Delamere Can you post a minimal snippet that demonstrates the issue? I haven't used script envelopes much but I can take a look.
-
This post is deleted! -
@d-healey okay thanks I really appreciate it.
HiseSnippet 1945.3oc6ZsraiTDEsZmTIjLYxvHgPBIVXgPnAznH+HILHVDO40PD3LVSmIvtnJcWNtT5tJS2kShAgDKYGrkcHwWAq.IVwN9Dxmv7G.2pejt53tcZ6DOAjR7lTu78bO2G081sa4Irn99BOjw760uKEYr.1rOW1YiNDFGsylHiEwMI9RpW4voVueWhuO0FYXL0y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j0NbthoV4zYSrTdMXrxMS+Ml4pdNlq0EhicIAutow5Gs0MxqxepB8p7uweIoi+q0+lAJuPzSx3G0j.2SoJIGZZvDZ3vJ9sy4G2xPz3JwshXR41UhqgOZwppwFQKVMdwWKxvkX4INH5YUnbGeifY.8lGzS0b3lpwkG3GGIB4xrYGXYk9qZfCVabOX8w8fKOtGbkw8fqNtG7iG2C9jq9fpeBCQkTpBYgTcs1JrWQi3mh.Dcf9W.DigtXA
-
@Delamere I've had a play around, I haven't been able to solve it, yet, but I'm going to bed. I don't think you need the split node.
I think you need a sig2mod before the ahdsr node, and the mod2sig after it.
There's still something missing but I don't know what - forum search might help.
HiseSnippet 2003.3oc6Z0zaaajFdnrG6XmD2FfhBTfdPnHXQ5h.CI4OhM5Aq3uRLRjiPni6dZMFSNxZfImQkbjs0tn.8Xus60dq.8WwdZWf8zdq+D7Og7On66vOLGZQJSIKaWTXmKgyGbdded+dDa5Irn99BOjwr60qCEY7HrYOtr8FsILNZmMQFygaP7kTuxgCsduNDeepMxvXhWoFvXlIQA+8w0Vm3P3VzjgPn8ELK5aYtLYxnMq+Fliy1Da5dLWsUuX8crD7MDNht.dl.WA0gXcL4H5tD0xJgQul32FY7mwUVZ0Uqb3JuX0JsVtZUxJqtxxGRpT0dQK5JUI0VsU0WT6vCsrPFSskMSJ7LkDI0GYL45B6dlsEmxCOf8Y9rCcnpGphLgSNb3sEN1JQTMJZi1LG6lwDkOBYfalPaSDRaeFtAylcw3Iz2mFLQ4jcnSfFkRCuIRAup5vqhF7x.RFZPZxPH8DrokGqiLYFEddHdGNnMaQ.8jNTBWKx3ei2P.KfKm2kbLcaO3gK1vyVd4JOu7Kp70eSqtbKISvKK36Jjz2we1WO6ee1Yl86ms7kmpUqLmScJdBGGpWlSqrL7FzFeFuq6gTumW9DhSW5EKDj9zTJNeJUWiaEJzZKTv2gyjuqCkmmc.JhoTVDQnBVpLf7mKh7McX1TODC33owugKNrJJ.vIV8+o5nBu4ZWmMuv0YyKlZy+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Kf+PZna59Q2GWqezUYHQ2ivM.Lv53vfCou2+lYVE1GW6J.VVzF.hgBXyf2hSfHJ1EEUHzvip5+iKSW+7O8S+qAfp4vefqLyo1A0Nz2IjMzX0QZNTOVygp5H4Q8nf1NuS8mh578duo68l98i2TsQxa5wgWSwcp6T7Ukbu+z89S+9weZgQxe5Shumm6TOpjaa5dep68oty7olJTx7YGUC5qKs+zbXPu2d9345u2vj8MXeHiRo7bRYuaLdTbHzfr2CeAEWsoEuI14MEy7o33tgmOb194l38U3nK3A1P7mf2sqqFwEg4vqK.Ydp5lZShCURefzwk7uzx6eV0ES3POK9mZbSleGGRu061pUjFK0HJ7wsomovxuA+sk6gTaPlB1tRDSqtmYnCu8i+2h4QTe2F+u.08EsRWPegmVeXBwMNLHebDBeKELhFsXb2PbWTaSEj4VLel6FBew0gVL.9e7tt.bnUsI+Nawdn3JyuTN724qcayeIUcb8Uw2vNGaz06j9f44qkGSdKT.vCwIWhcAouQoDfgFWSgeEneFBHkQoqoKG.RoWCRsmY4.wykU4.wy8GrxARgP7vivgs.87xfkSE5WJAdNcgj5dxuTy8g8Cft4krryubsjqzWW4ckfkShowljUarIYW6LZIeMaoksvLcESzxok33S5VPgkalvZiKU1B4nxVWHN1kD76JNReQeikueiIJz2uwX+WFez+VNFOP48htRF+nFDHOtpkEnoJSHKkU7OCqebKUQOWIN+kIkaWItGmnIqpd1HZxpwSdqbFtDKOwAQW2kxb7AAi.xMOJUbC0yk66KmEgbY1rCTel25up91XsQciKLpabwQciKMpab4QciuXT23JW8FUe2JQkbqbYgPcM2JrWZi3qeB7NP+er6Wt7D
-
@d-healey I just took out the last 'mod2sig' and it seems to work as desired....
@Delamere
check this...HiseSnippet 2003.3oc6ZszaaarEdnrG6XmD2FffBTftP3hhhzf.A8v1MAcgT7qTiV4HD536cUMFSNxZfImQkjx1pO.5xt61scW2zeDcUu.2Uc2cycu61Bzh7On8L7g4PIRYJ4WoE1Zi4Lygy24aNOGoVNBCpqqvAoM+186RQZ2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abMC9Yv4yX.oTJcMY4.PJ8pPp8TKGHZtgKrNVt+lUNPBDhGeDNtEnmUFrLpPefD3YzERh6Iefl6C5G.c4qYomeoz4QuRdckWWJVFIld3EklU8BSyN2Yzla5e+Kq+++gC9sAbXBxzkOUKiVhi1oqfCrLyDdgYLVKiirUDhCrI9euhSzubuKjemFS826emFuPzyiw2uIAxWKaMAZdRGxFYD80s5F05T3ykixSoS4lki5kIbxJxm0BmrRzjWI6gMwvQra30ZIM6tk+HfdyCS41T9bwg9kvhP1LS1tFFIeUCIX0IUvZSpfKNoBtzjJ3xSpfevjJ3iOaAk+NTBKsV5ZBgzZsdPOyZQWyD3Qf9SDUcmDA
-
@Chazrox @d-healey thanks a lot guys, this works. I’ve just realised there’s an issue in doing this though, the fastest tempo the tempo sync can reach is 1/16T and say for example you were making a pluck, there doesn’t seem to be a way to change the Attack, Hold & Release to be 0ms to turn them off. Any idea if there’s a way?
-
@Delamere I was gonna say that but I figured you had thought it through after all that so I didn't mention that. Thats a pretty crucial aspect. Its possible to script some case switches or something. Not impossible but definitely complicates the script a tad.
-
@Delamere compile with
HISE_USE_EXTENDED_TEMPO_VALUES=1