# Create a sample pack

**URL:** <https://forum.csound.com/t/create-a-sample-pack/2052>\
**Category:** Newbies\
**Created:** [March 3, 2025, 3:58am UTC](https://forum.csound.com/t/create-a-sample-pack/2052 "2025-03-03T03:58:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 3, 2025, 3:58am UTC](https://forum.csound.com/t/create-a-sample-pack/2052/1 "2025-03-03T03:58:08Z")

</div>

Hello  
Is it possible to create a sample pack with a single csd file. Make an instrument that would write a wav file per musical note for example? Could you tell me which way I should look?

---

<div class="post-metadata">

**Author:** ![tarmo](https://forum.csound.com/letter_avatar_proxy/v4/letter/t/c37758/32.png) [@tarmo](https://forum.csound.com/u/tarmo)\
**Post date:** [March 3, 2025, 7:40am UTC](https://forum.csound.com/t/create-a-sample-pack/2052/2 "2025-03-03T07:40:41Z")

</div>

Hi!

Sure! you could use sprintf for ceating the file name and fout to save the file.  
a simplified sketch (not the real code):

instr 1  
iNote = p4 ; or some other way

aSignal

SFilename sprintf “%d.wav”, iNote  
fout SFilename, 4, aSignal

endin

- consult the manual and change it as you need.  
Hope it helps!

tarmo

Kontakt NotSure via The Csound Community (\<[noreply@forum.csound.com](mailto:noreply@forum.csound.com)\>) kirjutas kuupäeval E, 3. märts 2025 kell 06:08:

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 3, 2025, 8:10am UTC](https://forum.csound.com/t/create-a-sample-pack/2052/3 "2025-03-03T08:10:52Z")

</div>

Hi Johannes,

perhaps I have expressed myself badly,  
I want to create multiple samples with different frequencies of the same sound in order to feed a software sampler.  
The csd file will have to provide 7 wav files:  
A3\_sound.wav, B3\_sound.wav, C3\_sound.wav, D3\_sound.wav, E3\_sound.wav, F3\_sound.wav, G3\_sound.wav.

---

<div class="post-metadata">

**Author:** ![tarmo](https://forum.csound.com/letter_avatar_proxy/v4/letter/t/c37758/32.png) [@tarmo](https://forum.csound.com/u/tarmo)\
**Post date:** [March 3, 2025, 9:02am UTC](https://forum.csound.com/t/create-a-sample-pack/2052/4 "2025-03-03T09:02:52Z")

</div>

Yes, this is exactly what you can do with that instrument if you develop it further:

-odac

sr = 44100

ksmps = 32

nchnls = 2

0dbfs = 1

instr 1

iNote = p4 ; or some other way

iFreq cpsmidinn iNote

iCutoff random iFreq_2, iFreq_8

aSignal moogladder vco2:a(0.1,iFreq), iCutoff, 0.8

aSignal \*= adsr:a(0.1, 0.1, 0.6, p3/2)

outall aSignal

SFilename sprintf “%d.wav”, iNote

fout SFilename, 4, aSignal

endin

i 1 0 1 48 ; C3

i 1 + 1 50 ; D3

; etc

Maybe I still got you wrong…

tarmo

Kontakt NotSure via The Csound Community (\<[noreply@forum.csound.com](mailto:noreply@forum.csound.com)\>) kirjutas kuupäeval E, 3. märts 2025 kell 10:20:

[demo.csd](https://forum.csound.com/uploads/short-url/a7cgrmwtiOkTXIUKvMXtNK2mgfy.csd) (758 Bytes)

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 3, 2025, 2:53pm UTC](https://forum.csound.com/t/create-a-sample-pack/2052/5 "2025-03-03T14:53:47Z")

</div>

Thank you Johannes,  
it’s exactly what I was looking for.  
I imagined something with loops, very dirty.  
I’m very bad at English, mathematics and algorithmics.  
Thanks to you, I just discovered that there are a lot of `"*out*"` opcodes, and your solution is elegant.

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 4, 2025, 11:34pm UTC](https://forum.csound.com/t/create-a-sample-pack/2052/6 "2025-03-04T23:34:29Z")

</div>

Hello,  
in the expression `"adsr:a(0.1, 0.1, 0.6, p3/2)"`, I couldn’t find in the manual what the colon between `"adsr"` and `"a"` mean. Is this the way to write the conversion of i-rate parameters to a-rate? Same for `"vco2:a(0.1,iFreq)"`, k-rate in a-rate?

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 5, 2025, 1:12am UTC](https://forum.csound.com/t/create-a-sample-pack/2052/7 "2025-03-05T01:12:35Z")

</div>

Hi,  
I finally found the answer in the flosmanual.  
Sorry for the inconvenience.

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [March 25, 2025, 7:49pm UTC](https://forum.csound.com/t/create-a-sample-pack/2052/8 "2025-03-25T19:49:29Z")

</div>

**Update,**

Hello,  
Finally, I installed Cabbage audio on my machine,  
so I didn’t need to make individual samples anymore,  
I made a VSTi that I can load into Ardour.  
Only happiness.
