HISE Logo Forum
    • Categories
    • Register
    • Login

    [feature request] Sample fade out attribute

    Scheduled Pinned Locked Moved General Questions
    4 Posts 2 Posters 173 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.
    • d.healeyD
      d.healey
      last edited by

      I usually use the auto-trim tool for tidying up my samples but I noticed on some of them if I'm holding down my sustain pedal or have a long release time it will hit the end of the sample and just cut off the sound. It would be nice if there is a fade out parameter like we have for loop xfade.

      While it's possible to do a 100ms fade with the gain envelope I don't see a way to apply this to multiple samples at once and it can be manipulated by scripting. Also 100ms isn't always long enough.

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

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

        My new solution, use a bash script!

        #!/bin/bash
        
        input_folder="$1"
        output_folder="$input_folder/processed"
        fade_time=${2:-200}
        
        # Create the output folder if it doesn't exist
        mkdir -p "$output_folder"
        
        # Process each WAV file in the input folder
        for input_file in "$input_folder"/*.wav; do
            if [ -f "$input_file" ]; then
                file_name=$(basename "$input_file")
                output_file="$output_folder/${file_name%.wav}.wav"     
        
                # Trim silence from the start and end and add a 200ms fade out
                sox "$input_file" "$output_file" silence 1 0.1 0.1% reverse silence 1 0.1 0.2% fade p 00:00:00.$fade_time reverse
        
                echo "Processed: $input_file"
            fi
        done
        
        echo "Processing complete. Output files saved to: $output_folder"
        

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

        A 1 Reply Last reply Reply Quote 0
        • A
          aaronventure @d.healey
          last edited by

          @d-healey Does SoX produce better results than ffmpeg? What made you change that up?

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

            @aaronventure SoX is faster as it doesn't have to re-encode the audio. I'm also more familiar with using it than I am with ffmpeg and found I could fine tune the trimming and fading more easily - I don't think that's a limitation of ffmeg though, just my knowledge.

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

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

            20

            Online

            1.7k

            Users

            11.8k

            Topics

            102.6k

            Posts