HISE Logo Forum
    • Categories
    • Register
    • Login

    How do HISE Snippets Work?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 158 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.
    • CasmatC
      Casmat
      last edited by

      Hey!

      I’m curious, how do HISE snippets work? Is it like a “preset” encoded into base64 format?

      Thanks!

      i make music

      1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff
        last edited by Dan Korneff

        {
        	MainController::ScopedEmbedAllResources sd(bp);
            
        	ValueTree v = bp->getMainSynthChain()->exportAsValueTree();
        
        	MemoryOutputStream mos;
        
        	v.writeToStream(mos);
        
        	MemoryOutputStream mos2;
        
        	GZIPCompressorOutputStream zipper(&mos2, 9);
        	
        	zipper.write(mos.getData(), mos.getDataSize());
        	zipper.flush();
        
        	String data = "HiseSnippet " + mos2.getMemoryBlock().toBase64Encoding();
        
        	SystemClipboard::copyTextToClipboard(data);
        
        	if (!MainController::inUnitTestMode())
        	{
        		PresetHandler::showMessageWindow("Preset copied as compressed snippet", "You can paste the clipboard content to share this preset", PresetHandler::IconType::Info);
        	}
        	
        }
        

        Dan Korneff - Producer / Mixer / Audio Nerd

        CasmatC 1 Reply Last reply Reply Quote 0
        • CasmatC
          Casmat @Dan Korneff
          last edited by

          @Dan-Korneff ooh thats interesting! Thanks!

          i make music

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

          53

          Online

          1.7k

          Users

          11.7k

          Topics

          102.1k

          Posts