Hello everybody!
I’m working on a little instrument and i have some problems with it.
More or less a question if this functioning with flooper2 or not:
i want to to have flexible control over the loopstart point and loopend point. flooper2 seems to be the right opcode for this.
i introduced the variable kLoopSize which multiplies the soundfile length with a factor between 0.1 and 1.
this is then added to the loopstart point to define the loopend point. to keep these numbers in range i working with the modulo operation.
so from time to time the loopstart point is higher then the loopend point. and it seems like flooper2 doesn’t like it like this. i call whit wrap around looping.
is flooper2 not capable of doing this? or is there a problem with my code?
Greetings,
Philipp
<CsoundSynthesizer>
<CsOptions>
-d -odac -W -3 -+rtmidi=coremidi -Ma
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1.0
gSFile = "" ; add to global section
giSndfl ftgen 0, 0, 0, 1, gSFile, 0, 0, 0
instr 1
iFileLengthSec filelen gSFile
;; play a soundfile from function table with looping
kPlaybackSpeed = 1
kAmp = 0.9
;; loop position
initc7 1,1,0
kStart ctrl7 1,1,0,1
kStart port kStart, 0.01
printks2 "Loop-Start: f\\n", kStart
kLoopStart = \(kStart\*iFileLengthSec\) iFileLengthSec
initc7 1,2,1
kLoopSize ctrl7 1,2,0.1,1
kLoopSize = kLoopSize * iFileLengthSec
printks2 "Loop-Size in Seconds: f\\n", kLoopSize
kLoopSize port kLoopSize, 0\.01
kLoopEnd = kLoopStart\+kLoopSize iFileLengthSec
printks2 "Loop-End: %f\n", kLoopEnd
; iFileLengthSmps = iFileLengthSec*sr
kFadeTime = 0.025
iSndflTable = giSndfl
iNumChnls filenchnls gSFile
if iNumChnls == 1 then
aSndfl1 flooper2 kAmp, kPlaybackSpeed, kLoopStart, kLoopEnd, \
kFadeTime, iSndflTable
aSndfl2 = aSndfl1
elseif iNumChnls == 2 then
aSndfl1, aSndfl2 flooper2 kAmp, kPlaybackSpeed, kLoopStart, \
kLoopEnd, kFadeTime, iSndflTable
endif
;; output
initc7 8,1,0
kAmp ctrl7 8, 1, -90, 0
printks2 "Amp: %d\n", kAmp
kAmp port kAmp, 0.025
aOut1 = aSndfl1 * ampdbfs(kAmp)
aOut2 = aSndfl2 * ampdbfs(kAmp)
outs aOut1, aOut2
endin
;-----------------------------------------------------------
</CsInstruments>
<CsScore>
i1 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here