Csound Csound-dev Csound-tekno Search About

[Csnd] code share: hopalong attractor

Date2020-07-01 22:17
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] code share: hopalong attractor

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian







Date2020-07-02 00:27
FromSteven Yi
SubjectRe: [Csnd] code share: hopalong attractor
Hi Christian,

Thanks for sharing! 

I thought I'd mention a couple of coding things that might be useful:

1. Csound has a signum opcode to return -1, 0, or 1 which could simplify the hopafunc and hopafunci UDOs (https://csound.com/docs/manual/signum.html)

2. ophopa: could use a while-loop, but beyond that instead of vaset you could use array syntax with asigs which compiles down to vaset:

    ;vaset kfval, kcount, asig
    asig[kcount] = kfval

Thanks again for posting this, really appreciate it!

Steven

On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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

Date2020-07-02 02:00
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] code share: hopalong attractor
thanks for sharing.  enjoying very much this interesting behavior.  more to study.

Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music




On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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

Date2020-07-02 17:43
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] code share: hopalong attractor
Hi Steven,
Hi Christian,

Thanks for sharing! 

I thought I'd mention a couple of coding things that might be useful:

1. Csound has a signum opcode to return -1, 0, or 1 which could simplify the hopafunc and hopafunci UDOs (https://csound.com/docs/manual/signum.html)

2. ophopa: could use a while-loop, but beyond that instead of vaset you could use array syntax with asigs which compiles down to vaset:

    ;vaset kfval, kcount, asig
    asig[kcount] = kfval

ok thanks, i have changed it.

another interesting phenomenon occured:

i have downloaded it to my linux machine and started with exactly the same parameters.

the result is similar but different.

may be due to different underlying number representations or precision  -

in such a chaotic function slightly differences may sum up.

best christian


Thanks again for posting this, really appreciate it!

Steven

On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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

Date2020-07-02 17:50
FromSteven Yi
SubjectRe: [Csnd] code share: hopalong attractor
Ah, that's interesting!  Yes, for reference, we compile Csound for WebAssembly with MYFLT as float so that it lines up with the 32-bit architecture of WebAssembly. I imagine if we built for doubles the results should be the same. Good to know about this, thanks for mentioning it!

On Thu, Jul 2, 2020 at 12:43 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:
Hi Steven,
Hi Christian,

Thanks for sharing! 

I thought I'd mention a couple of coding things that might be useful:

1. Csound has a signum opcode to return -1, 0, or 1 which could simplify the hopafunc and hopafunci UDOs (https://csound.com/docs/manual/signum.html)

2. ophopa: could use a while-loop, but beyond that instead of vaset you could use array syntax with asigs which compiles down to vaset:

    ;vaset kfval, kcount, asig
    asig[kcount] = kfval

ok thanks, i have changed it.

another interesting phenomenon occured:

i have downloaded it to my linux machine and started with exactly the same parameters.

the result is similar but different.

may be due to different underlying number representations or precision  -

in such a chaotic function slightly differences may sum up.

best christian


Thanks again for posting this, really appreciate it!

Steven

On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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
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
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

Date2020-07-02 18:02
Fromjohn
SubjectRe: [Csnd] code share: hopalong attractor
Any chance of a csd file?  I cannot get the ide thing to do anything but go 
round in circles


On Wed, 1 Jul 2020, docB wrote:

> 
> the hopalong attractor is a strange 2d attractor and known for jumping around
> on the 2d plane (hop-along).
> 
> jumping may produce sounds and not only noise, so i checked.
> 
> here is a csd which renders the attractor directly into audio samples and
> plays the x-coord left and y-coord right.
> 
> https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s
> 
> the formula is:
> x=0, y=0
> xnew=y-sqrt(abs(b*x-c))*sign(x)
> ynew=a-x
> 
> instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds -
> some examples are in the score.
> 
> bottom line: a good source of strange sequences and sounds
> 
> -christian
> 
> 
> 
> 
> 
> 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
>

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

Date2020-07-02 18:10
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] code share: hopalong attractor
Attachmentshopa.csd  
hi john, here it is - see attachment.

-christian

On 7/2/20 7:02 PM, john wrote:
> Any chance of a csd file?  I cannot get the ide thing to do anything 
> but go round in circles
>
>
> On Wed, 1 Jul 2020, docB wrote:
>
>>
>> the hopalong attractor is a strange 2d attractor and known for 
>> jumping around
>> on the 2d plane (hop-along).
>>
>> jumping may produce sounds and not only noise, so i checked.
>>
>> here is a csd which renders the attractor directly into audio samples 
>> and
>> plays the x-coord left and y-coord right.
>>
>> https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s
>>
>> the formula is:
>> x=0, y=0
>> xnew=y-sqrt(abs(b*x-c))*sign(x)
>> ynew=a-x
>>
>> instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in 
>> seconds -
>> some examples are in the score.
>>
>> bottom line: a good source of strange sequences and sounds
>>
>> -christian
>>
>>
>>
>>
>>
>> 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
>>
>
> 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

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

Date2020-07-02 18:18
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] code share: hopalong attractor
It would be nice if Csound Web had an export as .csd option

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

