-
Notifications
You must be signed in to change notification settings - Fork 0
/
synth.clj
92 lines (72 loc) · 2.15 KB
/
synth.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
(ns omkamra.fluidsynth.synth
(:require [omkamra.fluidsynth.api :refer [$fl]]
[omkamra.fluidsynth.settings :as settings]))
(defn create
([settings]
(if (map? settings)
(create (settings/create settings))
(.new_fluid_synth $fl settings)))
([]
(create settings/default-settings)))
(defn delete
[&synth]
(.delete_fluid_synth $fl &synth))
(defn get-settings
[&synth]
(.fluid_synth_get_settings $fl &synth))
(defn noteon
[&synth chan key vel]
(.fluid_synth_noteon $fl &synth chan key vel))
(defn noteoff
[&synth chan key]
(.fluid_synth_noteoff $fl &synth chan key))
(defn cc
[&synth chan ctrl value]
(.fluid_synth_cc $fl &synth chan ctrl value))
(defn pitch-bend
[&synth chan value]
(.fluid_synth_pitch_bend $fl &synth chan value))
(defn program-change
[&synth chan program]
(.fluid_synth_program_change $fl &synth chan program))
(defn bank-select
[&synth chan bank]
(.fluid_synth_bank_select $fl &synth chan bank))
(defn channel-pressure
[&synth chan value]
(.fluid_synth_channel_pressure $fl &synth chan value))
(defn sfont-select
[&synth chan sfont-id]
(.fluid_synth_sfont_select $fl &synth chan sfont-id))
(defn program-select
[&synth chan sfont-id bank-num preset-num]
(.fluid_synth_program_select $fl &synth chan sfont-id
bank-num preset-num))
(defn all-notes-off
[&synth chan]
(.fluid_synth_all_notes_off $fl &synth chan))
(defn all-sounds-off
[&synth chan]
(.fluid_synth_all_sounds_off $fl &synth chan))
(defn set-channel-type
[&synth chan type]
(.fluid_synth_set_channel_type $fl &synth chan type))
(defn sfload
([&synth filename]
(sfload &synth filename 1))
([&synth filename reset-presets]
(.fluid_synth_sfload $fl &synth filename reset-presets)))
(defn sfreload
[&synth id]
(.fluid_synth_sfreload $fl &synth id))
(defn sfunload
([&synth id]
(.fluid_synth_sfunload $fl &synth id 1))
([&synth id reset-presets]
(.fluid_synth_sfunload $fl &synth id reset-presets)))
(defn set-bank-offset
[&synth id offset]
(.fluid_synth_set_bank_offset $fl &synth id offset))
(defn get-cpu-load
[&synth]
(.fluid_synth_get_cpu_load $fl &synth))