basic_note   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/instruments/basicsynth.xtm

Implementation

;; Basic
;;
;; an example of the most basic instrument possible
;; simply plays back a sine wave
;;
(bind-func basic_note
  (lambda ()
    (lambda (data:NoteData* nargs:i64 dargs:SAMPLE*)
      (let ((starttime (note_starttime data))  ;; start time
            (frequency (note_frequency data))  ;; you'll probably want the note frequency (in hz)
            (amplitude (note_amplitude data))  ;; you'll probably want the note amplitude (0.0-1.0)
            (duration (note_duration data))   ;; you'll probably need the duration (in samples)
            (osc (osc_mc_c 0.0)))
        (lambda (time:i64 chan:i64)
           ;; you are responsible for stopping a note by setting note_running to #f!
          (if (> (- time starttime) duration) (note_active data #f))
          (osc chan amplitude frequency))))))


Back to Index

Similar Entries

  • LFO_OPT_NOTEDUR    scheme    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • PmEvent_note_off_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • PmEvent_note_on_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • active_notes    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/instrument_params.xtm
  • active_notes    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • analogueVec_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue.xtm
  • analogue_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue.xtm
  • cerberus_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus.xtm
  • cl:notevery    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • close-note-gate    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • curl_setopts_basic    xtlang    /digego/extempore/tree/v0.8.9/libs/external/curl.xtm
  • dlogue_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • fmsynth_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/fmsynth.xtm
  • homo-play-midi-note    scheme    /digego/extempore/tree/v0.8.9/libs/contrib/rtmidi-scm.xtm
  • homo-play-midi-note    scheme    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • instrument_find_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • midi-note-off    scheme    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • midi-note-on    scheme    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • midi_note_off    xtlang    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • midi_note_off    xtlang    /digego/extempore/tree/v0.8.9/examples/core/midi_synth.xtm
  • midi_note_off    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/midisetup.xtm
  • midi_note_on    xtlang    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • midi_note_on    xtlang    /digego/extempore/tree/v0.8.9/examples/core/midi_synth.xtm
  • midi_note_on    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/midisetup.xtm
  • note-active    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • note-activity    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • note-grad    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • note-pitch    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • play-midi-note    scheme    /digego/extempore/tree/v0.8.9/libs/contrib/rtmidi-scm.xtm
  • play-midi-note    scheme    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • play-note    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • sampler-parse-midinote-filename    scheme    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext-scm.xtm
  • sampler_note    xtlang    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext.xtm
  • sampler_note_linear    xtlang    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext.xtm
  • saw_synth_note_c    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/polysynth.xtm
  • saw_synth_note_c    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/polysynth.xtm
  • start-note    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • stop-note    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • world_basic_print    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/game-of-life.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_notequal    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_play_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • xtm_release_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • xtm_start_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • xtm_stop_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm