Adding samples to a CHOP

I’ve been trying for days to manage a way to add a sample to a CHOP.

I want to create a CHOP one sample at a time, with a rate set by me.

For example

  • I start with a CHOP with 1 channel and 0 sample
  • I add a new sample with value .89
  • I add a new sample with value .76
  • Now I have a CHOP with 1 channel and 2 samples that I can use to make a SOP

Is this even possible?

I manage to do it with DATs tables and python script but it is very slow. I was wondering if this can be done only with CHOPs.

Thank you

a script CHOP would do what you’re looking for here. you can write to the chop within the callback, or even from outside the callback script.

Thank you lucasm.

But how exactly you will add a sample? with which function?

Thanks

@h-windows you can actually set the length / number of samples in a script CHOP directly:

def onCook(scriptOp):
	
	scriptOp.clear()
	myChan = scriptOp.appendChan('myChan')
	scriptOp.numSamples = 100
	myChan[5] = 6
	
	return

1 Like

Oh, wow. That is pretty cool.

Do you think is would be more efficient than doing:

CHOP to DAT and DAT to CHOP?

Probably yes.

Thank you!
A.