Offline
Tokyo, Japan

I have been trying to do pwm on a 1 cycle squarewave using lpof or.plof but i cant get it to.work. does anyone have an exame.project with it working?

Offline
detroit

bump for curiosity

Offline
Geneva, NY

I'm guessing this is the problem: If it's a one cycle sample, and it's a proper square (50%) and like 1F long and your loop points for the ocs are 00 to 1F, LPOF will do nothing because there's no room to offset. You can't slide the loop points forward or backwards because there's nowhere to go. If you reduce the loop end to 0F and set an LPOF of 0001, you'll get some pwm, but also silence after a bit once the loop beginning is shifted to the 0F mark (there would be no zero crossing and therefore no sound). SO, you would have to set the loop end to be greater than half of the sample length so that no matter where the loop is shifted, there will still be the zero crossing. I made an example project, setting the loop beginning at 0000 and end at 0011, then set up a table looking like this:

00 LPOF 0001 (move loop ahead one sample)
01 HOP  0800 (hop to row 00 eight times then continue with the table)
02 LPOF FFFE (move loop backwards one sample)
03 HOP  0802 (hop to row 02 eight times then continue with the table)
04 HOP  0000 (start the whole thing over again)

I also tossed a GROV 0000 in the second column of the table to slow things down a bit.

Here's the project: http://hexawe.net/mess/bleHOLe/lgpt_SQ.zip

Offline
NY

yeaaaaaaaaaaaa set the loop end to somewhere between the midpoint and endpoint of the sample and make sure you're in osc mode. positive LPOF values (0000-7FFF) will slide the "window" forward, increasing the duty cycle. negative (FFFF-8000) values will shift it back decreasing it but it won't do this if you're already at the beginning of the sample.

alternatively, set the loop start point to somewhere between 00000000 and the midpoint of the sample and you can use negative LPOF values to increase duty cycle.

or you can get freaky and change the start and end point, but you need your zero crossing in the middle like bleo said, or you'll get silence.

http://hexawe.net/compos/c6420/
^ my track on here has an example.