Page 1 of 3

FR: Sample End

Posted: 11 Nov 2020 14:15
by Lytz1
Hey there,

I've seen quite some people over the time requesting some sort of
sample editing. (i.e. independent loop points, loop editing,
sample editing and so on to better work with samples (especially when "loop" is on))

I can imagine that this is pretty involved but
maybe consider at least adding a sample end slider for the time being.
That would already help a lot with loop/pingpong/crossfade
samples that have either a lot of silence at the end (which is typical) or are a loop in itself where we only want to
loop a specific portion of that loop.

Right now, everything like this involves destructive editing with an external sample editor which is a pretty time consuming
process that involves multiple steps when working from Radium.

Best,
tL.

Re: FR: Sample End

Posted: 11 Nov 2020 14:43
by kjetil
Every time I start thinking about these tings I end up in a deep dark hole of complexity. It's hard because the sampler instrument in radium supports unlimited number of samples where each sample can be assigned to any key and have independent loop start/end setting. This is necessary in order to play soundfonts and xi instruments. It is possible to just force all samples to have the same loop settings though, but it hurts doing hacks like that.

Re: FR: Sample End

Posted: 11 Nov 2020 14:57
by kjetil
That's what the function "ra.setInstrumentLoopData" does by the way. Here's a quick GUI for it:

Code: Select all

