Hi @Carambolo, check out the gentable examples in the widgets examples menu. that is the best starting point for dynamically updating a table in real time. let me know if you have any questions.
The examples were very helpful! I can now make changes to the table with my sliders, although I only see them after pressing a key.
I know I can figure that out later.
For now I want to ask you; what routine would be the most suitable for putting together my own waveforms, plus the common ones (Sine, triangle, square, saw, etc)?
At the moment I am working with GEN16 but it is complicated for me to put together waveforms like square.
I think GEN16 will give you most scope but you can generate the waveforms using line segments with GEN07 too, but any kind a wave generation like this likely to result in aliasing when you play back at higher pitches. You should look at the vco2 opcode to avoid this.
So let’s say I use vco2.
And I generate the GEN16 table with my waveform, there wouldn’t be an aliasing problem, right?
you’d then need to use vco2init to create a set of tables to use based on your waveform
I was able to get vco2 to read my table with vco2init already. And was able to reproduce it.
But when using my sliders to change the table values, I don’t get a sound change.
Can you share your CSD file so we can take a look?
Sure! It’s a pretty small file…
CabbageSintetizador2.csd (4.4 KB)
I see 2 issues here.
vco2init is only called once. it should be called each time you update a table - but I’m not sure it is was ever meant to be used this way
instr UpdateTableis being called each note, that’s not right. it should only be called when a slider changes. the quick fix, remove that code and put it in an always on instrument as in the attached.
CabbageSintetizador2.csd (4.5 KB)
Note the table does not display correctly because the data sent to it doesn’t add up right as far as i can tell, although I’ve not used gen16 before…
I’d return o the vco2init issue once the table displays the correct shape…
I added your modifications to the code!
Although, I really think the values that are introduced to the gen16 table are at least minimally adequate.
In the version of the code without your modifications I could see the changes, at least when pressing a key.
Maybe it’s another reason why we don’t see the values in the table this time?
Can you send me that .CSD?
CabbageSintetizador1 (oscil).csd (4.3 KB)
this doesn’t show any waveform for me?
Only changes when you press something on the keyboard.
Like in the video I uploaded before, try to do it while pressing a key.
It’s like, half the work it should do.
But in the new code, it doesn’t even show an update in the table when you press a key or at some point.
yeah, I’m not even getting that? strange. when i press and hold a note the waveform doesn’t show. if i swap out a gen16 for gen10 in the code i sent yesterday it works as expected. that’s why i feel there must be something up with gen16…
Do you think you still have your gen10 version?
I would like to take a look at it for comparison.
I am using Cabbage 2.9.0 which I believe is the latest version. I don’t think we are using different versions of the program!
Try fixing the GEN16. Two things to consider:
• when creating single cycle waveforms with GEN16, the table should start and end on a value (preferably the same value), so there should be a multiple of 3 parameters + 1
ie. val1, dur1, type1, val2, dur2, type2, val3
Your table ends on a type.
• the sum of all dur should be = table size
Try modifying your table (here it’s altered to keep the ratio of dur1 & dur2):
itmp ftgen 1, 0, 2048, 16, -1, 1000, 0, 1, 2400, 3, -1, 2, 0
itmp2 ftgen 2, 0, 2048, 16, -1, 600, 0, 1, 1448, 3, -1
They now add up to 2048.
edit: here is a modified version of yours using the first 3 sliders to manipulate the waveform
CabbageSintetizador2.csd (4.6 KB)
I’ll download the latest Cabbage beta, then. And I will follow the advice provided for the GEN16 routine.
I think both of you have already helped me too much so far, so I’ll share with you when I get a major progress! :'D