Forum
    • Categories
    • Register
    • Login
    1. Home
    2. the red_1
    3. Best
    • Profile
    • Following 1
    • Followers 0
    • Topics 10
    • Posts 34
    • Groups 0

    Posts

    Recent Best Controversial
    • Auto-Generate 128-Frame Knob Filmstrips for HISE

      Hi everyone,
      I’d like to share a Python script that saves a lot of time when creating knob filmstrips for HISE.
      Instead of rotating a knob image manually frame by frame, this script:
      Takes one knob image
      Automatically detects the visible (non-transparent) area
      Crops and centers it perfectly
      Rotates it smoothly
      Exports a 128-frame sprite sheet (no jitter, no wobble)

      Features

      • True center rotation (no shaking)
      • list itemAutomatic alpha-based cropping
      • list item 128 frames (super smooth)
      • list item Vertical or horizontal filmstrip
      • list item Ready to use in HISE
      • list item Huge time saver

      Requirements :

      pip install pillow numpy
      

      Full Python Code : ⬇️

      from PIL import Image
      import numpy as np
      import os
      
      # === Settings ===
      image_path = "PATH/TO/KNOB.png"
      output_image = "PATH/TO/KNOB_128fps.png"
      num_frames = 128
      start_angle = 150
      end_angle = -150
      orientation = "vertical"  # "vertical" or "horizontal"
      
      # === Load image ===
      img = Image.open(image_path).convert("RGBA")
      w, h = img.size
      
      # === Detect non-transparent area ===
      alpha = np.array(img.split()[-1])
      ys, xs = np.nonzero(alpha > 0)
      x_min, x_max = xs.min(), xs.max()
      y_min, y_max = ys.min(), ys.max()
      
      # === Crop to real knob area ===
      img = img.crop((x_min, y_min, x_max, y_max))
      w, h = img.size
      
      # === Make square canvas for perfect rotation ===
      side = max(w, h)
      square = Image.new("RGBA", (side, side), (0, 0, 0, 0))
      offset = ((side - w) // 2, (side - h) // 2)
      square.paste(img, offset)
      img = square
      w = h = side
      
      # === Lock rotation center ===
      cx, cy = w / 2, h / 2
      print(f"Rotation center locked at ({cx}, {cy})")
      
      # === Create sprite sheet ===
      if orientation == "horizontal":
          sprite = Image.new("RGBA", (w * num_frames, h), (0, 0, 0, 0))
      else:
          sprite = Image.new("RGBA", (w, h * num_frames), (0, 0, 0, 0))
      
      # === Generate frames ===
      for i in range(num_frames):
          angle = start_angle + (end_angle - start_angle) * (i / (num_frames - 1))
          rotated = img.rotate(angle, resample=Image.BICUBIC, center=(cx, cy))
      
          if orientation == "horizontal":
              sprite.paste(rotated, (i * w, 0))
          else:
              sprite.paste(rotated, (0, i * h))
      
      sprite.save(output_image)
      print(f"Sprite generated successfully: {output_image}")
      
      

      Save the file with this name : ⬇️

      generate_knob_sprite.py
      

      Make sure the file extension is .py and not .txt.
      Open Command Prompt / PowerShell & Run the script ⬇️

      python .\generate_knob_sprite.py
      

      Good luck

      posted in Presets / Scripts / Ideas
      the red_1T
      the red_1
    • RE: How to implement GUI scaling / resizing in HISE plugins? (like Waves-style zoom)

      @David-Healey Haha, I made a silly mistake 😅. I had an old version of the VST in Program Files and a new version as a .dll in my DAW FL Studio. FL Studio was detecting both of them, and that’s what caused the problem. Now everything is fine. Thanks for the time you gave me!

      posted in AI discussion
      the red_1T
      the red_1
    • RE: How to implement GUI scaling / resizing in HISE plugins? (like Waves-style zoom)

      @David-Healey Thanks a lot! I always watch your videos, can’t believe I missed this haha 😄

      posted in AI discussion
      the red_1T
      the red_1
    • RE: Unable to Move UI Knob Directly — Only via Macro 1

      @David-Healey It worked! Thank you from the bottom of my heart for all your efforts, and thanks once again. 💛

      posted in General Questions
      the red_1T
      the red_1