HISE Logo Forum
    • Categories
    • Register
    • Login

    Convert complex SVG in HISE

    Scheduled Pinned Locked Moved General Questions
    7 Posts 5 Posters 337 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.
    • L
      Lumi283
      last edited by

      Hi, do you know how it would be possible to convert a complex SVG in Path Array?

      For example, the in hise converter doesn't work for this svg:

      da65110b-2f21-4fad-96be-68f3d219aa42-image.png

      This is to preview midi files in my VST midi browser.

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

        @Lumi283 Post the svg

        You could draw that quite easily in a paint routine too since it's just rectangles

        A d.healeyD 2 Replies Last reply Reply Quote 0
        • A
          aaronventure @d.healey
          last edited by

          @d-healey the issue is that separate paths need separate variables and then you need to map them out within bounds manually.

          Also, in order to draw this manually, op would need to pull out data from the midi file and write an algorithm that draws this.

          This way the worklow is just to capture a screenshot, trace it in illustrator or something and upload an svg.

          oskarshO Christoph HartC 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @d.healey
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • oskarshO
              oskarsh @aaronventure
              last edited by oskarsh

              @Lumi283 yes you need to use regex to get all paths from that svg and combine them. I wrote a svg parser for this which works that way.

              I might be able to post this later here but behind the scenes it’s just using regex

              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @aaronventure
                last edited by

                The SVG must be a single shape. In most vector design apps you can coallascate the shapes into one thingie, then select this and convert it / export it. But this looks like something that can and should be fully automated.

                I've added an example to the Snippet browser that will programmatically create thumbnail path strings that you can use in HISE from all your MIDI files in the current project.

                Link Preview Image
                HISE | Docs

                favicon

                (docs.hise.dev)

                d.healeyD 1 Reply Last reply Reply Quote 2
                • d.healeyD
                  d.healey @Christoph Hart
                  last edited by d.healey

                  @Christoph-Hart said in Convert complex SVG in HISE:

                  The SVG must be a single shape.

                  You can combine multiple shapes within the path converter. You have to paste them in one after another.

                  0a109a66-3ab2-4d92-8e49-c607920989ae-image.png

                  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
                  <!-- Created with Inkscape (http://www.inkscape.org/) -->
                  
                  <svg
                     width="1000"
                     height="1000"
                     viewBox="0 0 264.58333 264.58334"
                     version="1.1"
                     id="svg5"
                     inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
                     sodipodi:docname="test.svg"
                     xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
                     xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
                     xmlns="http://www.w3.org/2000/svg"
                     xmlns:svg="http://www.w3.org/2000/svg">
                    <sodipodi:namedview
                       id="namedview7"
                       pagecolor="#ffffff"
                       bordercolor="#666666"
                       borderopacity="1.0"
                       inkscape:pageshadow="2"
                       inkscape:pageopacity="0.0"
                       inkscape:pagecheckerboard="0"
                       inkscape:document-units="px"
                       showgrid="false"
                       units="px"
                       inkscape:showpageshadow="false"
                       inkscape:zoom="0.69397447"
                       inkscape:cx="359.52331"
                       inkscape:cy="530.99936"
                       inkscape:current-layer="layer1"
                       inkscape:deskcolor="#d1d1d1" />
                    <defs
                       id="defs2" />
                    <g
                       inkscape:label="Layer 1"
                       inkscape:groupmode="layer"
                       id="layer1">
                      <path
                         id="rect231"
                         style="opacity:1;fill:#957f77;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:bevel;stop-color:#000000"
                         d="m 55.765279,57.537357 h 63.757831 c 1.17263,0 2.11667,0.944034 2.11667,2.116667 v 22.488307 c 0,1.172633 -0.94404,2.116666 -2.11667,2.116666 H 55.765279 c -1.172633,0 -2.116666,-0.944033 -2.116666,-2.116666 V 59.654024 c 0,-1.172633 0.944033,-2.116667 2.116666,-2.116667 z" />
                      <path
                         id="rect233"
                         style="opacity:1;fill:#800000;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:bevel;stop-color:#000000"
                         d="m 117.36963,118.56291 h 73.29874 c 1.17263,0 2.11666,0.94404 2.11666,2.11667 v 23.70573 c 0,1.17263 -0.94403,2.11667 -2.11666,2.11667 h -73.29874 c -1.17263,0 -2.11666,-0.94404 -2.11666,-2.11667 v -23.70573 c 0,-1.17263 0.94403,-2.11667 2.11666,-2.11667 z" />
                    </g>
                  </svg>
                  
                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post

                  33

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  103.0k

                  Posts