HISE Logo Forum
    • Categories
    • Register
    • Login

    Possible to fold all indented code in script editor?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 3 Posters 306 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      observantsound
      last edited by

      I find navigating the HISE code editor a bit messy and I can't rely on the tools I'm used to using in Sublime like fold all code at indent level 1,2,3 etc.

      Is there a way to do this in HISE?
      Or are there other smart ways to make code navigation a bit easier?
      Like connecting it to an IDE or working with several script tabs?

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @observantsound
        last edited by d.healey

        @observantsound

        Or are there other smart ways to make code navigation a bit easier?

        Write less code per file. Use namespaces and separate your code into different files. The majority of my scripts rarely exceed 300 lines, which is easily manageable. You can view the scripts in Rhapsody to see how I manage them in my projects - https://codeberg.org/LibreWave/Rhapsody

        Pressing CTRL+R will open the bookmarks in your script so you can quickly jump to different parts.

        @observantsound said in Possible to fold all indented code in script editor?:

        fold all code at indent level 1,2,3

        Try to have fewer indent levels. It will (generally) result in cleaner code. https://youtu.be/CFRhGnuXG-4?si=EqroDdGRTIwbTHPa

        @observantsound said in Possible to fold all indented code in script editor?:

        working with several script tabs?

        I always have multiple tabs open. If you get creative with a custom layout you can get all kinds of nice setups.

        2f858418-d939-4457-9503-4e8738beccaf-image.png

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        O 1 Reply Last reply Reply Quote 1
        • O
          observantsound @d.healey
          last edited by

          @d-healey Thanks for the tips!
          I might need to adjust my workflow then.

          I was following some of your tutorials for interface design and I quickly lost track of what is where.

          This is how I like to structure my code. I use fold on indent level x many times to quickly find what I'm looking for.
          I also don't feel comfrotable with using the { } yet.
          Sure it might make some things easy to read but it also makes the vertical space code needs very long.

          Is it possible to have one file for all my Lafs, one file for my PaintRoutines, one file for declarations etc. ?

          // ------------------------------------------------
          // SET PAINT ROUTINES
          // ------------------------------------------------
          inline function A_PaintRoutine(g){ 	
          
          inline function B_PaintRoutine(g){ 	
          
          inline function C_PaintRoutine(g){ 	
           	
          
          d.healeyD LindonL 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @observantsound
            last edited by

            @observantsound said in Possible to fold all indented code in script editor?:

            Is it possible to have one file for all my Lafs, one file for my PaintRoutines, one file for declarations etc. ?

            Yes but beyond one file for laf i wouldn't advise that approach.

            Split your project code by functionality. If you have code for your preset browser, for example, put it in a file called PresetBrowser.js and everything associated with the preset browser ( paint routines, component references, laf, etc) goes in that file. This will make it really easy to find things in the future. If there's a problem with the preset browser you'll know exactly where to look.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            1 Reply Last reply Reply Quote 1
            • LindonL
              Lindon @observantsound
              last edited by

              @observantsound

              Here's a partial list showing the sort of thing I (and it seems David) do:

              // THE SOUND SOURCES
              include("VoiceModels.js");
              
              // LAF //
              include("LAF.js");
              
              include("PatternPreLoader.js");
              
              // THE HEADER CONTROLS
              include("HeaderControls.js");
              
              // MASTER CONTROLS
              include("MasterControls.js");
              
              // EDITOR CONTROLS
              include("EditorControls.js");
              
              // REALISM CONTROLS
              include("RealismControls.js");
              
              // THE STD CONTROLS  //
              include("StdControls.js");
              
              // SAMPLER AREA
              include("Samplers.js");
              
              // SYNTH OSCILATOR AREA
              //include("Synths.js");
              
              // ENVELOPES AREA //
              include("GainEnvelopes.js");
              
              //   FILTER AREA    //
              include("Filters.js");
              
              // FILTER ENVELOPES
              include("FilterEnvelopes.js");
              
              // TREM VIB AREA
              include("VibTremSpace2.js");
              
              // UNISON AREA
              include("UnisonSpace.js");
              
              // CONTROL AREA
              include("ControlSpace2.js"); 
              
              // FM AREA
              include("FMSpace.js");
              
              
              // LOOP PLAYER
              //include("LoopPlayerAndBrowser.js");
              
              
              // THE FX AREA //
              
              include("SendEffects2.js");
              
              include("MasterEffects2.js");
              
              
              //include("update.js");
              
              // the ARP
              include("Arp.js");
              
              // the CHORD PLAYER
              include("chordplayer.js");
              
              /// the RANGE SETTERS
              include("RangeSetters.js");
              
              // SETTINGS //
              include("settingsspace.js");
              
              // SOUND BROWSER //
              //include("SoundDataLoader.js");
              //include("SoundBrowser.js");
              include("VoiceExpansions.js");
              include("voicetaggingSelector.js");
              
              
              
              // SOUND randomisation
              include("SoundRandomiser.js");
              
              
              // Authorisation & Demo 
              include("Authorisation.js");
              
              // THE GLOBAL MODULATORS  //
              include("GlobalModulators.js");
              
              //PRESET BROWSER
              include("PresetBrowser.js");
              include("presettagging01.js");
              
              //PATHS
              include("Paths.js");
              
              

              HISE Development for hire.
              www.channelrobot.com

              1 Reply Last reply Reply Quote 1
              • First post
                Last post

              36

              Online

              1.7k

              Users

              11.8k

              Topics

              102.7k

              Posts