def clicks(times=None, frames=None, sr=<NUM_LIT>, hop_length=<NUM_LIT>,<EOL>click_freq=<NUM_LIT>, click_duration=<NUM_LIT:0.1>, click=None, length=None):
<EOL>if times is None:<EOL><INDENT>if frames is None:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT>positions = frames_to_samples(frames, hop_length=hop_length)<EOL><DEDENT>else:<EOL><INDENT>positions = time_to_samples(times, sr=sr)<EOL><DEDENT>if click is not None:<EOL><INDENT>util.valid_audio(click, mono=True)<EOL><DEDENT>else:<EOL><INDENT>if click_duration <= <NUM_LIT:0>:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT>if click_freq <= <NUM_LIT:0>:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT>angular_freq = <NUM_LIT:2> * np.pi * click_freq / float(sr)<EOL>click = np.logspace(<NUM_LIT:0>, -<NUM_LIT:10>,<EOL>num=int(np.round(sr * click_duration)),<EOL>base=<NUM_LIT>)<EOL>click *= np.sin(angular_freq * np.arange(len(click)))<EOL><DEDENT>if length is None:<EOL><INDENT>length = positions.max() + click.shape[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>if length < <NUM_LIT:1>:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT>positions = positions[positions < length]<EOL><DEDENT>click_signal = np.zeros(length, dtype=np.float32)<EOL>for start in positions:<EOL><INDENT>end = start + click.shape[<NUM_LIT:0>]<EOL>if end >= length:<EOL><INDENT>click_signal[start:] += click[:length - start]<EOL><DEDENT>else:<EOL><INDENT>click_signal[start:end] += click<EOL><DEDENT><DEDENT>return click_signal<EOL>
Returns a signal with the signal `click` placed at each specified time

    Parameters
    ----------
    times : np.ndarray or None
        times to place clicks, in seconds

    frames : np.ndarray or None
        frame indices to place clicks

    sr : number > 0
        desired sampling rate of the output signal

    hop_length : int > 0
        if positions are specified by `frames`, the number of samples between frames.

    click_freq : float > 0
        frequency (in Hz) of the default click signal.  Default is 1KHz.

    click_duration : float > 0
        duration (in seconds) of the default click signal.  Default is 100ms.

    click : np.ndarray or None
        optional click signal sample to use instead of the default blip.

    length : int > 0
        desired number of samples in the output signal


    Returns
    -------
    click_signal : np.ndarray
        Synthesized click signal


    Raises
    ------
    ParameterError
        - If neither `times` nor `frames` are provided.
        - If any of `click_freq`, `click_duration`, or `length` are out of range.


    Examples
    --------
    >>> # Sonify detected beat events
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
    >>> y_beats = librosa.clicks(frames=beats, sr=sr)

    >>> # Or generate a signal of the same length as y
    >>> y_beats = librosa.clicks(frames=beats, sr=sr, length=len(y))

    >>> # Or use timing instead of frame indices
    >>> times = librosa.frames_to_time(beats, sr=sr)
    >>> y_beat_times = librosa.clicks(times=times, sr=sr)

    >>> # Or with a click frequency of 880Hz and a 500ms sample
    >>> y_beat_times880 = librosa.clicks(times=times, sr=sr,
    ...                                  click_freq=880, click_duration=0.5)

    Display click waveform next to the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S = librosa.feature.melspectrogram(y=y, sr=sr)
    >>> ax = plt.subplot(2,1,2)
    >>> librosa.display.specshow(librosa.power_to_db(S, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,1, sharex=ax)
    >>> librosa.display.waveplot(y_beat_times, sr=sr, label='Beat clicks')
    >>> plt.legend()
    >>> plt.xlim(15, 30)
    >>> plt.tight_layout()