without using the text editor
Key trigger
Well, yes, look at the first example with the texteditor
. Just swap ā1ā for āaā and an oscillator for a sample.
But, no you canāt assign keys to buttons, or at least in a simple way.
ok hanks so much, I only see one example on the site and it doesnāt show an oscillator in the codeā¦are there more examples somewhere?
ignore my tabs lol
I was referring to the example I posted to you at the start of this thread. Thatās the only way to assign and trigger things from the keyboard.
ok i get you now rory, will I have to press enter every time I enter a key for it to work?
Ok I assume you have to press enter everytime to get the key to workā¦Iām now resorting back to the keyboard to trigger the samples lolā¦I got the text editor to work pressing and entering āaā earlierā¦now I want this to work with the keyboard insteadā¦Iāve changed around the code a little but just trying to get it to work.asasasasasa.csd (885 Bytes)
Well, thatās really the simplest thing to do, check what note was pressed, and play a sample accordingly:
<Cabbage>
form caption("Untitled") size(900, 1100), guiMode("queue") pluginId("def1")
button bounds(0, 350, 174, 400)
keyboard bounds(0, 0, 400, 200), value(40) channel("play1")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
if p4 == 60 then
event_i "i", 2, 0, 4, 60
endif
endin
instr 2
a1 diskin "marim22.l.wav"
outs a1, a1
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>
cool, im now trying to. combine some of the key trigger stuff to trigger that note with the letter āaā
new c.csd (830 Bytes)
Did you read this? you seem to be going round in circles Iāve no idea what youāre now talking about
Probably
itās all good rory, thanks fro your help