- Edited
In the latest and previous versions of Csound on the Bela, the soundin opcode has not worked.
- a workaround has been to substitute the diskin opcode. But... it would be nice for this classic Csound opcode
(and the hundreds of .csd files that use it) to work on the Bela too. The .csd below (and .aif file it is loading) work in every other Csound platform. Interetingly, on the bela, even when you are using the soundin opcode, it reports in the console that it is using diskin2 to load in the sample? That seems odd and it perhaps a clue.
Building project ...
Build finished
Running project ...
0dBFS level = 32768.0
--Csound version 6.15 (float samples) Oct 20 2020
[commit: 760da5d0610eef19af1915ba4a40d783d6b442d5]
libsndfile-1.0.27
Device type: Bar (1)
Address: 0x20
Firmware version: 2
Device type: Square (2)
Address: 0x28
Firmware version: 2
Device type: Ring (4)
Address: 0x38
Firmware version: 2
Device type: Hex (5)
Address: 0x40
Firmware version: 2
realtime mode enabled
UnifiedCSD: /root/Bela/projects/Oct25/1-Cook-StereoDelay.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score
realtime mode enabled
rtmidi: ALSA Raw MIDI module enabled
Elapsed time at end of orchestra compile: real: 0.323s, CPU: 0.038s
sorting score ...
... done
Elapsed time at end of score sort: real: 0.323s, CPU: 0.038s
setting dummy interface
graphics suppressed, ascii substituted
0dBFS level = 1.0
orch now loaded
audio buffered in 16 sample-frame blocks
SECTION 1:
Initialising spinlock...
Starting realtime mode queue: 0xb50fb010 thread: 0xe67228
new alloc for instr 1:
diskin2: opened (asynchronously) 'sp_hellorcb.aif'
44100 Hz, 1 channel(s), 332053 sample frames
Underrun detected: 1 blocks dropped
=====. HERE IS THE 'working' .csd ==== uncomment the soundin line OR the disking line to see
- the source, which is not attached, is a 44100k mono .aif file - anything should do.
<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1
instr 1 ; Stereo delay with normal and cross-feedback
ilevl = p4 ; Output level
idelay1 = p5/1000 ; L delay in ms
idelay2 = p6/1000 ; R delay in ms
ifdbk1 = p7 ; L feedback
ifdbk2 = p8 ; R feedback
ifdbkx = p9 ; X Feedback
ifreq1 = p10 ; L cutoff
ifreq2 = p11 ; R cutoff
imix = p12 ; Mix: 0=Dry 1=Delay
afdbk1 init 0
afdbk2 init 0
; ain soundin "sp_hellorcb.aif" ; NOT WORKING
ain diskin "sp_hellorcb.aif", 1 ; WORKING
ain1 = ain + afdbk1*ifdbk1 + afdbk2*ifdbkx
ain2 = ain + afdbk2*ifdbk2 + afdbk1*ifdbkx
adelay1 delay ain1, idelay1
adelay2 delay ain2, idelay2
adelay1 butterlp adelay1, ifreq1
adelay2 butterlp adelay2, ifreq2
afdbk1 = adelay1
afdbk2 = adelay2
aout1 = adelay1*imix + ain*(1 - imix)
aout2 = adelay2*imix + ain*(1 - imix)
outs1 aout1*ilevl
outs2 aout2*ilevl
endin
</CsInstruments>
<CsScore>
;Delay in ms, Filt in Hz. Total feedback should be <1?
; Strt Leng Levl DelyL DelyR FeedL FeedR XFeed FiltL FiltR Mix
i1 0.00 8.00 1.00 500 400 0.40 0.40 0.40 2500 2500 0.50
e
</CsScore>
</CsoundSynthesizer>