Cabbage Logo
Back to Cabbage Site

Soundfiler / Loscil question

I’m trying to use ‘soundfiler’ (with a complimentary sample file ‘button box’) to play single cycle waveforms from a folder on my desktop. I began by using ‘loscil’ to reference a GEN table with one particular wav file name, that worked perfectly, but I’ve been struggling to figure out how to substitute this method for ‘sound filer’ via chnset.

I can see that “Loscil File Player” in the included Cabbage examples covers exactly what I need to know. After many attempts I can’t for the life of me figure out the method. There is a lot of unrelated code in that example and I can decide what is relevant to my simpler requirement.

Is there a more simplified version of this example online?

Many thanks!

Try this one.
SimpleSoundfiler.csd (2.0 KB)
Basically you should break down the task into two instruments. One will load the files, and the other will play them back. I’ve commented the code, but if you don’t understand something feel free to ask.

Super! About to open it and have a look. Thanks yet again Rory:)

The “diskin2” example works great and I can see clearly how the play button function operates. Thanks again.

However, my own project does not incorporate any play button. My initial query was not specific, I’m sorry.

I won’t use a play button. I wish to instead trigger the single cycle waveforms loaded into the soundfiler using the cabbage GUI keyboard and pitch them accordingly. I don’t think “diskin2” can perform this.

I’m including my project file as it’s kind of hard for me to explain. I hope that’s ok:

My early stages synth (ignore the crudeness of it, it’s a means of learning cabbage at least;) includes a mixer of various oscillators producing different waveforms to combine and create interesting timbres. Within the mixer is also a single wavecycle player.

The waveform within is to loop continuously while a note is held producing a steady tone. I have no problem loading one waveform into the player producing a tone. The problem I have is when adding a ‘filebutton’ to select other single cycle waveforms. The added need for a GEN table in this method confuses me. I still cannot seem to add the function to choose different files.

The “Loscil File Player” example in Cabbage seems to hold the key but I have spent hours and I can’t figure it out.

I’d be really grateful if you could take a look and suggest a method?

Many thanks!

Martin

Hi,

I made something for explaining some Schaeffer’s concepts. It uses diskin2, maybe it’ll suit you.

I’ve not tested the program thoroughly yet, and I warn you that there’s a lot of copy-pasta going on.

You have to click on any of the letters inside the table in the image to load the files. Also, for some reason it works better with alsa than with jack. All remarks are in Spanish so ignore them.

https://drive.google.com/file/d/0B3HppEiCAar1VDl4YVZyYlB6NW8/view?pref=2&pli=1

Thanks for chiming in gsenna. I’ve just opened it and I’m having quick look at the functions. This is a really different GUI from anything I’ve seen so far. Got me thinking (inSpanish;).

Before I go looking through your source, is there any need for a gen widget? If you are loading several wave forms, then it might just add to the complexity, without adding anything to the functionality. Are you looking for a simple example of how to load a sample and play it back at different pitches with the keyboard?

Don’t worry about it. It’s not a big deal really.

I well see if I can knock up a simplified csd. version of my query. Yeah, perhaps I should use more simplified version without the need for a GEN table… for the time being at least while I learn more about cabbage.

*By the way, that source file I sent you will not work without a .wav file that I neglected to include, so don’t bother opening it.

Thanks again.

Here’s a quick reworking of that last effort to use a loscil instead of a diskin2 opcode. You’ll need to figure out the right base frequency of your sample, and you should also add an envelop of some sort to de-click the samples.

SimpleSoundfiler.csd (1.5 KB)

Thanks! That linked file appears to have gone dead however.

Sorry, I have that file at work. I’ll upload it again when I get to the office.

There’s no panic. Thanks.