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
  • PmEvent_note_off_p    xtlang
  • PmEvent_note_on_p    xtlang
  • active_notes    xtlang
  • active_notes    xtlang
  • analogueVec_note    xtlang
  • analogue_note    xtlang
  • cerberus_note    xtlang
  • cl:notevery    scheme
  • close-note-gate    scheme
  • curl_setopts_basic    xtlang
  • dlogue_note    xtlang
  • fmsynth_note    xtlang
  • homo-play-midi-note    scheme
  • homo-play-midi-note    scheme
  • instrument_find_note    xtlang
  • midi-note-off    scheme
  • midi-note-on    scheme
  • midi_note_off    xtlang
  • midi_note_off    xtlang
  • midi_note_off    xtlang
  • midi_note_on    xtlang
  • midi_note_on    xtlang
  • midi_note_on    xtlang
  • note-active    xtlang
  • note-activity    xtlang
  • note-grad    xtlang
  • note-pitch    xtlang
  • play-midi-note    scheme
  • play-midi-note    scheme
  • play-note    scheme
  • sampler-parse-midinote-filename    scheme
  • sampler_note    xtlang
  • sampler_note_linear    xtlang
  • saw_synth_note_c    xtlang
  • saw_synth_note_c    xtlang
  • start-note    scheme
  • stop-note    scheme
  • world_basic_print    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_notequal    xtlang
  • xtm_play_note    xtlang
  • xtm_release_note    xtlang
  • xtm_start_note    xtlang
  • xtm_stop_note    xtlang