From 945eb221209a6c3c00b2f0fcbbc7e19b343ee9d9 Mon Sep 17 00:00:00 2001 From: Jake Zerrer Date: Fri, 7 Nov 2025 15:42:03 -0500 Subject: Add new instrument --- dev/scratch.clj | 37 +++++++++++++++++------------------ dev/user.clj | 1 + src/unheard/instrument/minilab3.clj | 39 ++++--------------------------------- src/unheard/instrument/omx_27.clj | 11 +++++++++++ src/unheard/instrument/util.clj | 39 +++++++++++++++++++++++++++++++++++++ src/unheard/midi.clj | 23 +++++++++++----------- 6 files changed, 85 insertions(+), 65 deletions(-) create mode 100644 src/unheard/instrument/omx_27.clj create mode 100644 src/unheard/instrument/util.clj diff --git a/dev/scratch.clj b/dev/scratch.clj index 8bfa7af..0115233 100644 --- a/dev/scratch.clj +++ b/dev/scratch.clj @@ -1,14 +1,13 @@ (ns scratch (:require [unheard.midi :as midi] [unheard.midi.percussion :refer [kick snare hat]] - [unheard.instrument.minilab3 :refer [minilab3]] + [unheard.instrument.minilab3 :as minilab3] + [unheard.instrument.omx-27 :as omx-27] [unheard.theory :refer [note poly]] [missionary.core :as m])) #_(print-all-midi-devices) -(def midi-keyboard "CoreMIDI4J - Minilab3 MIDI") - (defn triad [>c >tonic] (poly ;; This is a major cord, @@ -22,10 +21,11 @@ [{:keys [clock tonic]}] (poly (triad clock tonic) + (triad clock (m/latest #(+ % 12) tonic)) ;; The rest of the "song" is a drum pattern. - (note clock 1 1 (m/ap kick)) + (note clock 1 1 (m/ap kick)) (note clock 9 1 (m/ap kick)) (note clock 17 1 (m/ap kick)) (note clock 25 1 (m/ap kick)) @@ -51,21 +51,20 @@ (m/ap (m/?< f))) prn prn)) (def run - (midi/