only when plugin is visible?
-
@d-healey yep the timers was what I was wondering about. Somewhere I read you recommending to avoid them, as plugins aren't visible most of the times anyways.
I want to spend the day today deepening my scripting skills, trying to make some metering within the volume sliders (works beautifully for one, just haven't figured out how to pass to the paint routine which slider to update) and something like a row of buttons which only one of can be selected (to change the eprom/sound of a drum voice)
also very occasionally if I trigger a lot of pads I get the console output
Interface:! Line 127, column 19: Cannot assign to this expression! MorphDrum:! Line 127, column 19: Cannot assign to this expression!
which is the
this.data.alpha -= 0.1;
in the timer callback of the paint function.... can't figure out why
-
@Christoph-Hart superb! HISE is thinking ahead for me <3
-
@Morphoice said in only when plugin is visible?:
metering within the volume sliders
Use the built in peak meter floating tile and style it with LAF.
-
@d-healey you telling me a feature I spent all night coding myself is built-in?
:))) -
@Morphoice Yes :)
Set up the data property something like this - change the processor ID to your simple gain (or other volume module that you want to connect to). The important part is the
ChannelIndexes
which catches everyone out. This needs to be an array with the channels you're interested in. In this example it's [0,1] which is channels 1/2.{ "ProcessorId": "masterGain", "Index": -1, "FollowWorkspace": false, "SegmentLedSize": 0.0, "UpDecayTime": 0.0, "DownDecayTime": 500.0, "UseSourceChannels": false, "SkewFactor": 0.2, "PaddingSize": 1.0, "ShowMaxPeak": true, "ChannelIndexes": [ 0, 1 ] }
-
@d-healey basically I'd just want to relay the meter from the sampler, I had gotten the value with
var value = Synth.getChildSynth("Bass").getCurrentLevel(true);
inside the paint routine, which was stupid. Id probably also have to sum them to mono as there is really no stereo information in the samplers. Single drum one-shots. But i figured with the layout of the plugin the visualisation helps to identify the correct slider as there isn't much space for a lot of labels.
-
@Morphoice I'll send you an example when I'm back home in a few hours
-
@d-healey preem! thanks
-
I'm using a sinewave gen in this example but will work with a sampler just the same.
HiseSnippet 1418.3oc2W8taaTDDeujbUXWnPqp.93JK9fSIjZ67uFppZRiiKQD2ZhSaAEEUs4t4rWxd6db25jXppDO.7XwC.OJ8MnL6d9huiXERs.p.+AGO+cmc142LS5Dq7fjDULwo79Ci.hyG51cnT2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upct9IPWL78.rcuTBhjhGywvosXdXHZc1RVlcX99XRdzAWejiLkHsY1rXNti7p8lAFee.xkRsBoz532GV90jS49ZbPnqSeGBoOv60WanZfoRMbl9huFjKNp.GRo7GHLoy7StLyzGI.wIEFWXFIHS35g4m4+NLNq1kNN6pFh2zsCW60exw3LSHFQDz+Dw3nk.9H2sCBvVeiCv4ba88S6D+q9weizi+5tF3gckM6g+otSBtbIas86W0s1htxas8TbPvIv9wLYRjJofi6Bg78w1SI4YhPpVwvOsm40LO+sTr3IJ5MOrEdImnMcY5Aw1xhMCw4R5BkAyV7cXtqVK8hHhb5OgUxl68vVh+8.qdOh7KrHaorXrKOLR.aKwEQvwd1X7V3bt.1.gNiawB61JoJpuRx8x+puGfCq50ChyG6S7BsoViaSMlys2XOP.r7UvewF6hUdrXLOASYt3ceo9I9d84togK0fFo+2si8r++tiMtbrYAqzMlvYzOYPXw0GLysmwzrKktlgNsSoz2R7V7yHg0MzNiDVOS3+JmQHyKV8RuzclM0oefkCduk1+47R3RgHMsNwtGc92xPrK2K87J5pKXXio0vklVCWdZMbko0vUmVCWaZM7d+0FZFBs4.sJLEZRHs6rscebGmskLrJ2hHH+AH7WE7B
-
@d-healey How Can I change it to vertical . from bottom to Top. My Snippet only doing the opposite. How to invert it ?
HiseSnippet 1428.3oc2Ws0SabDEdVfMp1oMoIJpsOUMxpOXRcId4hIznn.AiSQERbwjjVgPQC6dV6oL6Lt6NFvMJR8k9P+20eJQ8OP5Yl0FuavgPcSpZKOrv457Mm4bilwJeHIQESbJta+t.w4Cca0Wp6rdGFWR1rNw4JtayRzPLMk0862kkj.ADGmoefggSgYH1ed48tOSvj9vHVDxSTbeXKdDWOhayU+VtPzfE.6xixn8hqtouRttRn5g3YZ2pjtL+CYsgGxLpMkK4aXIcHN2zs5R0.X4EBCBXKrPPsZ0V41qr3JdrvpKxNvq1JKN+hKO+sWNj3boMB3ZUbKMSCIDmYtuJneqNpikoGvS3I7CDfgvizBO4T1MTh.yUzvkrdG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Fe+6mQ7YO9qjd7W10TdX2Wyd3eh63JWNmU198K5Jacuvqr8Hry+QvtwLYRWURNG2Bh36hsmRxxDKoZDC+zNlWyr7WWwhGqnWduF3kbr1zho6EaSKVKBGDoykFL84sIn2DtI3L+qaSv+CTrmaY0BCwXKdTWArgDW1.mzYw30wQagrdB8Pt4yk2VIUc6njb+rOz6.37o1sg3rXerWn0zZbioQbtwp6.BfkMo8KVcKLYiEiwIXBiEd+kWberuWelaJbolBP5em2sYtXuamel+6jF1S++6F13xvl8qRWXBGQ+vdQ42dvL1dJSutT5pF5zFkx.KwqveFHzyP6LPn2Pg+ibFQL+X0y7SWS1jy9AVN38VZ+GyKf6DhzTOhc04rukQXGum46m2Umwv4mTCWXRMbwI0vklTCqMoFt7jZ3se6FZFHsVOsJJszjP1t4F10wcb1PxvrbaEA4OwjfFP9
-
@DabDab you need to subtract from the height because y0 is the top of the component. I'll make an example in a little while
-
Here you go, this handles both vertical and horizontal
HiseSnippet 1453.3oc2W0saaTDEd13rUXWnPqp.tbjEW3TbS8FmeZnT0jlDWrHo0Dm1BJJpZxtm0dH6NiY2wIwTUI3ddV3ofG.dT5aP4Lyt1d2F2zfEEQwW3jy24m4Lm47maEIcg3XYDwpzdC5ADqOzt8.gp6FcYbAo4lDqqXuCKVAQzDn6OnGKNF7HVVEdfFvp3rDymWdu6yBXBWXLDg7DI2E1lGxUiQas12xCBZv7f83gYjdw0Z5JEaHCj8Q+ofcMROl6QrNvCYZwlwl7Mr3tDqaXWaokAXk59ddr508Vd4kW81qt3pNL+ZKxNzY4UWbgEWYgauhOw5Ra4wUxn1JlBhIVydeo2f1ckmHRNfmvi4GF.ZBGRa7jSfaHC7zWQMJYit7.uVCCTwDhkcqwgsBIgsqauC2iOBeb36SLLni0Ha.zZl7tWgbtmSV2qVF2aBtjUFWZ1DW5p1sci38Ti4n8mKa2Tful9L7cJqqjHKYlesf8FRTBgZ9P1QPiHjXjFUVtVspT7q4tSoR3aUrhdLKh1HPxTbQm83Af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T3718zYJ28b1+ys646AE64VOt3PerMOrW.rk.2uAmzY7wqgi17Y8CTCQymKuiTH60UJ3tYen2Ev4Sc5.QY88IdgVWovkzFib801EB.V1j1uXsswjMVDFmfoLV3729mJLw2qO2Nwco5BP56uMoK7+6lz3Nv5cpRVRBGK+v9g42XPOpdFc+sD5ZZ5jliBOCwqvOoLczzVoLcFx7ekyHj4FIelaxpw57zOvff2ag4m+WD2CDooNDy5xYeKCwtbOy0MuoNihKLsJVeZUbwoUwklVEWdZUbkoUwa+1UTODZ89JYXRoIgrSqsLqfaYskfgY4lJBxeAHCfHH.
-
@d-healey Understood my mistakes.
-
@d-healey Thanks Dan! The example works well, yet when I implement it into my plugin, I seem to be unable to assign the look and feel. I must have mistyped something and can't see the mistake. Bad night.
-
@Morphoice said in only when plugin is visible?:
Thanks Dan!
Dave ;)
@Morphoice said in only when plugin is visible?:
I must have mistyped something and can't see the mistake.
Show me your code
-
I made a post about this where I posted a code snippet that will completely bypass a timer when the ui is closed
-
@d-healey why am I saying Dan all the time? It'll take me a while to get that fixed in my head lol I apologize
const volumeMeters = Content.getAllComponents("Meter"); // Meter1, Meter2 etc. const var laf_VolumeMeter = Content.createLocalLookAndFeel(); laf_VolumeMeter.registerFunction("drawMatrixPeakMeter", function(g, obj) { var a = obj.area; var average; // Get the average of all the peaks (sum the stereo basically) for (x in obj.peaks) average += x; average /= obj.peaks.length; // Draw the background g.setColour(obj.itemColour); g.fillRoundedRectangle(a, 5); // Draw the level g.setColour(obj.itemColour2); if (obj.isVertical) g.fillRoundedRectangle([a[0], a[3] - a[3] * average, a[2], a[3] * average], 5); else g.fillRoundedRectangle([a[0], a[1], a[2] * average, a[3]], 5); }); for (v in volumeMeters) { v.setLocalLookAndFeel(laf_VolumeMeter); }
the Meter1..x floating tiles have these Data settings
{ "ProcessorId": "Hat", "Index": -1, "FollowWorkspace": false, "SegmentLedSize": 0.0, "UpDecayTime": 0.0, "DownDecayTime": 500.0, "UseSourceChannels": false, "SkewFactor": 0.3, "PaddingSize": 1.0, "ShowMaxPeak": 1.0, "ChannelIndexes": [ 0, 1 ] }
They look unchanged and all meters react to all samplers, although every one has its own ProcessorID set to a specific sampler. sigh
-
@d-healey Dave (practicing, to get that set in!), as the absolute guru in coding, how would you go about the following problem
I want to use those columns to change the sample map as if the user changed the picked another eprom for the slot... I reckon buttons are not the best way here but panels instead? one klick should disable the others and load the map, I have no idea on how to store the sample-map name inside the button though, I can't use the displayed text and hardcoding separate arrays feels like there would be an easier way.... how would you approach this?
-
@Morphoice said in only when plugin is visible?:
const volumeMeters = Content.getAllComponents("Meter");
Have you checked that volumeMeters does contain the references to the floating tiles?
@Morphoice said in only when plugin is visible?:
I have no idea on how to store the sample-map name inside the button though
Put the sample map names in an array. Use the button's index as the array index. So if button 0 is clicked you will get the first element of the array.
-
@d-healey said in only when plugin is visible?:
Have you checked that volumeMeters does contain the references to the floating tiles?
it does contain an array with 3 elements, which are the three meters in existence...