| 1 |
; Template for Csound-wasm html file that runs also in CsoundQt, Csound For Android and elsewhere |
| 2 |
; (c) Tarmo Johannes 2018 |
| 3 |
|
| 4 |
<html> |
| 5 |
<head> |
| 6 |
</head> |
| 7 |
<body bgcolor="lightgreen"> |
| 8 |
<h2>Csd+html template</h2><br> |
| 9 |
Press "Run" in CsoundQt (or other host) to start the csd. |
| 10 |
<br><br> |
| 11 |
Frequency: |
| 12 |
<input type="range" id="slider" min="100" max="1000" oninput='csound.setControlChannel("freq",parseFloat(value)); '></input><br> |
| 13 |
<button id="button" onclick='csound.readScore("i 1 0 3")' >Event</button> |
| 14 |
<br> |
| 15 |
</body> |
| 16 |
</html> |
| 17 |
|
| 18 |
<CsoundSynthesizer> |
| 19 |
<CsOptions> |
| 20 |
-odac -d |
| 21 |
</CsOptions> |
| 22 |
<CsInstruments> |
| 23 |
|
| 24 |
sr = 44100 |
| 25 |
nchnls = 2 |
| 26 |
0dbfs = 1 |
| 27 |
ksmps = 32 |
| 28 |
|
| 29 |
chnset 400, "freq" |
| 30 |
|
| 31 |
instr 1 |
| 32 |
kfreq chnget "freq" |
| 33 |
printk2 kfreq |
| 34 |
aenv linen 1,0.1,p3,0.25 |
| 35 |
out poscil(0.5,kfreq)*aenv |
| 36 |
endin |
| 37 |
|
| 38 |
|
| 39 |
</CsInstruments> |
| 40 |
<CsScore> |
| 41 |
</CsScore> |
| 42 |
</CsoundSynthesizer> |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
<bsbPanel> |
| 47 |
<label>Widgets</label> |
| 48 |
<objectName/> |
| 49 |
<x>100</x> |
| 50 |
<y>100</y> |
| 51 |
<width>320</width> |
| 52 |
<height>240</height> |
| 53 |
<visible>true</visible> |
| 54 |
<uuid/> |
| 55 |
<bgcolor mode="nobackground"> |
| 56 |
<r>255</r> |
| 57 |
<g>255</g> |
| 58 |
<b>255</b> |
| 59 |
</bgcolor> |
| 60 |
<bsbObject type="BSBButton" version="2"> |
| 61 |
<objectName>button0</objectName> |
| 62 |
<x>10</x> |
| 63 |
<y>19</y> |
| 64 |
<width>100</width> |
| 65 |
<height>30</height> |
| 66 |
<uuid>{d5a1d1e3-eb6f-461c-90dc-95647307dc87}</uuid> |
| 67 |
<visible>true</visible> |
| 68 |
<midichan>0</midichan> |
| 69 |
<midicc>0</midicc> |
| 70 |
<type>event</type> |
| 71 |
<pressedValue>1.00000000</pressedValue> |
| 72 |
<stringvalue/> |
| 73 |
<text>Play</text> |
| 74 |
<image>/</image> |
| 75 |
<eventLine>i1 0 1</eventLine> |
| 76 |
<latch>false</latch> |
| 77 |
<latched>false</latched> |
| 78 |
</bsbObject> |
| 79 |
</bsbPanel> |
| 80 |
<bsbPresets> |
| 81 |
</bsbPresets> |