HISE Logo Forum
    • Categories
    • Register
    • Login

    New API: Server and FileSystem

    Scheduled Pinned Locked Moved General Questions
    71 Posts 8 Posters 5.3k 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.
    • A
      arminh
      last edited by

      @Christoph-Hart unfortunly it still not work. I tried use other place but still the same error. Im using latest scriptnode.

      constant not found: FileSystem.Desktop
      
      A 1 Reply Last reply Reply Quote 0
      • A
        arminh @arminh
        last edited by

        @Christoph-Hart any solution?

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

          I'll take a look tomorrow.

          1 Reply Last reply Reply Quote 1
          • B
            BWSounds @Christoph Hart
            last edited by

            @Christoph-Hart said in New API: Server and FileSystem:

            You need to create a reference to the folder first:

            const var audioFiles = FileSystem.getFolder(FileSystem.AudioFiles);
            
            FileSystem.findFiles(audioFiles, "*.wav", true);
            

            Also use the constant FileSystem.AudioFiles instead of "AudioFiles".

            Can we do this with MIDI FILES?

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

              Are you talking about embedded Midi files or files on the user‘s disk?

              Embedded files should be retrievable with MidiPlayer.getMidiFileList() - it‘s not implemented yet but it will follow the same logic as Sampler.getSampleMapList().

              B 1 Reply Last reply Reply Quote 1
              • A
                arminh
                last edited by

                @Christoph-Hart you had a chance to check why consts not working properly?

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

                  @Christoph-Hart said in New API: Server and FileSystem:

                  Are you talking about embedded Midi files or files on the user‘s disk?

                  Embedded files should be retrievable with MidiPlayer.getMidiFileList() - it‘s not implemented yet but it will follow the same logic as Sampler.getSampleMapList().

                  Files on a user's disk. Really a way to save or create a path for midi files.

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

                    @arminh I've just committed the fix, it should work now.

                    @BWSounds Now you can pass in scriptfile objects into MidiPlayer.saveAsMidiFile / MidiPlayer.setFile (Plus you got MidiPlayer.getMidiFileList()` for all internal references).

                    A B 2 Replies Last reply Reply Quote 1
                    • A
                      arminh @Christoph Hart
                      last edited by arminh

                      @Christoph-Hart ok audio files work but desktop not :)

                      constant not found: FileSystem.Desktop {SW50ZXJmYWNlfHwyMzJ8MTB8NjU=}
                      
                      

                      Is there option to show file name of object?

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

                        Damn that‘s annoying ;)

                        Change line 4389 from 6 to 9, it ran out of the predefined slots...

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

                          Never mind, I've fixed it, so you can just pull.

                          A 1 Reply Last reply Reply Quote 1
                          • A
                            arminh @Christoph Hart
                            last edited by arminh

                            @Christoph-Hart thanks! :) And how to exctract name or path from object? I don't see any method in API to do this :)
                            Using trace gives me empty Interface log.

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

                              Link Preview Image
                              HISE | Docs

                              favicon

                              (docs.hise.audio)

                              A 1 Reply Last reply Reply Quote 0
                              • A
                                arminh @Christoph Hart
                                last edited by arminh

                                @Christoph-Hart thanks a lot. I also used Filename but the result is the same as with FullPath.

                                Using this

                                for (f in files)
                                {
                                    var p = f.toString(Filename);
                                    audioArr.push(p);
                                }
                                

                                gives me links like this

                                "/Users/armin/Library/Application Support/My Company/test/filez/pluck5.wav",
                                
                                1 Reply Last reply Reply Quote 1
                                • B
                                  BWSounds @Christoph Hart
                                  last edited by BWSounds

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    arminh
                                    last edited by

                                    @Christoph-Hart can you add option to set own headers in Server API?

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

                                      There already is Server.setHttpHeader:

                                      Link Preview Image
                                      HISE | Docs

                                      favicon

                                      (docs.hise.audio)

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

                                        Is there a way to set the FileSystem.browse() startFolder to be a sub-folder?
                                        I'm looking to use a button to browse to the UserPresets folder of an Expansion.

                                        FileSystem.Expansions
                                        

                                        gets me to the root..

                                        I've tried:

                                        FileSystem.Expansions.UserPresets
                                        FileSystem.Expansions/UserPresets
                                        

                                        no go.

                                        Dan Korneff - Producer / Mixer / Audio Nerd

                                        1 Reply Last reply Reply Quote 0
                                        • Casey KolbC
                                          Casey Kolb
                                          last edited by Casey Kolb

                                          @dustbro

                                          I think you just need to do something like this:

                                          var folder = FileSystem.getFolder(FileSystem.Expansions).getChildFile("UserPresets");
                                          FileSystem.browse(folder, false, "", function() {});
                                          

                                          Casey Kolb
                                          Founder & CEO of Lunacy Audio
                                          Composer | Producer | Software Developer

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

                                            Is there anything special I have to do while using getParentDirectory?

                                            I'm trying to get the directory of a file, but it's returning the full file path with file name.
                                            e.g. C://Folder/audio.wav

                                            Same as if I call FullFilePath

                                            Dan Korneff - Producer / Mixer / Audio Nerd

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            14

                                            Online

                                            1.7k

                                            Users

                                            11.9k

                                            Topics

                                            103.5k

                                            Posts