def unpitched_low(dur, idx):
  """
  Non-harmonic bass/lower frequency sound as a list (due to memoization).

  Parameters
  ----------
  dur:
    Duration, in samples.
  idx:
    Zero or one (integer), for a small difference to the sound played.

  Returns
  -------
  A list with the synthesized note.

  """
  env = sinusoid(lag_to_freq(dur * 2)).limit(dur) ** 2
  freq = 40 + 20 * sinusoid(1000 * Hz, phase=uniform(-pi, pi)) # Hz
  result = (low_table(freq * Hz) + low_table(freq * 1.1 * Hz)) * env * .5
  return list(result)
Exemplo n.º 2
0
def unpitched_low(dur, idx):
    """
  Non-harmonic bass/lower frequency sound as a list (due to memoization).

  Parameters
  ----------
  dur:
    Duration, in samples.
  idx:
    Zero or one (integer), for a small difference to the sound played.

  Returns
  -------
  A list with the synthesized note.

  """
    env = sinusoid(lag_to_freq(dur * 2)).limit(dur)**2
    freq = 40 + 20 * sinusoid(1000 * Hz, phase=uniform(-pi, pi))  # Hz
    result = (low_table(freq * Hz) + low_table(freq * 1.1 * Hz)) * env * .5
    return list(result)
Exemplo n.º 3
0
def zcross_pitch(sig, size=2048, hop=None):
  for blk in zcross(sig, hysteresis=.01).blocks(size=size, hop=hop):
    crossings = sum(blk)
    yield 0. if crossings == 0 else lag_to_freq(2. * size / crossings)
Exemplo n.º 4
0
def zcross_pitch(sig, size=2048, hop=None):
    for blk in zcross(sig, hysteresis=.01).blocks(size=size, hop=hop):
        crossings = sum(blk)
        yield 0. if crossings == 0 else lag_to_freq(2. * size / crossings)