Cabbage Logo
Back to Cabbage Site

Stepper - changing number of steps and bpm

Hi there,

I’m trying to modify the beautiful stepper that I found in the documentation, but I’ve some problem understanding how can I modify the number of steps and the bpm in the Cabbage section. If I change the numbers stepbpm or numberofsteps nothing happen.

Ah, I wrote “numberofsteps (16)”. It creates the squares on the GUI, but when I play the stepper is stopping at the 12th.

Does anyone have some ideas?

PS: I tried to run it on the new Cabbage 2 but the stepper disappears…:sweat_smile:

Sequencer_02.csd (3.5 KB)

Thanks!

Ok, I’m beginning to understand why it doesn’t work…if I’m reading it correctly to create this custom widget I have to declare it in ‘CabbageCustomWidgets.h’ and ‘CabbageCustomWidgets.cpp’.

I found the files in the source code, but how can I run Cabbage after modification?

I promise you that the next year I’ll follow a c++ course…:grin:

What OS are you using? And do you have all the appropriate compilers and build tools installed? This little widget was just created for showing how new widgets can be added to Cabbage. I never thought anyone would use it in its current state!

I’m on OS X 10.11.6. I’m using Aquamacs to open and to modify the C++ files, but probably after that it will become too much complicated for a musician…

I think that is a really interesting widget, I’d like to start from it to create an instrument to use it real time to generate polirythmyc patterns. It’s a good starting point because it needs only to have the opportunity to update the number of steps and the bpm. But I can try with something else…

The same thing can be achieved using checkboxes or tables. Take a look at the grid sequencer examples. They might help get you started.

Thanks! It’s working fine!

Could you suggest me how can I reinitialize the instruments if I stop them with the checkbox?

Now if I restart the checkbox the instruments start to read the tables from the index where they stopped before…

I’ve tried in this way:

if kStart==0 then reinit: pattern1
endif

But it doesn’t work…

Sequencer_04.csd (7.4 KB)

How about

if kStart==0 then
	kStep = 0
endif

?

Yes…perfect!!! :sweat_smile:
Once again, thanks!

Finally I got what I was trying to do…but the patterns start asynchronous

I created three different gentable bounds in order to have different speeds for each pattern
and have the polyrhythm, but when I push the checkbox the first one is starting, but the others are not synchronized…sometime restarting it they could be synchronized, but not all the time.

Sequencer_05.csd (15.5 KB)

Do you think that is to much to have three simultaneous gentable bounds and they could slow down Cabbage? :confused:

You can have as many gentables as you wish. I don’t think this is the issue here. I don’t have time to look over your instrument this evening, but I will try to find time tomorrow. The samples should sync, there must be something else that is offsetting them slightly. I’ve done things like this in the past and it has always worked fine. Maybe it would be a good idea to create a simplified version and see if you can get it to sync. If you can then compare. If not send me the simplified one. I should be able to see quicker what’s going on in a simple instruments.

Thanks Rory, I’m in no rush and I try to simplify the code…I noticed that if I use the same value for “metro” opcode they start at the same time without problem.

So the mistake should be in rescaling the time through the different pattern to get the polyrhythm that I do in this way:

instr 2

kBeats2 chnget "Beats2"
  
k1= gkTempo/gkBeats	        ; divide the time in BPM by the pattern1 beats number
k2 = gkTempo/kBeats2	        ; divide the time in BPM by the pattern2 beats number
k3 = k1/k2		        ; divide the results to obtain the ratio between the two patterns
kTempo = (gkTempo/60)*k3        ; multiply by the ratio to have different beats in the same time length
kTrig metro kTempo              ; generate trigger to read the table 

Do you think that is it correct to obtain different beats in the same time length?

Ah yes, this make sense. I think you should probably use a reinit to keep everything in sync. The question is when ships the reinit happen? On start/stop or when changing the number of beats maybe?

It would be interesting to have the possibility to change the number of beats probably with an if condition and reinit, but at the moment I’m trying only to get the first beats synchro on Start/stop.

Have a listen to this one. It plays 3 different divisions. In the first pattern it plays 1 note per measure, the second plays 7 and the last one plays 5. At the end of each measure all notes sounds again. If this what you are looking for?

tempoTest.csd (1.5 KB)

It looks like there is an issue in how you are setting the metro values for each pattern?

Yes, It works well! but It’s weird, because if I use the same approach with gentable I’m always having the same problem on start and stop :cold_sweat:
Sometime it starts at the same time, sometime is upbeat…
Sequencer_Osc_01.csd (7.4 KB)

Try this one. I’ve put the turning on and off of instruments 1-3 into a new instrument, instr 99. This seems to keep things in sync much better.

Sequencer_Osc_01.csd (7.7 KB)

Yes, seems to keep things in sync and seems to work perfectly also in the diskin player version!
Many thanks! If you come to Edinburgh I owe you a dinner…:grin:

Cabbage and steak!