Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created October 7, 2011 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobjoaquin/1270309 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/1270309 to your computer and use it in GitHub Desktop.
Sampler Concrete
Sampler Concrete
Jacob Joaquin
Oct 7, 2011
jacobjoaquin@gmail.com
CodeHop.com
Based on "Organizing Sounds: Musique Concrete, Part I" by Jean-Luc Sinclair
http://codehop.com/organizing-sounds-musique-concrete-part-i/
<CsoundSynthesizer>
<CsInstruments>
sr = 44100
kr = 44100
ksmps = 1
nchnls = 1
0dbfs = 1.0
instr splice
idur = p3 ; Duration
iamp = p4 ; Amplitude
ibegin = p5 * 44100 ; Begin time of splice. Specify in seconds in score.
iend = p6 * 44100 ; End time of splice. Specify in seconds in score.
; Play splice
aphasor phasor 1 / idur
aphasor = (aphasor * (iend - ibegin) + ibegin)
a1 tablei aphasor, 1, 0, 0, 1
; Plug the audio to the output
out a1 * iamp
endin
instr do_nothing
; For creating pauses between score sections.
endin
</CsInstruments>
<CsScore>
; Load Sample into Table 1
; Sounds of the Manhattan Subway (NYC, USA).wav
; http://soundcloud.com/olpc-samples/sounds-of-the-manhattan-subway-nyc-usa-wav
; OLPC Samples - Free Sound Sample Collection
; http://soundcloud.com/olpc-samples
; Length: 30 seconds
f 1 0 [2 ^ 21] 1 "Sounds of the Manhattan Subway (NYC, USA).wav" 0 4 1
; Splice Segment
; This plays an 8 second segment
i "splice" 0 8 1 17 25
s
i "do_nothing" 0 2
s
; Splicing
; This splices 8 one second clips out of order.
i "splice" 0 1 1 24 25
i "splice" 1 1 1 23 24
i "splice" 2 1 1 22 23
i "splice" 3 1 1 21 22
i "splice" 4 1 1 20 21
i "splice" 5 1 1 19 20
i "splice" 6 1 1 18 19
i "splice" 7 1 1 17 18
s
i "do_nothing" 0 2
s
; Vari-speed
; Plays a clip at twice the rate and then another at half the rate
i "splice" 0 4 1 17 25
i "splice" 4 12 1 21 25
s
i "do_nothing" 0 2
s
; Reversal
; Plays an 8 second clip in reverse
i "splice" 0 8 1 25 17
s
i "do_nothing" 0 2
s
; Tape Loop
; Repeats a 1 second segment 8 times
i "splice" 0 1 1 19.5 20.5
i "splice" + . . . .
i "splice" + . . . .
i "splice" + . . . .
i "splice" + . . . .
i "splice" + . . . .
i "splice" + . . . .
i "splice" + . . . .
s
i "do_nothing" 0 2
s
; Layering
; Plays two different segements at the same time
i "splice" 0 8 0.6 8 16
i "splice" 0 8 0.2 17 25
s
i "do_nothing" 0 2
s
; Delay
; Plays the same 8 second clip twice, the second delayed by 1 second
i "splice" 0 9 0.4 17 26
i "splice" 1 8 0.4 17 25
s
i "do_nothing" 0 2
s
; Comb Filtering
; Plays the same eight second clip twice, the second delayed by
; 2 milliseconds, resulting in a flanged-like sound.
i "splice" 0 8 0.4 17 25
i "splice" 0.002 8 0.4 17 25
</CsScore>
</CsoundSynthesizer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment