HISE Logo Forum
    • Categories
    • Register
    • Login

    Can I play wav files ?

    Scheduled Pinned Locked Moved General Questions
    12 Posts 3 Posters 711 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.
    • M
      MusoCity
      last edited by

      I made this for Reaper in Lua script and would like to port it to HISE so it can be used in any DAW.
      I would like some advice if you think this is possible, thanks.
      https://forum.cockos.com/showthread.php?t=252609

      alt text

      It basically just imports the sections from the wav file to fit the same sections in the chord/bar sheet.
      The chord/bar sheet will follow the DAW time signature.

      The wav will have a region/chord csv with the section name/chord, time position and section color in the wav:

      #,Name,Start,End,Length,Color
      R1,C,1.1.00,3.1.00,2.0.00,FF80C0
      R2,C,3.1.00,7.1.00,4.0.00,3776EB
      R3,C#,7.1.00,11.1.00,4.0.00,3776EB
      R4,D,11.1.00,15.1.00,4.0.00,3776EB
      R5,D#,15.1.00,19.1.00,4.0.00,3776EB
      

      So it will need to playback the sample section of the wav file from the local disk while adjusting the tempo to match the host.
      Any info and suggestion would be much appreciated.

      1 Reply Last reply Reply Quote 0
      • M
        MusoCity
        last edited by

        No go...

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

          @MusoCity really still not clear what you want HISE to do for you...dynamically import wav files?

          HISE Development for hire.
          www.channelrobot.com

          1 Reply Last reply Reply Quote 0
          • M
            MusoCity
            last edited by

            Play back a sample section of the source wav.
            In the pic below the top track is the source file,
            the second track is chord sections of the track being played back.
            These will playback @ DAW bpm.
            Full Screen
            alt text

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

              @MusoCity HISE can't play back audio that's in a DAW it can only playback audio that is present in the plugin.

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

              M 1 Reply Last reply Reply Quote 0
              • M
                MusoCity @d.healey
                last edited by

                @d-healey said in Can I play wav files ?:

                @MusoCity HISE can't play back audio that's in a DAW it can only playback audio that is present in the plugin.

                The files are in a folder on the hard drive, the pic is just to show what I need, the DAW is playing them direct from the hard drive, this is what I need HISE to do, play a C section, play an Am section, play a G section........ etc
                the csv gives the time location and length in the wav.
                "it can only playback audio that is present in the plugin." "in" is that from a sample source on disk ?

                alt text
                alt text

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

                  @MusoCity HISE can only play back files that you have mapped in a sampler or loaded into an audio loop player module. It can't play arbitrary files of the user's choosing.

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

                  1 Reply Last reply Reply Quote 0
                  • M
                    MusoCity
                    last edited by

                    Do you know of anything else ?
                    I tried https://www.osar.fr/protoplug/ but could not get the wav to play with the supplied Lua script:

                    --[[
                    name: soundfile test
                    description: A simple demo that plays an audio file.
                    author: osar.fr
                    --]]
                    
                    require "include/protoplug"
                    
                    local path = "C:\\Temp\\Drums120bpm.wav"
                    local wave, len
                    
                    -- 'prepareToPlay' will be triggered when the host sample rate is known,
                    -- so we can load sound files with automatic sample rate conversion:
                    plugin.addHandler('prepareToPlay', function()
                    	local readr = juce.AudioFormatReader(path)
                    	if readr==nil then error ("can't open wave: "..path) end
                    	wave, len = readr:readToFloat(2) -- require 2 channels
                    end)
                    
                    polyGen.initTracks(8)
                    
                    function polyGen.VTrack:noteOn(note, vel, ev)
                    	self.playing = true
                    	self.wavepos = 0
                    end
                    
                    function polyGen.VTrack:noteOff(note, ev)
                    	self.playing = false
                    end
                    
                    function polyGen.VTrack:addProcessBlock(samples, smax)
                    	for i = 0,smax do
                    		if self.playing and self.wavepos < len then
                    			self.wavepos = self.wavepos + 1
                    			samples[0][i] = samples[0][i] + wave[0][self.wavepos] -- left
                    			samples[1][i] = samples[1][i] + wave[1][self.wavepos] -- right
                    		end
                    	end
                    end
                    
                    1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey
                      last edited by

                      If C++ is an option I'd recommend doing it directly with JUCE. If you can do it as a standalone app instead of a plugin then it might be something you could do with Electron.

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

                      1 Reply Last reply Reply Quote 0
                      • M
                        MusoCity
                        last edited by

                        If we all knew C++ we wouldn't be here :(
                        They have to playback in sync with the other DAW tracks so yeah needs to be in a VST.
                        Maybe I'll just forget about it and go down the beach :)

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

                          @MusoCity I can recommend a good C++ developer if you want to hire it out.

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

                          1 Reply Last reply Reply Quote 0
                          • M
                            MusoCity
                            last edited by

                            Now I had a look at HISE and there is an Audio Loop Player.
                            Can I drop a long wav in, set the Loop to 2 or 4 bars, set the sample pos start sample pos end, assign that to a midi chord input. So when a C chord is played it will loop that section of the wav , then C# chord will loop another section and so on ?

                            alt text

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

                            53

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            102.1k

                            Posts