Code Module Update?!
Hey, I’ve stumbled upon the new Code Module. Is there any way to already use it? This will open so many creative ways, thank you Giku!!!
Hey, I’ve stumbled upon the new Code Module. Is there any way to already use it? This will open so many creative ways, thank you Giku!!!
Comments
Check the module presets. There are some examples there.
The module help and https://www.beepstreet.com/drambo-docs/beta.html are useful.
Amazing! Starting to dive in... is there a way to do time-based processing? there doesn't seem to be support for creating tempo-synced effects (aside from the simple delay). For example, I might want to create a series of many delays and toggle between them at tempo-based divisions. And yes, I've done this already with native Drambo modules, just curious if I could be more effecient in code.
Thanks for the update @giku! The Code module seems amazing from the included examples. Shame I don’t have the coding knowledge to use it really but those who have are going to have great fun with it.
Thanks for updating the tagged module section to include the modules which were missing. I’m not sure I dare mention it but the tagged section doesn’t seem to include the Code module anywhere…? Cheers.
Please check the manual:
Just updated Recipes with Tempo synchronized delay FX example.
Just updated Recipes with Tempo synchronized delay FX example.
those look very interesting 🤔👍 thanks!
I just had Qwen write a few percussives, I did a few manual "fixes" too.
They should work for a start :)
@rs2000, your Recoder patch seems to work now - it’s brilliant! Cheers.
Wow, having read the manual and tried asking Google Gemini to write the code for me, this is amazing. Coding knowledge clearly isn’t essential. We’re going to need a second page on PatchStorage dedicated to Drambo Code Presets!
Very eager to jump in and use this, maybe in a couple of weeks I can focus on this. I hope we can have a separate categories on the forum for collecting knowledge and code patches and making suggestions. As is, it definitely looks to answer my needs for a math module.
What might be the futures steps in developing this? Towards a live coding tool? Features like arrays, integer maths and For loops would open it up for me as well as being able to work multi-channel.
Just playing with it. I do like the ability to define knobs (param). It would be great to complement this with a function to display variable values in the same location as the knobs.
Fancy suggestion:
display(type, variable, name)
type could be: integer, float, note
note would display a pitch variable as musical note + octave : Eb4
Thank you! This example plus some ChatGPT has me headed in the right direction (I think). There's a LOT of possibilities here
[code]#persample
Gate = input(gate,Gate)
div = param(value,test)
gateidx = mod(edge(Gate) + gateidx,div)
gateidxout = gateidx/div
eoc = edge(0.05-e)
fbGate = Gate+eoc
r1 = sh(noise(),fbGate)
r2 = sh(noise(),fbGate)
e = envADTrig(fbGate,0.01+r1*r1*0.3,0.01+r2*r2*0.3)
pidx = abs(sh(noise(),fbGate))
p = seq(gateidx+r1*2+2,3/2,4/3,5/8,6/5,7/6,8/7,7/6)*seq(mod(gateidx,9)+r2+1,2,4,5,3,7/2,8,9,11)*seq(pidx*(3+gateidx),1,3,2,4,3/2,5/4,3/4,7/4,6/5,7/6,8/7,9/8,10/9)
//x=delay(out,1)
out = oscTri(220+120*p+e*60+x*100)*e
output(out)[/code]
I tried to do a code block.
I would like to have arbitrary choice over the range of values for the parameters (knobs) and for the inputs and outputs too. It half works with this code, but I have to continually set the knob back to the modulo value I want when I change the code.
also, I guess it's not so efficient that I'm doing the maths within the seq(). This is where it would be cool to have an array.
Param ranges will be supported in upcoming update.
seq function is an array addressed by the first argument
just woke up to this after doing a gig with drambo last night... i didn't know i could love this app any more!
This might be difficult as MIDI is message based compared to streams of samples or blocks, but I want to add the more or less obvious request to the list: MIDI support!
I am using Mozaic for years now and love it, but built in MIDI programming would be great for Drambo as it would allow this to be used inside Drambo when it is used as a plugin itself.
And to give at least some return to @giku and his generosity and the enormous efforts going into Drambo, I would be happy to pay for features like the coding module as an IAP.
Maybe someday. Fortunately, we already have Mosaic.
I started with this module for selfish reasons. I can finally prototype filters and effects live. ;)
@giku I assume the index for seq() is normalized 0 to 1? (With increments of 1/n). Is it correct?
Also the envADTrig, how does it differ from envAD?
no it's an integer array index 0,1,2,3,4 ...
envADTrig = envAD (envADTrig is removed from the manual, but still parsed, so that your pre-release presets still work)
Ah, ok, thanks so much for explaining
@giku - Note: The module help points to an incorrect URL for the docs.
Humm ... all my ideas so far for using this require at least
forloops.Super cool module though! Quite a gift.
I find myself wishing for a
defaultoptional parameter forparams.Yes default, min and max are coming
I just discovered that the output is bound to values between -8 and 8 (it just truncates above or below that). I can work around this, but it does make certain debugging harder - since I can't monitor the values of any variables if they are above or below that (unless there's some other way I'm not seeing)
I think the 8.0 cap is on the scope only, the signal preserves the full range. Or maybe audio signals have that limit, seems wide enough
anyway what you could do is scale signal to range 0..1 the upscale it again if you need
Yup, rescaling is exactly what I'm doing. The scope doesn't seem to have a limit (feeding larger values from other modules works just fine).
I think you’re right, the scope does go up over 8 for other signals. It’s just when using code module that I’ve come across this as I was trying to monitor a signal that goes from 0 to 64 and it capped at 8.0
maybe some guardrails to prevent insane levels, as those are audio signals after all, and auto connect to the speakers
maybe the limiter should be included by default 😅
This is incredibly cool. I have a working glitch delay/repeater based on the bbut algorithm.
One thing I've run into is generating random numbers (for probability based stuff). I tried sampling noise() but that seems to give me different values for the left and right channels. Chat GPT suggested fract(sin(step * 123.456) * 456.789) as a pseudo random, but I didn't know if I was missing something else or another way to do it.
Isn't that the purpose of noise?
It would be good to know what you're trying to achieve.
A dedicated Buffer unit would be great for creating custom Loopers with overdub and for tape to tape style operations!