Thanks Rory,
I will start with easier one (MIDI Cthulhu type plugin).
I checked MIDIArpSimple example and some others and tried to make something.
<Cabbage>
form caption("MIDI Out"), size(400,120), pluginid("Mout")
keyboard bounds(0,0,400,80)
combobox channel("heythere"), bounds(100, 20, 50, 20), items("1", "2", "3", "4")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=NULL -M0 -Q0 --midi-key=4 --midi-velocity=5
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1
instr 1
; Combox(presets).
kCombo chnget "heythere"
if (kCombo = 2) then
printk2 kCombo
endif
if (kCombo = 3) then
printk2 kCombo
endif
; MIDI chords2.
iNum notnum
print iNum
if (iNum == 2 && kCombo == 2) then
kNoteIndex = p4
kNoteIndex2 = p4+3
kNoteIndex3 = p4+5
midion 1,kNoteIndex, p5
midion 1,kNoteIndex2, p5
midion 1,kNoteIndex3, p5
printk2 kNoteIndex
printk2 kNoteIndex2
printk2 kNoteIndex3
; MIDI chords3.
elseif (iNum == 3 && kCombo == 3) then
kNoteIndex = p4+10
kNoteIndex2 = p4+13
kNoteIndex3 = p4+15
midion 1,kNoteIndex, p5
midion 1,kNoteIndex2, p5
midion 1,kNoteIndex3, p5
printk2 kNoteIndex
printk2 kNoteIndex2
printk2 kNoteIndex3
endif
endin
</CsInstruments>
<CsScore>
#define SCORELEN #86400#
i 101 0 $SCORELEN
f0 z
</CsScore>
My goal is to made VST plugin with these functions:
- One note tigers a chord (there are 20 notes per preset). Also only one active MIDI note at once.
- There must be 40 presets
- All notes form the chord must be highlighted on the keyboard
- User should see played chord name
5)There must be an additional transpose combobox.
And i have several questions:
-
Am i going in the right direction in general? Or there is an easier way to do this … Or maybe there are some stupid thing in my code…
-
What is the practical difference between midion and midion2
-
Do i need to use changed opcode with if statements? If yes, why?
-
In DAW sometimes the MIDI signal is not killed when pressing another note.
-
What is the meaning of CsScore?
#define SCORELEN #86400#
i 101 0 $SCORELEN
f0 z
I managed it to work but can’t find what it means…
6.Any thoughts on how to easier implement 3), 4) and 5)
Yeah…i know there are a lot of questions!
Hope you can help me with these…
Thanks
Edgar