HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. rzrsharpeprod
    3. Posts
    R
    • Profile
    • Following 1
    • Followers 0
    • Topics 41
    • Posts 262
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Expansions preset tagging

      @Lindon yes that what I have done. The panel is above the preset browser in my project.
      That panel is essentially a 2 x 4 grid of 'buttons' (one for each tag) inside that panel and when the 'buttons' are clicked currently it prints a list of all presets that have that tag to the console depending on which button was clicked. This is working correctly so the tags are being picked up and read correctly by hise which is good.

      What I'm looking to try and do ultimately is have the preset browser filter to show only the bass presets if I click the bass tags button, only the bells presets if I click the bells tag button and so on.

      posted in Scripting
      R
      rzrsharpeprod
    • RE: Expansions preset tagging

      @Lindon so that means it is possible to have the preset browser affected (in this case filtered) to show just the presets I want based on the click actions of a separate panel (containing my tags)?

      I've no idea how to begin with that as I don't know what calls can affect the preset browser and can't seem to find anything from poking around here. As I says I wasn't even sure it was possible at all tbh

      posted in Scripting
      R
      rzrsharpeprod
    • RE: Expansions preset tagging

      @rzrsharpeprod
      Ok an update. I have created json files and got Hise to read them and populate inside a panel. If I click on the tag text it prints to the console with any presets that have that tag which is good.

      So my next hurdle is now can I/is it even possible to filter the preset browser to show just the presets that have that particular tag?

      posted in Scripting
      R
      rzrsharpeprod
    • Expansions preset tagging

      I am really struggling to find out how to get preset - in particular expansion preset tagging to work from an external file.
      I have looked around the forum and found some posts on it but nothing that explains the process with enough detail that I can have a go at it myself.

      As far as I understand I can use a JSON or XML file in each expansion folder and then put the tags for each preset inside that expansion in the file. I am not sure which or the 2 formats is best to work with, does it matter or are either easy for hisento pul in and use?

      Once I have that file, how do I go about getting Hise to read the file so that the tags can be used in the project? I assume it is best to use the file system but don't know how to point it at the expansion folder to pick up the json/XML file.

      So in short I am falling at the first hurdle and can't even get the tags into hise to even start thinking about using them correctly in the project.
      Any help with the file format and loading it into hise would be much appreciated as without hat I can't do anything else.

      posted in Scripting expansion tags preset tags
      R
      rzrsharpeprod
    • RE: Preset Browser Tags....?

      @Lindon How do you go about creating the buttons on the left for the tags? And if you click them do they filter the preset browser accordingly? ie clicking the Pad button will show you just the presets with a pad tag etc?

      posted in Scripting
      R
      rzrsharpeprod
    • Preset tagging and buttons

      I would like to add tags my expansion presets with the idea that a user can then use 'type' buttons to filter on the types of sound within the selected expansion.

      I am not 100% sure how to add tags to the presets in each expansion, is it best to have 1 xml/json file per expansion detailing the tags for each preset for that expansion or should it be done per preset? Is there a required format for these files?
      Once you have added the tags, what is the best way to call them into HISE so that it can read & use them?

      Once the tags are in there, the buttons would be something like the image below
      6ec0fbff-644c-423c-9967-6c177bab8bcb-image.png
      Clicking one marked 'Bass' for example would filter on any presets with the tag Bass.
      The result would be similar to typing the word Bass into the search bar (providing the word Bass was in the preset names) ie only those presets would show up and the rest would be hidden/filtered out.
      Is this even possible with the standard preset browser?

      As always thanks in advance as it's a bit of a tricky one

      posted in General Questions tags preset browser tag buttons
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @rzrsharpeprod @d-healey I realised that the bottom section of the tiles were transparent so when I filled them and changed to drawing them in the grid under each one it worked

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey I found one of your posts on here saying something similar but I can't get it to underneath with a bottom right offset like a true dropshadow would. It seems to draw from all sides at once and only on top and on the bottom portion of the tiles with the text not on the image. Presumably it is also drawing it on the bottom and right edges as well but you can't see it as it outside the bounds of the child panel

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey Now that this has all come together and is working nicely, the dropshadow question has reared it's ugly head.

      How can I add a dropshadow - preferably an offset one - underneath each child panel?

      posted in General Questions
      R
      rzrsharpeprod
    • RE: Preset browser and expansions again...

      @d-healey Yeah it's a bit odd. I'll build a minimal example later when I'm home and post a snippet.

      posted in General Questions
      R
      rzrsharpeprod
    • Preset browser and expansions again...

      I have another strange question about expansions and the preset browser.
      For my project a separate banks page is required which then loads the selected expansion & UI when clicked on and hides the banks page.
      @d-healey helped me with this quite a bit and I now have it working and loading the expansion.

      The problem I have is that I don't need the expansions column in the standard preset browser as it's superseded by the banks page. I just need the last column showing the presets for the chosen expansion.

      My first thought was just to set showExpansionColumn to false in the preset browser settings, but then the presets don't show up when the expansion is loaded from the banks page via setCurrentExpansion.
      To get around this I set showExpansionColumn to true and made it 0.01 width with the last column being 0.99 so that it is there but can't be seen.
      This works nicely and allows the presets to show in the final column. They can then be clicked and selected as expected which loads the presets as expected.

      The problem with this solution is that it turns out that it breaks the search and favourites feature!! I changed the widths of the 2 columns to 0.4 and 0.6 for example so that I could see the expansions column to do some testing.
      If I click on the expansion first and then the preset the search and favourites works as expected. But obviously I don't want the expansions column to be there in the real project as the whole point is to choose the expansions via the banks page.

      I presume that clicking the expansions column in the preset browser does more than just

      expHandler.setCurrentExpansion();
      

      does as that is what I am calling to load the expansions but it's not the same behaviour as clicking the expansions column.

      Is there something else I can call/need to call in order to have the same post click action as clicking on the expansion column to load the expansion? Or is there another/better way entirely?

      posted in General Questions preset browser expanions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      Second, the error message is telling you what the problem is. expansionName is a variable you declared outside of the mouse callback, you can't use it in the mouse callback. You have to get the data you want from the child panel where you stored it.

      Ah so I can use the this.data.Name again. That will sink in one day I promise.

      Did that and added the {} and it sets the current expansion when clicked now thankyou.

      I'll leave you alone now for a bit as I try and figure out eth best way to load the correct UI elements and trigger the controls repaint

      Thankyou again for all your advice and patience, it really is much appreciated

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey I put it directly in my click callback like this

      cp.setMouseCallback(function(event){
      		this.data.hover = event.hover;
      		Console.print("Hover");
      		
      		if (event.clicked)
      		Console.print("Clicked");
      		expHandler.setCurrentExpansion(expansionName);
      				
      		this.repaint();
      

      but got the error

       Can't reference local variables in nested function body
      

      So I created an inline function loadExpansion() and called it at the end of my code

      inline function loadExpansion()
      {
      expHandler.setCurrentExpansion(expansionName);
      }
      

      But then got this doing that

      API call with undefined parameter 0
      
      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      What do you expect it to do?

      I thought that the image would react to the hover as it did before the image was loaded into it because of the line

      g.fillAll(Colours.withAlpha(Colours.darkgrey, this.data.hover ? 1.0 : 0.4));
      

      Actually I just realised that all I needed to put that line after the drawimage line in the repaint so that is solved.

      local props = e.getProperties();
      
      for (x in props)
          cp.data[x] = props[x];
      

      I thought you were just saying you used this in Rhapsody but didn't realise you were saying to add it to my project apologies.
      Ok so I have set the first line of text using this.data.Name and the 2nd line using the tags pulled in from the expansion data and it works and looks how I wanted it to.

      Ok so that's 2 things sorted, thankyou.

      On to the click event now so that it loads the expansion - well sets it I think is the term.
      Am I best to write a function that handles what happens when an expansion is set and then call that as part of the cp code? Or is there a better way to approach it?

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      If you want to attach arbitrary data to the panel that needs to go inside its data object.

      Which I have done. I have populated the tags and I can call them to be the "text" object using

      cp.set("text", tags);
      

      but I can't then have both the expansion name and the tags to be set as "text".
      It wants one or the the other unless I combine them

      cp.set("text", expansionName + "" + tags);
      

      which I don't want to do as that puts them on the same line in the panel

      If this isn't what you are referring to then I don't understand sorry

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      cp.loadImage(pathToImage, "Icon");

      We have lift off!!!

      In the loop I used

      e.getWildcardReference("Icon.png")
      

      and in the paint routine I called

      g.drawImage("Icon", a, 0, 0);
      

      and they work.

      The hover doesn't work on the icon though, only the part underneath that is just the rest of the panel with the text on. Not sure why the icon doesn't react?

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @rzrsharpeprod Ok I will have a look and no doubt get back to you. Thankyou.

      1 quick thing on the dual line text. In your snippet it uses a text object which I modified to use the expansionName

              cp.set("text", expansionName);
      

      How do I add a 2nd version? If I do this

              cp.set("text", expansionName);
              cp.set("text", tags);
      

      Then the 2nd just overrides the first.
      I have the 2 lines showing and formatted correctly but it just repeats whatever the last definition of "text" is

      I can't add "Text2" as that isn't a valid function.
      I tried calling the variables expansionName & tags directly in the drawAlignedText line but it doesn't like that.

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      I think you're getting close to that trigger moment :)

      I hope so! Maybe I am as even as I was writing that I thought I bet I can set expansion name using the variable so it is kind of the same action for each one.

      @d-healey said in A couple of expansion questions:

      set the colour
      draw a line of text
      set another colour
      draw another line of text
      etc.

      I also had this revelation as well while I was having lunch. I thought I wonder if setting a new colour will allow me to have a new text object and when I cam back you had said something along these lines

      @d-healey said in A couple of expansion questions:

      Nope, loadImages there is a function you wrote, so don't let the name mislead you into thinking it actually loads images into panels.

      Go watch my video about using images with panels, you have to load the image into the panel before you can use it in the paint routine.

      I watched one of yours the other day (the one with the cute little piglet) I will go back and rewatch it as I clearly missed something.
      Is the cant find Icon.png error misleading then or is it also not finding the image becaus eit isn't loaded?

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      @d-healey said in A couple of expansion questions:

      You have not loaded the images into the panels. Start with one regular panel and one expansion, and make it all work. Once you have this you can tackle it with child panels - which is basically the same thing, but overcomplicates it and makes it seem confusing.

      Is this

      if (isDefined(imageList[i]) && imageList[i] != "")
      g.drawImage(imageList[i], [x, y, width, height], 0, 0);
      

      and this

      loadImages();
      

      not doing that?
      Regardless the error messages I'm getting are

      {EXP::ExpansionName}Icon.png not found
      

      for each expansion so it looks like it isn't even finding the images to load either way or have I misunderstood the error?

      @d-healey said in A couple of expansion questions:

      This is just regular paint routine stuff, I have a few videos about paint routines. Make yourself a paint routine sandbox project and play around.

      So it is possible to set 2 separate lines of text? I can then set the position of each through paint routines.
      I wasn't sure if you could set 2 separate text items or if it would have to be 1 with a carriage return or something similar?

      @d-healey said in A couple of expansion questions:

      I don't really know what your saying there, so probably not. You can see how I've implemented the hover action, so you just need to add your click event in the mouse callback too.

      What I mean is the hover isn't really distnguishing between an end action, regardless of what child panel it is hovering over it is doing the same action. Whereas with the load if it is child panel1 it is doing 1 thing specifically (load exp 1), child panel 2 being clicked would load exp 2 and so on.
      Its that unique end action that I can't get my head around. I hope that makes sense?

      posted in General Questions
      R
      rzrsharpeprod
    • RE: A couple of expansion questions

      Ok I just figured out how to get the expansion name as the text name for the child panel, I also added the tags in Hise (not the XML file) and can set the text as one or the other (or both concatenated).
      Now that is loading, how can I set them as 2 separate lines one under the other as they need different font sizes and colours.

      @d-healey said in A couple of expansion questions:

      @rzrsharpeprod not at the computer at the moment so I'll give a proper reply later.

      Think of it like this, if you had one panel and one expansion, how would you achieve what you want?
      I don't know with expansions as they are not acting the same as normal presets. With none expansions projects I would just load an image or even attach one to the panel but because of the dynamic number of child panels I can't just call 1 directly and hardcode it for each. I think I have to use the wildcard reference and that seems to not be working unless it's tied to the preset browser where it works fine.

      For the mouse callback it would be easier as I could write a control callback directly referencing the panel. If event clicked do this.
      I can't do that or more specifically don't know how to do that with the child panels and that's what I am asking for really, how do I do it?

      @rzrsharpeprod said in A couple of expansion questions:

      Do I need to write a code along the lines of if object under mouse is [0] then do this, if object is [1] then do that and do this for all possible expansions up to say 30?

      Is this the only way to do it?

      posted in General Questions
      R
      rzrsharpeprod