How to control effects on single sample within a pattern?

I'm trying to control the gain level on just a single sample within a pattern containing several samples.

I would like the other samples to remain unaffected.

How would I go about doing this? Thanks very much :slight_smile:

1 Like
d1  $ fix ((fast "2 4") . (|* gain 0.9)) (sound "bd") 
    $ sound "bd*[1|2] sd"
fix (function to apply) (condition)

Edit: Argument order was wrong


you should also consider using stacks in some occasions:

d1 $ stack[
    s "bd*[4|8]*2" # gain 0.9
    ,s "[~sd]*8" |- note 5 # hpf 200
    ,s "ht*8?" # pan rand # gain 0.85
1 Like

Thank you very much, this is exactly what I was looking for. I have tested your code though, and the condition and the function need to be the other way around.

1 Like

heh sorry,, was working from memory :sweat_smile:

Sorry, I have one last question for the day.

I am trying to apply fix to multiple samples within a pattern. How would I write this so it works?

d1 $ fix (# gain 2) (sound ["bd" ,"bd:2"]) $ sound "bd bd:2 cp"

Thanks very much!

mhmhm I'd think it should work without multiple inputs given the sample folder is actually the same
I'm guessing maybe like this?

d1 $ fix (|* gain 0.9) ((sound "bd") . (sound "hh"))
     $ s "bd hh sd hh"

d1 $ fix (# gain 0.5) (sound "[bd ,bd:2]") $ sound "bd bd:2 cp" works too (makes sense since I think the "[..,..]" mini-notation is basically a shorthand for stack).
Speaking of which, a version with stack should work too:

d1 $ fix (# gain 2) (sound $ stack ["bd" ,"bd:2"]) $ sound "bd bd:2 cp"
1 Like

Without using fix, I am using a structure based on stack:

   let myCustomEffect = lpf ... # ......
   let myCoolVerb = room 0.5 # sz ...
   d1 $ stack [
       s "bd hh sn hh" # myCustomEffect,
       s "jvbass*2"      # myCoolReverb]

It works very well to keep things clean and if you feel the need to use variable names to remember exactly how your code is currently structured.

1 Like

Yes, but pay attention on controlling global effects like room/size inside a stack, you could get strange behaviors unless you change also the orbit number

You are right, I should have mentionned that. There is some manual orbit assignment you should take care of when using big structures like this with a blend of local and global effects. The good side of it is that you can pre-arrange pattern skeletons for a given performance with pre-declared effects and so on.