de.sciss.synth.ugen

Onsets

final case class Onsets(chain: GE, thresh: GE = synth.this.GE.const(0.5), fun: GE = synth.this.GE.const(3), decay: GE = synth.this.GE.const(1.0), noiseFloor: GE = synth.this.GE.const(0.1), minGap: GE = synth.this.GE.const(10), medianSpan: GE = synth.this.GE.const(11), whType: GE = synth.this.GE.const(1), raw: GE = synth.this.GE.const(0)) extends SingleOut with ControlRated with IsIndividual with Product with Serializable

An onset detecting UGen for musical audio signals. It detects the beginning of notes/drumbeats/etc. Outputs a control-rate trigger signal which is 1 when an onset is detected, and 0 otherwise.

The onset detection should work well for a general range of monophonic and polyphonic audio signals. The onset detection is purely based on signal analysis and does not make use of any "top-down" inferences such as tempo.

There are different functions available for the analysis:

- 0 "power" -- generally OK, good for percussive input, and also very efficient - 1 "magsum" -- generally OK, good for percussive input, and also very efficient - 2 "complex" -- performs generally very well, but more CPU-intensive - 3 "rcomplex" (default) -- performs generally very well, and slightly more efficient than "complex" - 4 "phase" -- generally good, especially for tonal input, medium efficiency - 5 "wphase" -- generally very good, especially for tonal input, medium efficiency - 6 "mkl" -- generally very good, medium efficiency, pretty different from the other methods

The differences aren't large, so it is recommended you stick with the default "rcomplex" unless you find specific problems with it. Then maybe try "wphase". The "mkl" type is a bit different from the others so maybe try that too. They all have slightly different characteristics, and in tests perform at a similar quality level.

chain

the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, you should typically use a frame size of 512 or 1024 (at 44.1 kHz sampling rate) and 50% hop size (which is the default setting in SC). For different sampling rates choose an FFT size to cover a similar time-span (around 10 to 20 ms).

thresh

the detection threshold, typically between 0 and 1, although in rare cases you may find values outside this range useful

fun

index of a function to be used to analyse the signal. See main paragraph for possible values (usually can be left to default).

decay

(advanced setting) Specifies the time (in seconds) for the normalisation to "forget" about a recent onset. If you find too much re-triggering (e.g. as a note dies away unevenly) then you might wish to increase this value. Not used with "mkl".

noiseFloor

(advanced setting) This is a lower limit, connected to the idea of how quiet the sound is expected to get without becoming indistinguishable from noise. For some cleanly-recorded classical music with wide dynamic variations, it was found helpful to go down as far as 1e-6. Not used with "mkl".

minGap

(advanced setting) Specifies a minimum gap (in FFT frames) between onset detections, a brute-force way to prevent too many doubled detections.

medianSpan

(advanced setting) Specifies the size (in FFT frames) of the median window used for smoothing the detection function before triggering.

whType

(advanced setting) ?

raw

(advanced setting) ? (init-time only)

See also

PV_HainsworthFoote

PV_JensenAndersen

Linear Supertypes
Serializable, Serializable, IsIndividual, ControlRated, SingleOut, SomeOut, GE.Lazy, GE, UGenSource[UGenInLike], Expander[UGenInLike], Lazy, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Onsets
  2. Serializable
  3. Serializable
  4. IsIndividual
  5. ControlRated
  6. SingleOut
  7. SomeOut
  8. Lazy
  9. GE
  10. UGenSource
  11. Expander
  12. Lazy
  13. Product
  14. Equals
  15. AnyRef
  16. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Onsets(chain: GE, thresh: GE = synth.this.GE.const(0.5), fun: GE = synth.this.GE.const(3), decay: GE = synth.this.GE.const(1.0), noiseFloor: GE = synth.this.GE.const(0.1), minGap: GE = synth.this.GE.const(10), medianSpan: GE = synth.this.GE.const(11), whType: GE = synth.this.GE.const(1), raw: GE = synth.this.GE.const(0))

    chain

    the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, you should typically use a frame size of 512 or 1024 (at 44.1 kHz sampling rate) and 50% hop size (which is the default setting in SC). For different sampling rates choose an FFT size to cover a similar time-span (around 10 to 20 ms).

    thresh

    the detection threshold, typically between 0 and 1, although in rare cases you may find values outside this range useful

    fun

    index of a function to be used to analyse the signal. See main paragraph for possible values (usually can be left to default).

    decay

    (advanced setting) Specifies the time (in seconds) for the normalisation to "forget" about a recent onset. If you find too much re-triggering (e.g. as a note dies away unevenly) then you might wish to increase this value. Not used with "mkl".

    noiseFloor

    (advanced setting) This is a lower limit, connected to the idea of how quiet the sound is expected to get without becoming indistinguishable from noise. For some cleanly-recorded classical music with wide dynamic variations, it was found helpful to go down as far as 1e-6. Not used with "mkl".

    minGap

    (advanced setting) Specifies a minimum gap (in FFT frames) between onset detections, a brute-force way to prevent too many doubled detections.

    medianSpan

    (advanced setting) Specifies the size (in FFT frames) of the median window used for smoothing the detection function before triggering.

    whType

    (advanced setting) ?

    raw

    (advanced setting) ? (init-time only)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val chain: GE

    the output (buffer) of an FFT UGen which transforms the audio input to track.

    the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, you should typically use a frame size of 512 or 1024 (at 44.1 kHz sampling rate) and 50% hop size (which is the default setting in SC). For different sampling rates choose an FFT size to cover a similar time-span (around 10 to 20 ms).

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val decay: GE

    (advanced setting) Specifies the time (in seconds) for the normalisation to "forget" about a recent onset.

    (advanced setting) Specifies the time (in seconds) for the normalisation to "forget" about a recent onset. If you find too much re-triggering (e.g. as a note dies away unevenly) then you might wish to increase this value. Not used with "mkl".

  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. val fun: GE

    index of a function to be used to analyse the signal.

    index of a function to be used to analyse the signal. See main paragraph for possible values (usually can be left to default).

  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. lazy val hashCode: Int

    Definition Classes
    UGenSource → AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. def makeUGens: UGenInLike

    Attributes
    protected
    Definition Classes
    Onsets → Expander
  17. val medianSpan: GE

    (advanced setting) Specifies the size (in FFT frames) of the median window used for smoothing the detection function before triggering.

  18. val minGap: GE

    (advanced setting) Specifies a minimum gap (in FFT frames) between onset detections, a brute-force way to prevent too many doubled detections.

  19. final def name: String

    Definition Classes
    UGenSource
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. val noiseFloor: GE

    (advanced setting) This is a lower limit, connected to the idea of how quiet the sound is expected to get without becoming indistinguishable from noise.

    (advanced setting) This is a lower limit, connected to the idea of how quiet the sound is expected to get without becoming indistinguishable from noise. For some cleanly-recorded classical music with wide dynamic variations, it was found helpful to go down as far as 1e-6. Not used with "mkl".

  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. final def rate: Rate

    Definition Classes
    ControlRated
  25. val raw: GE

    (advanced setting) ? (init-time only)

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. val thresh: GE

    the detection threshold, typically between 0 and 1, although in rare cases you may find values outside this range useful

  28. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. val whType: GE

    (advanced setting) ?

Inherited from Serializable

Inherited from Serializable

Inherited from IsIndividual

Inherited from ControlRated

Inherited from SingleOut

Inherited from SomeOut

Inherited from GE.Lazy

Inherited from GE

Inherited from UGenSource[UGenInLike]

Inherited from Expander[UGenInLike]

Inherited from Lazy

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped