Sending Midi from extempore to Ardour7 DAW

38 views
Skip to first unread message

George

unread,
Jul 22, 2023, 7:01:58 AM7/22/23
to Extempore
Hello all

;;  I'm trying to connect extempore to Ardour7 like I have done with Ableton Live
;;  Following on from Ben’s portmidi.xtm example.
;; And also from Duncan's comments:
;; https://groups.google.com/g/extemporelang/c/9cQqmflEdpY/m/QfaAssH7BgAJ
;; and here:
;; https://groups.google.com/g/extemporelang/c/9cQqmflEdpY/m/neW7PPyaBgAJ

;; Sending Midi from extempore to a Midi Track in Ardour

;; This works fine on Ableton Live but has problems on Ardour 7

(sys:load "libs/external/portmidi.xtm")

(pm_initialize)

;; In "Audio MIDI Set-Up" app I have added a port named
;;  "Extempore Bus". See Transfer MIDI information between apps in Audio MIDI
;; Setup on Mac in the Audio MIDI Set-Up help.

;; In Ardour7 Preferences Settings Midi panel, set the MIDI Control Surface to 'IAC Driver (Extempore BUS)'

(pm_print_devices)

;; I see this printed:
; -- MIDI output devices --
; device id 3 : <PmDeviceInfo: interface=CoreMIDI name=IAC Driver Extempore BUS I/O?:O>

; so I use id 3 to send MIDI to Ardour7 from extempore

;; Create an output stream called *midi2ardour7* to device 3
(define *midi2ardour7* (pm_create_output_stream 3))

;; In Ardour7 I have set a Midi track with an instrument.
;; I have "General Midi Synth" instrument set to get MIDI from "IAC driver (Extempore Bus)" Ch 1.
;; Set Monitor to In and audio to Master.
;; In extempore channel count is zero-based so I set the channel to 0
;;                           time   stream                     pitch          velocity              duration channel
(play-midi-note (now) *midi2ardour7* (random 40 62) (random 40 80) (* 1.3 44100) 0)

;; Now on the FIRST occasion I evaluate the line above I get a sound from the speaker output.
;; As expected.
;; But re-evaluating that same line again get no response.
;; No sound no flash in Ardour - nothing!
;; Quitting out of VSCode and restarting extempore gives me ONE more successful beep.
;; But that's all.
;; Running the same program to send Midi to LIVE sounds out a random note each time the line above is re-evaluated.

;; Does anyone have any clues what’s going on?

Regards
George

George

unread,
Jul 23, 2023, 2:27:37 AM7/23/23
to Extempore
Another thought ...

Ardour7 has a screen called Midi Tracer.
When I send the first note from extempore it shows receipt of a NoteOn in Ch1. And it sounds.
probs with extemp2ardour.png
But no NoteOff ?
I wonder if it is waiting for a NoteOff before it can do anything else?

Further sends from extempore are not detected.

I intend to try something similar sending from TouchOSC

George

George

unread,
Jul 25, 2023, 10:45:08 PM7/25/23
to Extempore
Hi All
Some progress.
;; Now I find the the standard extempore mplay will work where play-midi-note won't:

(sys:load "libs/external/portmidi.xtm")
(pm_initialize)
(pm_print_devices)

; device id 3 : <PmDeviceInfo: interface=CoreMIDI name=IAC Driver Extempore BUS I/O?:O>
(define *midi2ardour7* (pm_create_output_stream 3))
(sys:load "libs/core/pattern-language.xtm")
;; using mplay in pattern language
(:> B2 3/2 0 (mplay *midi2ardour7* @1 (cosr 50 20 7/3) dur 3) '(63 (62 63) 72 69))

;; using mplay in scheme callback loop
(define midi-loop0
  (lambda (beat dur)
    (mplay *midi2ardour7* (random (list 48 60 60 67 70 74 45)) (random 40 50) (* .5 dur) 0)
    (callback (*metro* (+ beat (* 0.4 dur))) 'midi-loop0 (+ beat (* 0.7 dur)) dur)))

(midi-loop0 (*metro* 'get-beat 2) 3/4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Now Midi Tracer shows NotOff and continues....
 I notice in:
that in the definition of play-midi-note, NoteOff is included
so it must be some setting in Ardour7.5 that I don't know about.
Anyhow mplay works and is nice. Ardour7 causes much less heat and fan noise on my MacBk Air than Live.
Then I have a problem of channels. I can't select different channels to send different tunes like you can in Live.
with_mplay.png
George

Reply all
Reply to author
Forward
0 new messages