Arp plays in key?
-
Is it possible - or rather how is it possible - to have the Arp play by key.
The user selects a key and the Arp plays monophonic starting from C3 randomly only the notes that are allowed in the selected key.
HiseSnippet 2336.3oc4Y8taabiDeks2fn00oI4ZQ68Mh3d3jgcjkjSyeNe4hjkjSbicrfkiaALBBVuKkDqWQtcWJYKTXfC2Sx8nzueeoOB2iPeCxMjb+CWYEEYi1q4vYDDGNb3L+lgbF9iaZEvbvggr.ib4ObjO1H2mX1dDk2qdOaB0XmFF4VzrsisG9s0B7M1ZjucXH10HWt4etPgb4WvP9yu7rsr8roN3TQFFGwHN3cI8I7Tosp9Rhm211t3CI80z9AU2wgQqy7XC.vLuYICeamSs6heksPs4LMxciltDNKnM2liCMxYtEycT6drynJ8OhDRNwCKFT1nMXHk3sYdtBDKjt+PbvPB9rTYkLLp2i341JNQDZ.VtUZZYdUZ4yL2i3RRjmldtsbBT5JzyQ4lKKjmOCjKqC4RZPdBPJmFjVPAo6.aLADed5LpsqcnbbPGaXqPGJJcMlqvMMqy.Mn7h8sOEuc.LHYEEdXoRqg95RkVYykrVxJ.2EY64wNC69JFD.apDQDpOz1KTpDrqExQCsCPghyI6DOI5oniWxBA+bb40Pe3+7l0PqudMg2D9LZkUVCUQNck3+nzaO6umEjpShBQ+CkNDJKXhprgvLfFnWXGzmQINHktuQDOqu9ALFGQg.F4v5eB6D145QoS+SjJ7TTbdrKlWm02mQgAEtWz72SkBITOBEi5Lf5vILJhQilWr3.lWAm3UtFXcuA3UVx5GUAFnnrxqnSOaZWraAgEuPkyU1nXHN1N0gb1IPASgwcfBFqutzTp.Bc4HRM6TBIoBSKljJL8fJ+.eWnNH4DhLfxqe.CP.34ZZRJDGpf7iDlpvJ2G1DSNBJMgxtuDOR09HLalRkDeeoJcbO4v6RnNYGhzAMA7gd5SQkWQogTKsJhrkHGW5MapzC6EhmoUjDOo96MaZcgZO9PnfFE.nQj5P1TW0p0rGmIRvH6f.6QHVm3pa4o8KG4iuWDaZ87eRxviA9BEfCG3IJNN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your own Arp.
-
Yes I would also recommend writing that from scratch. Here's a starting point:
HiseSnippet 1550.3oc2X0raaaDDlz1LsRsMnoMnnG2dH.x0JNR14WXDXKKIGHTKYAQm3.3FXrlbkz1PtK6xkNQIHOC8bt0WihdsO.8buk1S8VdCZmkKkHorhgqZRQasu3c1Yl8al4alkq6J3NjvPtvvrv9iBHFlenk8HlbX8gXJynUCCy2ypQjKwyX6QA3vPhqgo4h2SsoYgkLh+40atM1CybHohLLd.m5P1k5SkoR6t0WQ871A6R1m5mQ6quUKGNqN2iGA.YQqJFAXmGiGP5fUpsfkg4EZ5RkbgsDKIgFlKsM2cj8P9SXZ8e.MjdrGQsnpgM3Hs3c3dtJDqjZTeH0ys63.NzvvzpaZ3unN7urUapKch7zzvGGuAJ0hr4CyExCuEyAupYgWkLv6zPxHChVRiH3f4tQdXYdznJAIaP4rbnoESRXgT4nrkn+wg3kr5RkNCmMFWXFXDJHuKvXRg8irZ1uOwQlBvkr14gu6qhWTe7efkMkQhashO7OKdM5.7IDz8HLhPk7pdFMY+74sIK3b2jsmiDN98EXVX.OLmisI9z84LUVHU38CI6HHeaOU0Lq75brXla85M2ABxYZiMVFIhoE074Qrw3eqW8reZSyEOql8puol87cDYzeFc9K8utNeSyS2WcIKaGAMPltiBOeZhzTDkm2n20XgxWv5ZWC0sVuZsateyd1nqhp45hjCgZMRxQXz8agpyYRA2Cw6iFADCjyPEkpXQAY.py8aezd02u1CZZitKp5FEKB9ylHUFWA0mKPQAOAKbQC7nggXlKO1rd05zXu1IVnDXWu1tMOpUmFMeHHc8wR61rYCkVU1.A9MJjDhjD+.NhxbIOEVUB3qLnkUC18i2Kzi5RDKGCkVcfvpSscs0NLThERvgU1HdYrWRWxiI6sxKLzA6MsLObnrCWR.IWUEA.HBknSvBs1gn6V7vhENrRYzZkQqWFcixnaUFc6xPf7nxpHwmx3hIZb8wZbGPipIZf+l7Zbyo0vajKEyN8wbmziwkKlnR0YijfghQCloetc5QMDK74LpSBteTR4wIRHHLosJ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 years ago with the internal arp. that now finally accepts a preset change without stopping and also uses all other existing functions, it would be a step backwards to start all over again and build my own arp.
My arp only plays tuned drum samples in one loop player.
No notes are entered/played from the keyboard. Everything is tuned to C3 and only this note is set as root.
This basically means that the internal arp only has to omit a selected key when playing random notes, or play the next higher or next lower note - which one doesn't matter - because it's random.
I would need an approach for this.
How do I get my random function for the arp to randomise only within allowed notes? -
@MikeB said in Arp plays in key?:
How do I get my random function for the arp to randomise only within allowed notes?
Based on the above answers I don't think it's possible without modifying the built in arp.
-
@d-healey
Sir David - so you mean that it is not possible to tell a slider in a sliderpack to randomise only between the values -10 ,-8, -7, -5 ,-3 -2, 0, 2, 3, 5, 7, 8, 10 for example?
...and that 5 hours before the turn of the year :-) -
@MikeB Ah that's different, I thought you wanted the arp to do something it wasn't meant to. What you want to do is within your GUI script, correct? You can use the
Math.random
orMath.randInt
function to generate a random number which you assign to your slider pack slider. -
//Random Note Button----------------------------------------------------------------------- inline function onbtnRandomNote_S1Control(component, value) { if(value) { for (i = 0; i < 16; i++){ local r = Math.randInt(-12, 12); myPads_S1[i].setValue(r); SliderPack1_S1.setSliderAtIndex(i, r); } } }; Content.getComponent("btnRandomNote_S1").setControlCallback(onbtnRandomNote_S1Control); //----------------------------------------------------------------------------------
I already have that - but with Math.random and/or Math.randInt, only between whole numbers are selected, for example between -12 and 12 - in this case, however, certain numbers within -12 / 12 are not to be selected (because they do not occur in the selected key, for example 5).
So I need a random function that only selects between the numbers 1 2 3 4 6 7 8 9 10 11 12 and leaves out 5. As an example.
-
@MikeB Make an array that has the numbers you want. Use the random function to generate an index that you can use to get the value of an element in the array.
-
@d-healey Do you have a small example that I can look at and understand?
-
const valuesIWant = [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12]; Console.print(valuesIWant[Math.randInt(0, valuesIWant.length)]);
-
@d-healey
Super thanks Sir David. I got it - now even better with your example.I thank you for your great support this year and wish you a happy and successful new year.
-
@MikeB You're most welcome. Happy New Year!
-
@Lindon said in Arp plays in key?:
Write your own Arp.
It was easier in this case - Happy and prosperous New Year to you.
-
@Christoph-Hart
Thanks to David, I found an easier solution. A happy and successful new year to you.After two years of peace and quiet here in Berlin, we'll have a lot of noise in front of the house again in a few hours. :-)
-
@d-healey just trying this - the console prints correct values but the sliderpack continues to set random values, rather than values in the specified array. Am I doing something stupid?!
HiseSnippet 1225.3ocsW8+SaaDE+b.W03tV0N0+.NwurD0T23PJkIFZIjD1hFDxHYnNgPUG1WH2v9tH6KTxlPZZ+Eu+C1d2YmXGHM.QpVg.uudedu68d9Q2PgKMJRDhLx2exHJx3aL6MgKG1XHgwQsahLdg4gjHIMDGyZuIiHQQTOjgwZ+jhgQ90Q5m+8G2i3S3tzTVHzIBlK8.V.Slxsaseg46uOwi1mEjQ6p0Z6J3MD9hw.dVyrLZDw8RxEzNDkZ4LQFOokGSJB6IIRZDnydBuI8FJ9LOV+SXQry8oJBGTOvQwrQMFx785NMViPHi06lF4qEG4u17PlGaF+zLvK0BvoVjMGXjaYPx4Q.IiLPZ8XH8JydtgrQxTIJ77Ly1b3BY.AR0YgRrtnbemoYCAnAWZGPtjteHPLyhBaUtbIL7UwcrrfzcjDeEIDGv3hP7t3SAgUJg2rD98kvenDd6RXGfkCvyoJ7Cv0AX678fZJUA9Upd1NY7DjEjJGUQ6nGzm4rOf7GYQR0oHANQGGPyrnt9wc60n9As.0mFwWPkMDAiDbfnvFSUXihYOhd9LOZXWn3x4KZYFcTFaw39LNEOXL2UxDbrfC9935cZdzgJGDJ7K3N05Rvo3OlVz5urxyFfKLEEpi3DkjBEw6tK1onUdPi7Cf3s.CPR4cvL7Ofc1B98adCHMO7Am77t2kAR1QTYLYc3p0idcAVI7gD4P6PB2CtrK71JUUWMEArm5iL+I.5HgO0dTHSEtwQhNRyeiU9kh6JOJb+nPMbmqqDs8o7KjCuC5uEpOrcmiNdCsRyKQ6jSWpqOaluu+HdyupQrpiYt.9VQoRNDjKHAr3vLq+NK1tarzA5cu3WP.CP3FnL3K1PMsTQEaIk9MH99mCwag61UTbmLsLcDR5Q7B5FCK.S2VzfAKTVhq7ogKTr5sHgKyvB7wAmSCy1VpTDFyN+r6m7vlc6FmYxnnf2lyjGMhlPuuv2SMSV822cROJI0By7ykfP.JR8D+uMYheZMDhAN54lYJpP5vH88lutlGQRPFmZtUUa3YS6511CZzzN4oYcf9plJ59cgu5pns0x6nn+YE8.s7eUQ2WQ2USu4QZOTOFyZftVLPeYBPgZiyE6ItVCSKyo0S2FinZneqcSELg2TkD+PNYDMTxTodilzqfMEhesWdylznKkhQvoMq1CY7zGQJ55YG8eeZsIo3nYsOy7jCQFlF0LPngT1ECkJp+ADFPRMCscMXqmQ8X+Ic58XJRdRLRdQBR1arTJ3ZT7LyYM.Yv.52yhAVMJm.0UpsJNfRB4pWdGQth1l2MjBcUJ5Ebb2WJO87vgyed5.yDbJPHoAQpkchAokdDpU+V85aAalcmMPfceDdi8Ix4WHRs4Wh.nSatsPTaZviXxIY2L7QrkT4ktkzCEhuxrKS5NbwXL2BvnpY7q.FS1s74lsFLf5JSA35l6+wUcQx643OVLVx3W.uVHjot26LNnGrRsKENcNm5GopExolCESWVQqx.8nbOMw+AOIBcTzFIBclJDZUbCEexMdnfZ60mp4.XhqWVOO7eM.z3YCqLMKaWFE.k7ex0UE9u0AgVrMUVAa1bEro5JXy6WAa1ZEr4CqfMauTaTSapOVJBhaG.FcaoGHaXzRONRWEh9esZ6tKA
EDIT: Actually the console values are random even with the test array which is just a bunch of '2's
-
the sliderpack continues to set random values
That's because you are setting random values... what size t-shirt do you want?
SliderPack1.setSliderAtIndex(i, Math.randInt(0, minor.length));
-
@d-healey XXXL please
-
@d-healey What would be the right approach here?
-
@MikeB To what?