[Csnd] Bitshift Melodic Patterns
| Date | 2019-06-16 00:05 |
| From | Steven Yi |
| Subject | [Csnd] Bitshift Melodic Patterns |
Hi All,
I thought I'd share a video demonstrating a technique I've been
working with the past few days using bitshift patterns for melodic
lines:
https://kunstmusik.com/2019/06/14/csound-live-code-practice-meditative-melodic-bitshift-patterns/
(Note: video has crackles in it!)
The video is from a live code practice session today. I got familiar
with using bitshifting for audio via bytebeat[1] and had been using it
at slower time level for rhythmic patterns. This was done using
something like:
if ((counter >> (counter & 7)) & 1 == 1) then
... fire note ...
endif
but the video shows a variation to use the bitshifted number with
modulus to get an interesting pattern, something like:
inum = (counter >> (counter & 7)) % 7
The page contains a basic visualization of what the above pattern
looks like over time.
Cheers!
Steven
[1] - http://canonical.org/~kragen/bytebeat/
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2019-06-16 01:04 |
| From | "Dr. Richard Boulanger" |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Thanks for sharing Steven! The video is cool. Dr. Richard Boulanger Professor Electronic Production and Design Berklee College of Music > On Jun 15, 2019, at 7:05 PM, Steven Yi |
| Date | 2019-06-16 13:19 |
| From | Marcelo Carneiro de Lima |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Great! Em sáb, 15 de jun de 2019 às 21:04, Dr. Richard Boulanger <rboulanger@berklee.edu> escreveu: Thanks for sharing Steven! The video is cool. Marcelo Carneiro (21) 9382-3621 (21) 3497-0193 |
| Date | 2019-06-16 13:40 |
| From | thorin kerr |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
This is really compelling to watch and listen to. Do you have an idea - or get a 'feel' - for what the bitshift patterns are going to result in when you experiment? Thorin On Sat, Jun 15, 2019 at 7:06 PM Steven Yi <stevenyi@gmail.com> wrote: Hi All, |
| Date | 2019-06-16 17:51 |
| From | Steven Yi |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Thanks Dr. B and Marcelo!
Thorin: it's still fresh for me investigating the bitshift patterns
for melodic writing and it's mostly intuition at the moment and
experimenting with various parameters. I think about the visuals for
bytebeats and see similarities as the counter is monotically
increasing like t is often used in bytebeats. Here's some python code
from terminal that shows some of the numbers that happens:
>>> range(24)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23]
>>> [(i >> (i & 7)) for i in range(24)]
[0, 0, 0, 0, 0, 0, 0, 0, 8, 4, 2, 1, 0, 0, 0, 0, 16, 8, 4, 2, 1, 0, 0, 0]
>>> [(i >> (i & 7)) % 7 for i in range(24)]
[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 2, 1, 0, 0, 0, 0, 2, 1, 4, 2, 1, 0, 0, 0]
>>> range(128, 152)
[128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
142, 143, 144, 145, 146, 147, 148, 149, 150, 151]
>>> [(i >> (i & 7)) for i in range(128, 152)]
[128, 64, 32, 16, 8, 4, 2, 1, 136, 68, 34, 17, 8, 4, 2, 1, 144, 72,
36, 18, 9, 4, 2, 1]
>>> [(i >> (i & 7)) % 7 for i in range(128,152)]
[2, 1, 4, 2, 1, 4, 2, 1, 3, 5, 6, 3, 1, 4, 2, 1, 4, 2, 1, 4, 2, 4, 2, 1]
That shows what happens in the first 24 ticks and another set of 24
ticks later in time.
Right now the primary expression I'm using is pretty simple but I
think enough. The bit mask number helps to control how often the
shifting changes. With 7, that's 0x111, when masking against i, the
shift changes every tick. If I use something like 5 (0x101), the
shift value changes differently, same with 4 (0x10). (Kind of controls
both what shifts and tempo of shift changes.) The modulus value just
constrains in the range of values to output which gives allows
wrapping within 7 scale degrees and gives a bit of control there.
I love that there's a sense of patterns arising but the output values
are percolating and changing over long expanses of time. (I had an
idea a long time ago when I was a student ages ago about things like
this that as "non-patterns", which I plan to investigate further for a
composed set of pieces this summer.)
The following can be copy/pasted into live.csound.com and evaluated
(select all, ctrl-enter). It's fairly mesmerizing for me. You an try
commenting out some of the hexplay() calls to isolate different
patterns and modify the modulus and bitmask values.
Next steps for me are probably to experiment with the other bitwise
operators and making compound statements. I'll have to dig into the
research people have done with bytebeat to learn what's been explored
there. Also I'm still experimenting with how this all fits in with
other techniques, but it's been really satisfying already. :)
[example code below]
start("ReverbMixer")
instr P1
hexplay("f",
"Organ2", p3,
in_scale(-1, (p4 >> (p4 & 7)) % 9),
fade_in(5, 128) * ampdbfs(-12))
hexplay("f",
"Organ2", p3,
in_scale(0, (p4 >> (p4 & 5)) % 7),
fade_in(6, 128) * ampdbfs(-12))
hexplay("f",
"Organ2", p3,
in_scale(1, (p4 >> (p4 & 13)) % 14),
fade_in(7, 128) * ampdbfs(-12))
hexplay("f",
"Organ2", p3,
in_scale(-2, (p4 >> (p4 & 15)) % 4),
fade_in(8, 128) * ampdbfs(-6))
endin
On Sun, Jun 16, 2019 at 5:40 AM thorin kerr |
| Date | 2019-06-17 09:57 |
| From | Rory Walsh |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Just getting a chance to play around with this now Steven. Thanks for sharing. It's a lot of fun! On Sun, 16 Jun 2019 at 17:52, Steven Yi <stevenyi@gmail.com> wrote: Thanks Dr. B and Marcelo! |
| Date | 2019-06-17 12:28 |
| From | "Dr. Richard Boulanger" |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Steven, Is there any chance you can modify/expand the live.csound.com app so that there are a few more buttons on the top of the screen, making it easier “select all” or “clear all”. These are pretty essential when running on an iPad or an iPhone? It’s almost impossible to “select all” or clear the screen on an iPhone (there might be some magical key/finger combo but I don’t know it. The keyboard pops up for typing but... Just a hope Love the system -dB Sent from my iPad > On Jun 16, 2019, at 12:51 PM, Steven Yi |
| Date | 2019-07-11 18:39 |
| From | Steven Yi |
| Subject | Re: [Csnd] Bitshift Melodic Patterns |
Hi Dr. B, I added an issue to the live code repo issues: https://github.com/kunstmusik/csound-live-code/issues/16 I'm not sure what the best options are for iPad but they were frustrating last time I looked at it. Hopefully some better solutions are available now. Thanks! Steven On Mon, Jun 17, 2019 at 7:28 AM Dr. Richard Boulanger |