(let ()
  (define has-started #f)
  (define start 0)
  (define end 1)
  (define (set2)
    (if has-started
        (<ra> :set-instrument-loop-data (<ra> :get-current-instrument) start (- end start))))
  (define slider1 (<gui> :horizontal-int-slider "Start:" 0 0 48000 (lambda (asdf)
                                                                     (set! start asdf)
                                                                     (set2))))
  (define slider2 (<gui> :horizontal-int-slider "End" -5 10 48000 (lambda (asdf)
                                                                    (set! end asdf)
                                                                    (set2))))
  (define group (<gui> :group "stuff"
                       (<gui> :vertical-layout
                              slider1
                              slider2)))
  (<gui> :show group)
  (<gui> :set-parent group -1)
  (set! has-started #t))

Re: FR: Sample End

Posted: 12 Nov 2020 12:30
by Lytz1
Every time I start thinking about these tings I end up in a deep dark hole of complexity. It's hard because the sampler instrument in radium supports unlimited number of samples where each sample can be assigned to any key and have independent loop start/end setting. This is necessary in order to play soundfonts and xi instruments. It is possible to just force all samples to have the same loop settings though, but it hurts doing hacks like that.
I understand. However, I do not see why this would have any impact on a general sample END setting?
I am not talking about loop markers, loop settings. Just like the sample start slider --> a sample end slider.

Re: FR: Sample End

Posted: 12 Nov 2020 12:32
by Lytz1
kjetil wrote: 11 Nov 2020 14:57 That's what the function "ra.setInstrumentLoopData" does by the way. Here's a quick GUI for it:

Code: Select all

(let ()
  (define has-started #f)
  (define start 0)
  (define end 1)
  (define (set2)
    (if has-started
        (<ra> :set-instrument-loop-data (<ra> :get-current-instrument) start (- end start))))
  (define slider1 (<gui> :horizontal-int-slider "Start:" 0 0 48000 (lambda (asdf)
                                                                     (set! start asdf)
                                                                     (set2))))
  (define slider2 (<gui> :horizontal-int-slider "End" -5 10 48000 (lambda (asdf)
                                                                    (set! end asdf)
                                                                    (set2))))
  (define group (<gui> :group "stuff"
                       (<gui> :vertical-layout
                              slider1
                              slider2)))
  (<gui> :show group)
  (<gui> :set-parent group -1)
  (set! has-started #t))
You mean that this does set the loop points? It looks like that. However, just a sample end adjustment
would be fine.

Would I need to put the function inside the (in my case) "myscheme.scm"?

Re: FR: Sample End

Posted: 12 Nov 2020 12:38
by kjetil
Lytz1 wrote: 12 Nov 2020 12:30
Every time I start thinking about these tings I end up in a deep dark hole of complexity. It's hard because the sampler instrument in radium supports unlimited number of samples where each sample can be assigned to any key and have independent loop start/end setting. This is necessary in order to play soundfonts and xi instruments. It is possible to just force all samples to have the same loop settings though, but it hurts doing hacks like that.
I understand. However, I do not see why this would have any impact on a general sample END setting?
I am not talking about loop markers, loop settings. Just like the sample start slider --> a sample end slider.
It has an impact on instruments that has loop points different places in more than one sample. One hack to work around this would be to disable the ability to set loop start/end points for such instruments. Guess i'll do that.

Re: FR: Sample End

Posted: 12 Nov 2020 12:41
by kjetil
Lytz1 wrote: 12 Nov 2020 12:32
kjetil wrote: 11 Nov 2020 14:57 That's what the function "ra.setInstrumentLoopData" does by the way. Here's a quick GUI for it:

Code: Select all

(let ()
  (define has-started #f)
  (define start 0)
  (define end 1)
  (define (set2)
    (if has-started
        (<ra> :set-instrument-loop-data (<ra> :get-current-instrument) start (- end start))))
  (define slider1 (<gui> :horizontal-int-slider "Start:" 0 0 48000 (lambda (asdf)
                                                                     (set! start asdf)
                                                                     (set2))))
  (define slider2 (<gui> :horizontal-int-slider "End" -5 10 48000 (lambda (asdf)
                                                                    (set! end asdf)
                                                                    (set2))))
  (define group (<gui> :group "stuff"
                       (<gui> :vertical-layout
                              slider1
                              slider2)))
  (<gui> :show group)
  (<gui> :set-parent group -1)
  (set! has-started #t))
You mean that this does set the loop points? It looks like that. However, just a sample end adjustment
would be fine.

Would I need to put the function inside the (in my case) "myscheme.scm"?
Yes.
1. Copy this function to myscheme.scm:

Code: Select all

(define (open-loop-editor)
  (define has-started #f)
  (define start 0)
  (define end 1)
  (define (set2)
    (if has-started
        (<ra> :set-instrument-loop-data (<ra> :get-current-instrument) start (- end start))))
  (define slider1 (<gui> :horizontal-int-slider "Start:" 0 0 48000 (lambda (asdf)
                                                                     (set! start asdf)
                                                                     (set2))))
  (define slider2 (<gui> :horizontal-int-slider "End" -5 10 48000 (lambda (asdf)
                                                                    (set! end asdf)
                                                                    (set2))))
  (define group (<gui> :group "stuff"
                       (<gui> :vertical-layout
                              slider1
                              slider2)))
  (<gui> :show group)
  (<gui> :set-parent group -1)
  (set! has-started #t))
2. Add this line to keybindings.conf:

Code: Select all

F1 : ra.evalScheme "(open-loop-editor)"

Re: FR: Sample End

Posted: 12 Nov 2020 12:42
by kjetil
kjetil wrote: 12 Nov 2020 12:38
Lytz1 wrote: 12 Nov 2020 12:30
Every time I start thinking about these tings I end up in a deep dark hole of complexity. It's hard because the sampler instrument in radium supports unlimited number of samples where each sample can be assigned to any key and have independent loop start/end setting. This is necessary in order to play soundfonts and xi instruments. It is possible to just force all samples to have the same loop settings though, but it hurts doing hacks like that.
I understand. However, I do not see why this would have any impact on a general sample END setting?
I am not talking about loop markers, loop settings. Just like the sample start slider --> a sample end slider.
It has an impact on instruments that has loop points different places in more than one sample. One hack to work around this would be to disable the ability to set loop start/end points for such instruments. Guess i'll do that.
Oh, sorry, just End, not loop end? Sure, that is possible.

Re: FR: Sample End

Posted: 12 Nov 2020 12:44
by kjetil
kjetil wrote: 12 Nov 2020 12:42
kjetil wrote: 12 Nov 2020 12:38
Lytz1 wrote: 12 Nov 2020 12:30

I understand. However, I do not see why this would have any impact on a general sample END setting?
I am not talking about loop markers, loop settings. Just like the sample start slider --> a sample end slider.
It has an impact on instruments that has loop points different places in more than one sample. One hack to work around this would be to disable the ability to set loop start/end points for such instruments. Guess i'll do that.
Oh, sorry, just End, not loop end? Sure, that is possible.
But note that if the sample has custom loop start and end points, those will be used for looping when looping is enabled, not sample start and sample end.

Re: FR: Sample End

Posted: 12 Nov 2020 12:47
by kjetil
Note that the ra:set-instrument-loop-data function might cause crash in peak rendering code, I think it was, for extreme or illegal values, so you should be a little careful. And no need to send crash reports. I'll fix this though. The function was made for the tracker module importer only, i.e. it is more of an internal function, so it hasn't been tested for illegal and extreme values.