Funny Chat GPT AI for HISE
-
What is this ..... ?
Q: HISE LAF Example.
Ans : In HISE, LAF stands for "Look And Feel" and refers to the visual appearance and behavior of the user interface controls in a HISE project.HISE provides a variety of built-in LAF options, including basic controls like buttons, sliders, and text boxes, as well as more advanced controls like multi-segmented meters, multi-state buttons, and FFT analyzers. Each of these controls has a set of properties that can be customized to adjust the appearance and behavior of the control.
In addition to the built-in LAF options, HISE also supports custom LAFs that can be created using HISE's scripting system and the image editing tools. With a custom LAF, you can create a unique look and feel for your project that matches your brand or artistic vision.
To create a custom LAF in HISE, you can use a combination of HISE's scripting system, image editing tools, and CSS-style styling. Here's a basic example of how to create a custom LAF for a button:
Open the interface designer in HISE.
Create a new interface control for your button, and set the properties to the desired values (e.g. size, position, text, etc.).
In the image editing tools, create a new image for the button background, and import it into HISE as a PNG or JPEG file.
Create a new image for the button hover state, and import it into HISE as a PNG or JPEG file.
In the script editor, add the following code:const var backgroundImage = Image.getImageFromFile("{PROJECT_FOLDER}button_background.png"); // Set the background image const var hoverImage = Image.getImageFromFile("{PROJECT_FOLDER}button_hover.png"); // Set the hover image Content.getComponent("MyButton").setLookAndFeel({ backgroundImage: backgroundImage, hoverImage: hoverImage, backgroundColor: "transparent", fontColour: "#ffffff", hoverTint: 0.3, textPadding: 10, cornerSize: 5 });
This code sets up a custom LAF for the button that uses two images - one for the button background and one for the hover state. The setLookAndFeel() function is used to set the custom LAF properties, including the background image, hover image, background color, font color, hover tint, text padding, and corner size.
Save the script and close the editor.
Preview the interface to see the custom button LAF in action.
You can experiment with different background and hover images, as well as different LAF properties, to create a wide range of custom LAFs for your HISE project. You can also apply the same custom LAF to other controls in your project, or create different LAFs for different sections of your project.Chat GPT is pretty confident about this script. In reality it doesn't work in HISE.
Another Example
const var sliderHeight = 20; // Set the height of the slider const var sliderWidth = 200; // Set the width of the slider const var thumbImage = Image.getImageFromFile("{PROJECT_FOLDER}thumb.png"); // Set the image for the slider thumb const var backgroundColour = Colours.lightgrey; // Set the background colour for the slider track const var foregroundColour = Colours.blue; // Set the foreground colour for the slider track Content.getComponent("MySlider").setColour(Slider::backgroundColourId, backgroundColour); // Set the background colour for the slider track Content.getComponent("MySlider").setColour(Slider::thumbColourId, foregroundColour); // Set the foreground colour for the slider thumb Content.getComponent("MySlider").setSliderStyle(Slider::LinearHorizontal); // Set the slider style Content.getComponent("MySlider").setTextBoxStyle(Slider::NoTextBox, false, 0, 0); // Hide the text box for the slider Content.getComponent("MySlider").setBounds(0, 0, sliderWidth, sliderHeight); // Set the dimensions of the slider Content.getComponent("MySlider").setImages(false, true, true, thumbImage, 1.0f, foregroundColour, thumbImage, 1.0f, foregroundColour, thumbImage, 1.0f, foregroundColour); // Set the thumb image for the slider Content.getComponent("MySlider").setLookAndFeel({}); // Set the custom look and feel Content.getComponent("MySlider").setPaintRoutine(onRender); // Set the custom paint routine function onRender(g : Graphics) { g.fillAll(backgroundColour); // Fill the slider background with the background colour g.drawImage(thumbImage, Content.getComponent("MySlider").getThumbCentreX() - thumbImage.getWidth() / 2, 0, thumbImage.getWidth(), sliderHeight); // Draw the thumb image }
-
ChatGPT is a useful tool if to know how to correct it.
-
@d-healey Another option would be to change the HISE API so that the ChatGPT output works. Hail to the new overlords, we‘re not worth it!
-
@d-healey Do you know how to use it correctly ?Then please make a tutorial. I didn't find it useful for HISE.
-
@DabDab I find it faster to write the code myself than to correct the AI's nonsense. Maybe it would be more useful for outputting pseudo code, I'll have to try.
You are using it "correctly" by the way. It's just that it can't do the thing you want it to do.
-
Then please make a tutorial. I didn't find it useful for HISE.
I like how it transformed from "Oh my god, look what this thing can do" to "I can't believe it doesn't work perfectly and do my job" within three months...
-
@Christoph-Hart True... (y)
-
Be a whole lot easier, faster and more accurate to just spent the few hours necessary to fix the documentation manually.
-
It ain't funny at all, if you are missing the power of Chat GPT, then just read about these facts and tools about Chat GPT and then decide later with cool mind.
-
When CGPT is used for writing Docs, Manual, correction it will do it's best. But when it works for specific softwares like HISE,JUCE etc... since it is unaware of HISE,JUCE API as a result it throws wrong output. I know it will be useful for near future for writing codes etc.. but now it is Funny for HISE for writing some coding.