> On Jul 2, 2020, at 1:02 PM, john  wrote:
> 
> Any chance of a csd file?  I cannot get the ide thing to do anything but go round in circles
> 
> 
>> On Wed, 1 Jul 2020, docB wrote:
>> 
>> the hopalong attractor is a strange 2d attractor and known for jumping around
>> on the 2d plane (hop-along).
>> jumping may produce sounds and not only noise, so i checked.
>> here is a csd which renders the attractor directly into audio samples and
>> plays the x-coord left and y-coord right.
>> https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s
>> the formula is:
>> x=0, y=0
>> xnew=y-sqrt(abs(b*x-c))*sign(x)
>> ynew=a-x
>> instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds -
>> some examples are in the score.
>> bottom line: a good source of strange sequences and sounds
>> -christian
>> 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
>> 
> 
> 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

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

Date2020-07-02 18:37
FromSteven Yi
SubjectRe: [Csnd] code share: hopalong attractor
That's on the list and should be added hopefully soon. (Have been stuck on some other infrastructure changes for the interface.)

On Thu, Jul 2, 2020 at 1:18 PM Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
It would be nice if Csound Web had an export as .csd option

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

> On Jul 2, 2020, at 1:02 PM, john <jpff@codemist.co.uk> wrote:
>
> Any chance of a csd file?  I cannot get the ide thing to do anything but go round in circles
>
>
>> On Wed, 1 Jul 2020, docB wrote:
>>
>> the hopalong attractor is a strange 2d attractor and known for jumping around
>> on the 2d plane (hop-along).
>> jumping may produce sounds and not only noise, so i checked.
>> here is a csd which renders the attractor directly into audio samples and
>> plays the x-coord left and y-coord right.
>> https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s
>> the formula is:
>> x=0, y=0
>> xnew=y-sqrt(abs(b*x-c))*sign(x)
>> ynew=a-x
>> instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds -
>> some examples are in the score.
>> bottom line: a good source of strange sequences and sounds
>> -christian
>> 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
>>
>
> 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

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
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

Date2020-07-05 16:44
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] code share: hopalong attractor

i have made a visualization which may show some insights what is happening.

in every frame of the video the current 1920 points (48000 / 25) a drawn.

https://www.youtube.com/watch?v=h6pkTBl8oEc

https://www.youtube.com/watch?v=scNbXJUAAVA

-christian

On 7/2/20 3:00 AM, Dr. Richard Boulanger wrote:
thanks for sharing.  enjoying very much this interesting behavior.  more to study.

Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music




On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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

Date2020-07-05 20:13
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] code share: hopalong attractor
Nice

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

On Jul 5, 2020, at 11:45 AM, docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:



i have made a visualization which may show some insights what is happening.

in every frame of the video the current 1920 points (48000 / 25) a drawn.

https://www.youtube.com/watch?v=h6pkTBl8oEc

https://www.youtube.com/watch?v=scNbXJUAAVA

-christian

On 7/2/20 3:00 AM, Dr. Richard Boulanger wrote:
thanks for sharing.  enjoying very much this interesting behavior.  more to study.

Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music




On Wed, Jul 1, 2020 at 5:18 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:

the hopalong attractor is a strange 2d attractor and known for jumping around on the 2d plane (hop-along).

jumping may produce sounds and not only noise, so i checked.

here is a csd which renders the attractor directly into audio samples and plays the x-coord left and y-coord right.

https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s

the formula is:
x=0, y=0
xnew=y-sqrt(abs(b*x-c))*sign(x)
ynew=a-x

instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in seconds - some examples are in the score.

bottom line: a good source of strange sequences and sounds

-christian






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
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
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

Date2020-07-19 13:51
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] code share: hopalong attractor
Christian,

Your .csd is very cool.  Thanks for sharing.

-dB

Dr. Richard Boulanger

Professor of Electronic Production and Design



On Thu, Jul 2, 2020 at 1:10 PM docB <000005d2745f1ec0-dmarc-request@listserv.heanet.ie> wrote:
hi john, here it is - see attachment.

-christian

On 7/2/20 7:02 PM, john wrote:
> Any chance of a csd file?  I cannot get the ide thing to do anything
> but go round in circles
>
>
> On Wed, 1 Jul 2020, docB wrote:
>
>>
>> the hopalong attractor is a strange 2d attractor and known for
>> jumping around
>> on the 2d plane (hop-along).
>>
>> jumping may produce sounds and not only noise, so i checked.
>>
>> here is a csd which renders the attractor directly into audio samples
>> and
>> plays the x-coord left and y-coord right.
>>
>> https://ide.csound.com/editor/vDnabhql1l6MaIqMvQ5s
>>
>> the formula is:
>> x=0, y=0
>> xnew=y-sqrt(abs(b*x-c))*sign(x)
>> ynew=a-x
>>
>> instrument parameters: p4 => a, p5 => b, p6 => c, p7 = offset in
>> seconds -
>> some examples are in the score.
>>
>> bottom line: a good source of strange sequences and sounds
>>
>> -christian
>>
>>
>>
>>
>>
>> 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
>>
>
> 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

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
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