Make the Gain knob smooth the gain?
-
@CatABC I was thinking more like this
HiseSnippet 1134.3oc2W01aZbDDdOfqpGoMpoJJpR8KWk5GfJWDXiIFEYE+FNEEiMx331uEsYu4fU9X2K6sGsnJ+er+Tx+f1YuiWtyl35fZpZJe.wL6L67ryKO6RekjAQQREwp7ESCAh0WXOXpPO5vQTtfz8Hh0Cs6QizfxMU0ASCoQQfGwxp3KLJrbJQR97tme.MfJXvRUDxkRNCNgOlqWps+dujGDbL0CtfONi0M2qKSJNTFHiQ7TztNIjxthNDNkZLqfM4mnQiHV+f81atEqo2S81bysa2hQaAs8o99M1xqYyV6ztwVsoM2oETeah0m0wiqkpAZpFhHVkNP5McvH4uJRCvk7H9aB.iPCx.LxopOVF3YNhFsjCGwC75OOQEQHV18Wl1Jll1drcOtGeg9kouuJYA2kdjMAZUHO7JlCdMxBu5Yf2JfjUFHUJEROxd.SwC0KWwfmGX2UfUSeJVmxBkTaIE91h1GJQKD5ZioWAGqPgEdToU85a3heU8YkKi0pHs6UQt65tYyExvDz0tdFscDC4BnFSA3oyjENgGoqftN2lZ9XePkercay1ofgtAXm1oRM7L+XASykBWovHelnR0x+dYm.IiF3Jv8tGdhvNiZCgDGNMd7a.kYucJ6v8cqf1rKhspkcP2RzrHnnKWRChgJyiVU2uaWWCJPKMV6jLATSXBru+AS6j54csCl.6bc4YgJ0edzKgoGg0xLlY18EaSzM2lMbS8LLfN0HmYgLm2KALMv0SqTECqiiInJPGqDKLhOTHUPBrqnUwfAcWaxLy2OLAJPc2FIhkQxT82Wo49bFmFTI8HV95xt2r136+gVbtchTjoFXJA26JfnZ5gKOtLcvJYPfIpFncikMzNqdkYNVQj.4MbmXBxBCwQq7yq1u+40rzIrzApLFJEcEb8Ygf38QxPlMEh+5UcOhpolg7Y5P6BArzXff0QvDjhMcj2w9HH5JsLDIYuEe.xDI8hCn57zSFR7YKf4fbbBl4dQD1pkkj+eLNq6KDejcetlMZ0XrvJvHlo9XfwYL8eocGeefoWBvR1G+Kebn0yF9GlF9GXO.IUSlORB9SRjc+Y5Dv8Ef.TljWi63Z5+39dMc389Z5yXZL7WnnhnPYTtMd.LlegTXxBKU9pH7dE3smaplY0enjpV4Ru64GiGxU5y.JR8kzVr+XYrPmqMn3cc6ei071+R+m61+OAF1y8.Em4Xb.ebX.zQLAuRC0Xv3WiTX9z3.8bs46k6IExvQRAmksPeNnU7gCAUVruxCz9ZM9lxkZd7dmCA.MaS62u2IXyFUg4IXMyEM9fer1JqWeicJbcMCfte5RRW7+2jzmKi0bwvdTrI72vGEfu2Y.xMx.L5BADXdnfUAC+VpbcibJ4nvKQ3OwOyVrgQ1Z1hMlu3+JwXLkojulk9DHSe5mmnAO2hj+.lC9OAQY2FjjmEksVNFY4dMikeqtkiattNt055Xy00wsWWGastN9z00wc96czbIz9wZ43zQSBoW+NIuozxpifhc4ISDj+R75.WQ
-
D d.healey referenced this topic
-
@d-healey Yes, it is indeed more logical to use isKeyDown,
I put the code into the MIDI processor of the two waveform generators, but now I can't control the fade-out of the sound of the previous generator and the fade-in of the sound of the next generator when the KeySwitch is triggered. I used MIDIMuter, but I found that this is the wrong way to do it. When I use two waveform generators, I need to ensure that only one generator makes a sound at a time. Once I use MIDIMuter, they either make no sound or the sound can't be stopped.HiseSnippet 1587.3oc6Y8tbSaDDWx1hAInzRKszOJX5GrYRShTbBICCC4eNPJXhm3Pnei4P5j8MQ9N2SmB3oCOK8snO.8YnO.7HvzWf18jjsjRTLNdRfIzjYfI2d6t29ua2emRKNyAGDv3JpF6MnOVQ85ZsGPEc2nKhPU1dSE0qo8T7f1ugHb5pr9f9nf.rqhpZ4GKYPUuhRzOe3Qqi7QTGbJIEk8YDG7yH8HhTpsV8oDe+sPt38H8xvc8U21gQ2f4yBAior17J8QNGf5feNRxVIMkmfB5pndOsEsWvot68cssWbkkbPKgWwC44Ysfa85Ks7JVKrBp9xKgmeQE0qzvkHX71Bj.GnnVYcl6f1cYugFe.6SBHu1GKWXozFN4Xxaw7cktnjpxFcI9tsFF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1uylWUnOzFaS502G2fdHb+AnHswuE7JOTnuXH07sbaxnr9cYThS1N56hg6Fc5f4Ys8BcH3VD7PvTJ2Z0cw9XTV7I+zpOCZSi3PbBOkwBqS8KrJLe8iZwlqorF17KCL6k++Il8cYgBBsSSDTn9VnWBzlrM.U1ACVBkB8+AZpkjcBhWOubcLVYpazh+E9IYSK4Z0jMsFtYV281Cw6IeBP56B99n0dLduI3YAu+Wdxebt+r.qBeWPNpGQB6BkHG0MgAuz7pNlTNtjghsfPQF9t5pCIZmkXKDMmxf04zTSYJc3x2+nFTDTfzFCdt6NANPfQFmyofPXf+KIthtVYELkrcVxOAwcgbnyj+JlKReMpSwqXNkf0sKDr9UpjGr9hmKf0Goxbv0smD351mqv0sOArj1E.W+SFZ84lKVRjq69L+vdXYmjwI1LlKK+9gwA+KbP8OB79IMkXknlyD.9FQ.7uDd+EL38e7Oji8EfOjSh5NG9PNe47tG6Ke2yku64Ko+VEi+FJfg9hSl91Z.tdaynzs4m+78mhGW9o3L5gb3rW4DOYP1v3pQT.+lF8msWWqobso0wGEzCF+8JGm7p5XBZOsBtvzJX8oUvEmVAWZZE79SqfK+wEThNYsPAqW78D3IysZDADRUM90xQWYT9OfKn+WO
-
@CatABC said in Make the Gain knob smooth the gain?:
I put the code into the MIDI processor of the two waveform generators,
Why?
-
@CatABC I would script a UI button with 3 discrete stops. This knob will control your paramter knob from your scriptnode. Make sure the parameter knob in scriptnode is also set from 0-3 with stepsize 1.0. Changed the fader node to switch mode. Add a value ramp/smoothing node in between the faders mod outputs and the target gain knobs for each sampler. It should trigger the faders values either 1-2-3 to smoothly fade between one another. The part you have to script is what midi keys trigger each value of your parameter knob. Sorry if this is sloppy, this is off the top of my head without making a snippet example.
- based on the example I gave you above.
Honestly have a look at the scriptnode list in the documentation. You can really get crazy with the cheeze wiz if you see whats available.
-
@d-healey I thought that if working between multiple generators, each generator should have separate controls, maybe I'm wrong?
-
I need to rethink my thinking. What I want to do is to use KS to split a note.
-
@CatABC said in Make the Gain knob smooth the gain?:
@d-healey I thought that if working between multiple generators, each generator should have separate controls, maybe I'm wrong?
I don't think it's needed for this use case because we want to work with both as a single unit. You might even only need one sampler, depending on how many samples you have and how you want to map them.
-
@CatABC said in Make the Gain knob smooth the gain?:
I need to rethink my thinking
I really think you do.
And
-
@Chazrox Yes, I have searched the HISE documentation many times, but because I am a novice, I don’t know how to use many APIs, and I am crying because of my stupidity.
-
@CatABC said in Make the Gain knob smooth the gain?:
crying because of my stupidity
You're not stupid. We all start at the beginning. Everything is hard until it becomes easy. Keep going.
-
Thanks for the encouragement David,Please teach me again, when I trigger the second C#0, how can I add a fade-out to the note that responded to the first time?
-
@CatABC Replace the Synth.noteOff with Synth.addVolumeFade - set the volume to -100 and that will also turn the note off.
-
@d-healey
I think I have it working. Next I need to move on to multiple generators to test!
Thank you so much for your teaching ,David, I love youfunction onNoteOn() { local n = Message.getNoteNumber(); if (n == ks) { if (eventIds.getValue(lastNote) != -99) { Synth.noteOffByEventId(eventIds.getValue(lastNote)); } if (Synth.isKeyDown(lastNote)) eventIds.setValue(lastNote, Synth.playNote(lastNote, Message.getVelocity())); return Message.ignoreEvent(true); } if (n == 25) { if (eventIds.getValue(lastNote) != -99) { Synth.addVolumeFade(eventIds.getValue(lastNote), 500, -100); } return Message.ignoreEvent(true); } lastNote = n; eventIds.setValue(n, Message.makeArtificial()); }
-
@CatABC Looks like it's almost there. But you have added that
n == 25
block. If 25 is your keyswitch then you should be using the code I put already above that and just replace the noteOff with the volumeFade. No need for the extra block. -
@d-healey I tried to replace it directly, but it brought some problems, such as the note received the new KS and the previous note could not be stopped.
-
@CatABC said in Make the Gain knob smooth the gain?:
I tried to replace it directly, but it brought some problems, such as the note received the new KS and the previous note could not be stopped.
Show me what you tried, we do it all one step at a time.
-
When I do this, there will be errors like this, addVolumeFade seems to be invalid on the second KS
function onNoteOn() { local n = Message.getNoteNumber(); if (n == ks) { if (eventIds.getValue(lastNote) != -99) { //Synth.noteOffByEventId(eventIds.getValue(lastNote)); Synth.addVolumeFade(eventIds.getValue(lastNote), 500, -100); } if (Synth.isKeyDown(lastNote)) eventIds.setValue(lastNote, Synth.playNote(lastNote, Message.getVelocity())); return Message.ignoreEvent(true); } lastNote = n; eventIds.setValue(n, Message.makeArtificial());
onNoteOn() - Line 12, column 24: NoteOn with ID173 wasn't found onNoteOn() - Line 12, column 24: NoteOn with ID178 wasn't found
-
@CatABC Working here
HiseSnippet 1152.3oc2W01aaaCDlJNZXxcqXcnXXeTCaevdHMvJwwMFAAMu4zYz3Fi3zz8sBVpS1DQhTihJaFC4+39oz+AaGk7KRItYoFqCqyevv73c7d38xCO2WIYPRhTQrpd93XfX8E1CFKziNbDkKHcOhX8P6dzDMnbyEcv3XZRB3Srrp7bi.KmUIYed2yNfFRELXtHB4BImAmvi354R6u2K3ggGS8gy4QEzt4dcYRwgxPYJhmJ1MHwT1kzgvKoF0Vwl7SzjQDqezdqM1j0z+o9arwVsawnsf1Azf.uM8a1r01s81rMs41sfFaQr9rN9bsTMPS0PBwZ0Cj9iGLR9qhbGbAOg+1PvrviL.8bt3ikg9lqnQJ4vQ7P+9SCTIDhkc+4gsJ4gsGa2i6ymIed36qx1vctEECfVqTFdUJAOuhvqQA3s.HYU.RqlCoGYOfo3w546XvyCr6JvrY.EySEgRttjU99J1GJQMD50inWBGqvEyrnVqFMVyE+p9NUqh4pDs6kIt65tQyYqgqPS65aj1QLjKf0YJ.uclnvI7DcMzzo5rd.VGT6IsaaNNELzMDqzdoTC6DjJXZtT3JEl0mJpUu5uW0ITxngtB7r6g2HrxX8gPlAuLM5sfxb1NUc3At0Pc1EwV8pNnYYRl4TzjKngoPsodqt62sqqAEnlFscx5.Vm56egLLMBLUp2k4q4tkIr7Dur3hiy0Um3x7ygm7BX7QXNctEFO4L6DSt4Itlatkwgzwl0E1nv89B.CGb83Z0qWeGGGiSUfNUIloDenPpfNF+TSqRAC5t1DglddXfTfxtMRDy8joJXeklGvYbZH5LyUr50UcuYNJH3CMIc6XpnPtvjJxiCh7i+fwcxMXgFle4JiKSkrRFFZ7pAZ2XaC8yh2Yhg0DYPdM2qLNYlhXKV49V62eeaQZEVdiUAEkhtBt9zXP79HaHS5Fwe8ptGQ0TSy9DYndw.lZLPv5H3JjpMu02w9HH4RsLFIauEu.xHI8SCo5xzTFx7IafwfRbCl9eQBVpUjr+eLtq6KDejcetlMZwXbkEfQLR8w.iSX7+R6NAA.SOGfqZe7O+wgdun6eXt6ef8.jbMq+Hy4eS1Z2WSuBbeNH.kI34cGOW+G22mqiu2OWeJSit+bEUjDKSJcvCfH94RgIJLW3qRv2Wfe4LS1rn7CkT0B25cO6X7RtPaFPQpurxh8ijoBcoxfJ20T.dK4T.q9eto.9DnYuzfJNSw3.dTbHzQbE9jFJwfwuFovBnog5oRKWK2SJjwijBNqXh9LPq3CGBphXegWn80Zb1x4Rd7dmAg.sXQ6Or2IXwFUgwIXIiEdevCssv702ZmCWWSCn6mtjzU9+MI8YxTMWLrGEKB+Mbn.bdmAH2HCPuKDPnYPAqUL7a4qaXVmSNJ7yV7m3mIa5YVaMYSuoa9uhOhnLk7Mr7QfL0oedlD7dKx9iXN3+HDW65QxFKpXtLBY4dCiU9ntkgarrFt4xZXyk0vsVVCasrF9zk0vs+6Mz7Hz9oZYTdqIgzqemrYJsr5HnXUdVGA4u.bWGmC
-
@d-healey After playing it once completely, the MIDI will start to display when you play it again.
onNoteOn() - Line 9, column 23: NoteOn with ID5 wasn't found
-
@d-healey However, this error does not seem to affect what happened