rtmidi_process_message   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/rtmidi.xtm

Implementation

;; an xtlang function which will "pull" the next incoming midi message (if there
;; is one) and then change the pitch of an oscillator
(bind-func rtmidi_process_message
  (let ((type:i8 0) (chan:i8 0) (a:i8 0) (b:i8 0)
        (left:i8 1) (right:i8 2)
        (message:i8* (alloc 1024))
        (size:i64* (alloc)))
    (lambda (dev:RtMidiInPtr)
      (rtmidi_in_get_message dev message size)
      (set! type (>> (pref message 0) 4))
      (set! chan (& (pref message 0) 15))
      (set! a (pref message 1))
      (set! b (pref message 2))
      (println type chan a b)
      (if (= a left) (dsp.freql (+ 110. (pow (i8tof b) 1.25))))
      (if (= a right) (dsp.freqr (+ 110. (pow (i8tof b) 1.25))))
      void)))


Back to Index

Similar Entries

  • Pm_Event_Message    xtlang
  • Pm_Message    xtlang
  • Pm_Message_Channel    xtlang
  • Pm_Message_Data1    xtlang
  • Pm_Message_Data2    xtlang
  • Pm_Message_Status    xtlang
  • Pm_Message_Type    xtlang
  • aiProcess_CalcTangentSpace    scheme
  • aiProcess_Debone    scheme
  • aiProcess_FindDegenerates    scheme
  • aiProcess_FindInstances    scheme
  • aiProcess_FindInvalidData    scheme
  • aiProcess_FixInfacingNormals    scheme
  • aiProcess_FlipUVs    scheme
  • aiProcess_FlipWindingOrder    scheme
  • aiProcess_GenNormals    scheme
  • aiProcess_GenSmoothNormals    scheme
  • aiProcess_GenUVCoords    scheme
  • aiProcess_ImproveCacheLocality    scheme
  • aiProcess_JoinIdenticalVertices    scheme
  • aiProcess_LimitBoneWeights    scheme
  • aiProcess_MakeLeftHanded    scheme
  • aiProcess_OptimizeGraph    scheme
  • aiProcess_OptimizeMeshes    scheme
  • aiProcess_PreTransformVertices    scheme
  • aiProcess_RemoveComponent    scheme
  • aiProcess_RemoveRedundantMaterials    scheme
  • aiProcess_SortByPType    scheme
  • aiProcess_SplitByBoneCount    scheme
  • aiProcess_SplitLargeMeshes    scheme
  • aiProcess_TransformUVCoords    scheme
  • aiProcess_Triangulate    scheme
  • aiProcess_ValidateDataStructure    scheme
  • create_post_process_shader    xtlang
  • fleet_message_all_nodes_sync    xtlang
  • fleet_message_node_sync    xtlang
  • get_browser_process_handler    xtlang
  • get_render_process_handler    xtlang
  • on_before_command_line_processing    xtlang
  • on_process_message_received    xtlang
  • process-multi-variable    scheme
  • rtmidi_default_callback:RtMidiCCallback    xtlang
  • rtmidi_print_ports    xtlang
  • rtmidi_register_callback    xtlang
  • rtmidi_send    xtlang
  • send_process_message    xtlang
  • suppress-compiler-messages    scheme