|
Kyma Forum
![]() Tips & Techniques
![]() Bit Shift Register
|
| next newest topic | next oldest topic |
| Author | Topic: Bit Shift Register | |
|
trotz Member |
Hi all! I'm investigating about the Blippoo box designed by Rob Hordijk and hopefully I can recreate a version of it in the Kyma system. I'm learning also more about Kyma in the process Could you please point me in the direction of building a shift register (http://en.wikipedia.org/wiki/Shift_register)? What I'm trying to build is something like this: http://richard-scott.net/research/blippoo-box/ The shift register is driven by two oscillators. One oscillator (pulse wave) is the data source and the other one is the clock. Thanks a lot! IP: Logged | |
|
pete Member |
Hi Trotz I think this is a case of not quite enough information. It's a bit like discovering that your favorite synth was made from transistors, resistors and capacitors so now you know how to make one. A shift register is a building block that stores bits and passes them on to each other but some have parallel and serial inputs and outputs, they can be used with feedback paths out to in or feedback tapped off some of the intermediate stages, they may have a D to A which reading off the parallel bits. They may be anything from 1 to 100 or more bits long and they may be working at ultra sonic frequencies such that the one bit output stream acts as a stream of analogue values when used in the audio frequency range. This means that emulation the register at sample rate will loose most of this important info. Listening to the results I suspect that they are working at ultra sonic as the output doesn't sound like the control is simple a stream of yes/no values. I'm also guessing that they are 8 bit registers as there are many chips that do this as standard. If there are no taps off the intermediate bits, then there would be little gain by having larger shift regesters bits except that the the read/write rate could be different while the bits are going in, to when the bits are coming out. I suspect there is some form of feedback as this is normally a requirement of chaotic circuits. Now how to achieve a shift register at sample rate in Kyma. We know that the clocking is variable so we need a held register to hold the info for the samples that are not clocking, but this has to be able to change on the exact sample that a write clock pulse comes through. The sample and hold module would not work as the control only works at control rate (1khz). So instead we can use a feedback pair of modules which if fed into each other can hold values indefinitely. You can think of any sample number stored in the capybara as a 24 bit register or higher in the Paca(rana). If we multiply the value by two it is as if we are shifting the bits that make up the number to the left by one bit. Multiplying by one means no change to the number and will act as a hold when inserted into a feedback loop. Lets assume we want to emulate an 8 bit shift register. Adding 1/256 will place a 1 in the 8th bit. Multiplying by 2 will shift the bits one to the left and finding out if the value is greater or lower than 0.5 will tell us if the highest bit is a 1 or a zero. You cannot directly multiply by at sample rate by 2 with the product module but you can use a gain module set to 2 and multiply by 0.5 or 1 to give the equivalent of multiplying by 1 or 2. So to make it work in Kyma use the feedback output module to feed a product module and then a gain module. The gain modules will have its value set to 2 and the product module will have another input which has a scale and offset module also feeding into it. The scale and offset module needs to change our write trigger (which is 0 or 1) to 0.5 and 1 which is what we need to make our register either shift left or hold. So put 0.5 in all four scale and offset fields. The product module then goes into a mixer which is also fed by another product module, used to add 1/256 or not. This product is fed by a mixer (which is used as an attenuator) with 1/256 in both its level fields which is fed by our input square oscillator. The product is also fed by the original write pulse signal as we only want the 1/256 (or not) to be added during a write/shift cycle. The mixer then feeds the input of the feedback input module completing the loop. Now to derive the output we need to also send the signal coming out of the feedback output module into another scale and offset with the both offsets set to -0.5 and scale as one. we then need to amplify this signal by a large number so as to get rid of the analogue value and turn it into a high of greater that 0.5 and a low if less than 0.5 , so this goes into a gain module with both values set to 256 and then another gain module also set to 256. Note gain modules are better at handling gains not greater that 256. The output of this second gain module is the output of your shift register. An additional ABSolute module needs to be inserted just after the output of the feedback output module, just incase the value started out as a negative, in which case it would never become positive and would never work.
This generates the sound directly but you could use the output to control VCOs and VCFs instead. You can hear that squelchy liquidy sound in the Blippoo that comes from moving a VCFs frequency around at a fast rate. Hope this helps. Pete IP: Logged | |
|
SSC Administrator |
Here are some experiments I did a few years ago, feeding impulses into left-shift-registers with feedback and then using the results as control signals. In each example, you press the Impulse button to get it started. Then you can play with feedback & other parameters to get some pleasantly surprising behavior. I used a system like this for the ending of SlipStick. http://www.youtube.com/watch?v=eAVLrtOrcyc I got the idea to use the feedback shift registers from my teacher Salvatore Martirano who built an amazing complex-system-composing-machine-live-electronics-instrument called the SalMar Construction. Hope you have fun with the LSFRs. IP: Logged | |
|
SSC Administrator |
BTW, PetesAlgaTone.kym is more fun than is legal in most jurisdictions ![]() [This message has been edited by SSC (edited 04 November 2013).] IP: Logged | |
|
trotz Member |
Hi Pete, I have already built (and modifyied) one of those systems and the designer is a good friend who has also taken the time to explain most of the details to me. There is also an interesting paper at the Leonardo Music Journal that goes thru many of the details. In this case, the input of the shift register comes from what we could call the "data" oscillator. A pulse that is interpreted as a binary signal to be passed to the 8-bit shift register. Another oscillator serves as a clock for the shift register and the D/A converter. An important part of this circuit is that a D/A converter takes the last 3 parallel bits and creates a CV signal that Rob named as "rungler" and that we will use either on its own (to modulate external devices) or in a feedback loop that can be routed to the freq control of the data and clock oscillators (there's also a filter circuit, but it's not the part I'm interested in at this point). Now, we already have one feedback path. There are two additional feedback paths, being the output of each oscillator modulating directly the freq of the other. The tip about the feedback pair of modules is something that clearly I would have never even considered The rest of your advice is more difficult for me to grasp, but I will stick to it. Eventually I hope to be able to understand if I go thru it "bit by bit" (yes, pun intended) I will also try to analyze the patch you have suggested. As you say, it is like I am just discovering resistors and transistors Thanks a lot! Your fantastic and detailed explanation is greatly appreciated! IP: Logged | |
|
trotz Member |
Hi Carla The videos are GREAT and the Sal Mar construction is so interesting. I really dig the sounds it makes Thanks!
quote: IP: Logged | |
|
pete Member |
Hi Trotz Good, more information thats what we need. Just another couple of questions, what is the highest frequencies of both the data oscillator and the clock (write) oscillator? Looking at it again, the way I told you before won't work due to clipping instead of wrap around when values get multiplied by 2, so I've added a get round. I'll try to give more explanation. lets assume that the values that are sent around Kyma at sample rate are 24 bits. For a capybara this assumption is correct but for a Paca(rana) it can be higher but the rules hold true in all cases. Sample rate data in Kyma has a range of -1 to +1. It is a 2s complement fractional value which means that zero is all bits set to zero, +1 all bits are 1, and -1 all but the MSBit (which is the sign bit) are 0. As we have put an absolute module in the path all negative values are flushed from the system and you will see that if we start with a positive value, nothing we do subsequently will make a negative value, so the absolute module has no effect once we get started. Lets assume that we start with value zero in our feed back loop. This means that all the bits are zero. If we add 1/1024 to the zero value it will make binary value MSB to LSB 8 zeros then 1 one, then the rest are all zeros. if we multiply that by 2 we get value 1/512 which is 7 zeros then 1 one followed by zeros. This is how you put values in and shift them to the right. If the value of the number as a whole is greater than 0.5 the MSB (ignoring the sign bit) is 1 and if the value is less than 0.5 the MSB is 0. By testing if the value is greater or less than 0.5 we can read off the MSB. But there is a problem. When we multiply by 2 the bits shift to the left but when the MSB is value 1, it doesn't just throw it away (as a shift register would do) it instead clips the value to +1. so if there was a way that we could turn off the MSB when ever it was turned on we could read off the second MSB instead. This means that if ever the value gets above 0.5 subtract 0.5 from it. the we can test if the Value is greater or less than 0.25 to get the value of the second MSB. We can acheive this by replacing the ABS module with an InputOutputCharictaristic module with the following values. InValues OutValues and smooth set to 0.5 Now because you want an analogue value of the 3 MSBs not just the top MSB, you could simple read the value coming out of the InOutChar module as it is. This will give you the D to A value of all 22 bits instead of just 3, but as the lower 19 bits are of least significants it probably won't make any difference. Multiply it by 2 if you want the full 0 to +1 range as it has been wrapped round to go no higher than 0.5. Does this make any more sense? Pete IP: Logged | |
|
cristian_vogel Member |
thankyou Carla for sharing your LSFR research. Sounds totally insane. Love it. IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() |
|
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.