Csound Csound-dev Csound-tekno Search About

[ot] Csound music...

Date2015-06-02 18:04
FromRory Walsh
Subject[ot] Csound music...
AttachmentsNone  None  
I just posted some music I made with Csound to my soundcloud page(link below). It is made with a generative instrument that responds to actions made while playing a space scroller video game I created with Unity. As the player shoots enemies and avoids being killed they unlock different effects they can apply to the music. They can mute any of the six tracks, transpose them, randomly shuffle them, change the tempo, etc. Each action causes a slight change in the underlined audio. On top of that there are a few random elements thrown in too to give each turn a different feel. Here's the audio but I'm going to wait till I have an Android version before I release the game. For anyone interested these are the instruments I use to generate the audio. I had to keep it as simple as I could in the hope that it will run on Android. On top of this I randomly fill tables with note and rhythmic values. These are then used to sequence the instruments. 
 
https://soundcloud.com/rorywalsh/output5

;simple drums
instr 1000; hihat closed
    aamp      expon     .1,  0.05,   0.001
    arand     rand      aamp
    outs arand*p4, arand*p4
endin

instr 2000; snare
    aenv1  expon  .1, 0.3, 0.005
    a1   oscili aenv1, p4, p5
    aamp      expon     .1,  0.2,   0.001
    arand     randi      aamp, 2500
    outs (a1+arand)*p6, (a1+arand)*p6
endin

instr 3000; kick
    k1  expon    p4, 0.2, p4-40   
    aenv expon 1, p3, 0.001
    a1  poscil    aenv, k1, p5
    outs a1*p6, a1*p6
endin

instr 4000; who konws...
    k1 expon .5, p3, 0.01
    a1 randi k1, p5
    a2 oscili a1, p4, p5
    outs a2*p6, a2*p6
endin

;really simple background synth
instr Synth
kIntervals[] array .07, 0, -.07, .05
a1 init 0
kNote init 0
kTable init p5
kTrans init 0
kIndex init 0
Schannel1 sprintf "voice%dvol", p6
Schannel2 sprintf "voice%dtable", p6
Schannel3 sprintf "voice%dfold", p6
Schannel4 sprintf "voice%dbit", p6
Schannel5 sprintf "voice%dtrans", p6

kGain chnget Schannel1
kTable chnget Schannel2
kBits chnget Schannel3
kFold chnget Schannel4
kTrans chnget Schannel5

if metro(1)==1 then
    Schannel6 sprintf "voice%dfreq", p6
    kFreq chnget Schannel6
endif

if changed:k(kTrans)==1 then
kTrans = kIntervals[kIndex]
kIndex = kIndex==4 ? 0 : kIndex+1
endif
;kGain=1
if kTable==1 then
kNote oscil 1, (1/p4)*kFreq, 99
elseif kTable==2 then
kNote oscil 1, (1/p4)*kFreq, 98
elseif kTable==3 then
kNote oscil 1, (1/p4)*kFreq, 97
elseif kTable==4 then
kNote oscil 1, (1/p4)*kFreq, 96
elseif kTable==5 then
kNote oscil 1, (1/p4)*kFreq, 95
endif

if p8==1 then
aEnv oscili 1, abs(p4), 1
else
aEnv=.5;
endif
a1 oscili aEnv, cpspch(kNote+kTrans)*p7, 2
a1 LoFi a1, kBits, kFold
kPan jspline 1, .3, .5
outs abs(kPan)*((a1*.25)*kGain), ((a1*.25)*kGain)*(1-kPan)
endin



Date2015-06-02 19:32
FromPaul Batchelor
SubjectRe: [ot] Csound music...
AttachmentsNone  None  
Neat concept!

I'd be curious to see what the accompanying game footage looks like. 

On Tue, Jun 2, 2015 at 1:04 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
I just posted some music I made with Csound to my soundcloud page(link below). It is made with a generative instrument that responds to actions made while playing a space scroller video game I created with Unity. As the player shoots enemies and avoids being killed they unlock different effects they can apply to the music. They can mute any of the six tracks, transpose them, randomly shuffle them, change the tempo, etc. Each action causes a slight change in the underlined audio. On top of that there are a few random elements thrown in too to give each turn a different feel. Here's the audio but I'm going to wait till I have an Android version before I release the game. For anyone interested these are the instruments I use to generate the audio. I had to keep it as simple as I could in the hope that it will run on Android. On top of this I randomly fill tables with note and rhythmic values. These are then used to sequence the instruments. 
 
https://soundcloud.com/rorywalsh/output5

;simple drums
instr 1000; hihat closed
    aamp      expon     .1,  0.05,   0.001
    arand     rand      aamp
    outs arand*p4, arand*p4
endin

instr 2000; snare
    aenv1  expon  .1, 0.3, 0.005
    a1   oscili aenv1, p4, p5
    aamp      expon     .1,  0.2,   0.001
    arand     randi      aamp, 2500
    outs (a1+arand)*p6, (a1+arand)*p6
endin

instr 3000; kick
    k1  expon    p4, 0.2, p4-40   
    aenv expon 1, p3, 0.001
    a1  poscil    aenv, k1, p5
    outs a1*p6, a1*p6
endin

instr 4000; who konws...
    k1 expon .5, p3, 0.01
    a1 randi k1, p5
    a2 oscili a1, p4, p5
    outs a2*p6, a2*p6
endin

;really simple background synth
instr Synth
kIntervals[] array .07, 0, -.07, .05
a1 init 0
kNote init 0
kTable init p5
kTrans init 0
kIndex init 0
Schannel1 sprintf "voice%dvol", p6
Schannel2 sprintf "voice%dtable", p6
Schannel3 sprintf "voice%dfold", p6
Schannel4 sprintf "voice%dbit", p6
Schannel5 sprintf "voice%dtrans", p6

kGain chnget Schannel1
kTable chnget Schannel2
kBits chnget Schannel3
kFold chnget Schannel4
kTrans chnget Schannel5

if metro(1)==1 then
    Schannel6 sprintf "voice%dfreq", p6
    kFreq chnget Schannel6
endif

if changed:k(kTrans)==1 then
kTrans = kIntervals[kIndex]
kIndex = kIndex==4 ? 0 : kIndex+1
endif
;kGain=1
if kTable==1 then
kNote oscil 1, (1/p4)*kFreq, 99
elseif kTable==2 then
kNote oscil 1, (1/p4)*kFreq, 98
elseif kTable==3 then
kNote oscil 1, (1/p4)*kFreq, 97
elseif kTable==4 then
kNote oscil 1, (1/p4)*kFreq, 96
elseif kTable==5 then
kNote oscil 1, (1/p4)*kFreq, 95
endif

if p8==1 then
aEnv oscili 1, abs(p4), 1
else
aEnv=.5;
endif
a1 oscili aEnv, cpspch(kNote+kTrans)*p7, 2
a1 LoFi a1, kBits, kFold
kPan jspline 1, .3, .5
outs abs(kPan)*((a1*.25)*kGain), ((a1*.25)*kGain)*(1-kPan)
endin



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-06-02 20:01
FromAaron Krister Johnson
SubjectRe: [ot] Csound music...
AttachmentsNone  None  
Very cool, and hypnotic, Rory! Also, ripe for some experimenting with ethnic/untwelve scales....

So, I assume these channels are fed with events from the game...the instruments are nice sounding but basic. What I'm really interested in are the event-generating algorithms and how they relate to game actions, specifically.

AKJ

Aaron Krister Johnson
http://www.untwelve.org

On Tue, Jun 2, 2015 at 1:32 PM, Paul Batchelor <ralphbluecoat@gmail.com> wrote:
Neat concept!

I'd be curious to see what the accompanying game footage looks like. 

On Tue, Jun 2, 2015 at 1:04 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
I just posted some music I made with Csound to my soundcloud page(link below). It is made with a generative instrument that responds to actions made while playing a space scroller video game I created with Unity. As the player shoots enemies and avoids being killed they unlock different effects they can apply to the music. They can mute any of the six tracks, transpose them, randomly shuffle them, change the tempo, etc. Each action causes a slight change in the underlined audio. On top of that there are a few random elements thrown in too to give each turn a different feel. Here's the audio but I'm going to wait till I have an Android version before I release the game. For anyone interested these are the instruments I use to generate the audio. I had to keep it as simple as I could in the hope that it will run on Android. On top of this I randomly fill tables with note and rhythmic values. These are then used to sequence the instruments. 
 
https://soundcloud.com/rorywalsh/output5

;simple drums
instr 1000; hihat closed
    aamp      expon     .1,  0.05,   0.001
    arand     rand      aamp
    outs arand*p4, arand*p4
endin

instr 2000; snare
    aenv1  expon  .1, 0.3, 0.005
    a1   oscili aenv1, p4, p5
    aamp      expon     .1,  0.2,   0.001
    arand     randi      aamp, 2500
    outs (a1+arand)*p6, (a1+arand)*p6
endin

instr 3000; kick
    k1  expon    p4, 0.2, p4-40   
    aenv expon 1, p3, 0.001
    a1  poscil    aenv, k1, p5
    outs a1*p6, a1*p6
endin

instr 4000; who konws...
    k1 expon .5, p3, 0.01
    a1 randi k1, p5
    a2 oscili a1, p4, p5
    outs a2*p6, a2*p6
endin

;really simple background synth
instr Synth
kIntervals[] array .07, 0, -.07, .05
a1 init 0
kNote init 0
kTable init p5
kTrans init 0
kIndex init 0
Schannel1 sprintf "voice%dvol", p6
Schannel2 sprintf "voice%dtable", p6
Schannel3 sprintf "voice%dfold", p6
Schannel4 sprintf "voice%dbit", p6
Schannel5 sprintf "voice%dtrans", p6

kGain chnget Schannel1
kTable chnget Schannel2
kBits chnget Schannel3
kFold chnget Schannel4
kTrans chnget Schannel5

if metro(1)==1 then
    Schannel6 sprintf "voice%dfreq", p6
    kFreq chnget Schannel6
endif

if changed:k(kTrans)==1 then
kTrans = kIntervals[kIndex]
kIndex = kIndex==4 ? 0 : kIndex+1
endif
;kGain=1
if kTable==1 then
kNote oscil 1, (1/p4)*kFreq, 99
elseif kTable==2 then
kNote oscil 1, (1/p4)*kFreq, 98
elseif kTable==3 then
kNote oscil 1, (1/p4)*kFreq, 97
elseif kTable==4 then
kNote oscil 1, (1/p4)*kFreq, 96
elseif kTable==5 then
kNote oscil 1, (1/p4)*kFreq, 95
endif

if p8==1 then
aEnv oscili 1, abs(p4), 1
else
aEnv=.5;
endif
a1 oscili aEnv, cpspch(kNote+kTrans)*p7, 2
a1 LoFi a1, kBits, kFold
kPan jspline 1, .3, .5
outs abs(kPan)*((a1*.25)*kGain), ((a1*.25)*kGain)*(1-kPan)
endin



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-06-02 20:21
FromRory Walsh
SubjectRe: [ot] Csound music...
AttachmentsNone  None  
Here is a short clip of the demo game in action. 


As you see, I have access to the various manipulations that can occur on each track, which are colour coded. Users however will have to unlock these privileges by destroying enemies. It's nothing more than a fun experiment with Csound and Unity.    

On 2 June 2015 at 20:01, Aaron Krister Johnson <akjmicro@gmail.com> wrote:
Very cool, and hypnotic, Rory! Also, ripe for some experimenting with ethnic/untwelve scales....

So, I assume these channels are fed with events from the game...the instruments are nice sounding but basic. What I'm really interested in are the event-generating algorithms and how they relate to game actions, specifically.

AKJ

Aaron Krister Johnson
http://www.untwelve.org

On Tue, Jun 2, 2015 at 1:32 PM, Paul Batchelor <ralphbluecoat@gmail.com> wrote:
Neat concept!

I'd be curious to see what the accompanying game footage looks like. 

On Tue, Jun 2, 2015 at 1:04 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
I just posted some music I made with Csound to my soundcloud page(link below). It is made with a generative instrument that responds to actions made while playing a space scroller video game I created with Unity. As the player shoots enemies and avoids being killed they unlock different effects they can apply to the music. They can mute any of the six tracks, transpose them, randomly shuffle them, change the tempo, etc. Each action causes a slight change in the underlined audio. On top of that there are a few random elements thrown in too to give each turn a different feel. Here's the audio but I'm going to wait till I have an Android version before I release the game. For anyone interested these are the instruments I use to generate the audio. I had to keep it as simple as I could in the hope that it will run on Android. On top of this I randomly fill tables with note and rhythmic values. These are then used to sequence the instruments. 
 
https://soundcloud.com/rorywalsh/output5

;simple drums
instr 1000; hihat closed
    aamp      expon     .1,  0.05,   0.001
    arand     rand      aamp
    outs arand*p4, arand*p4
endin

instr 2000; snare
    aenv1  expon  .1, 0.3, 0.005
    a1   oscili aenv1, p4, p5
    aamp      expon     .1,  0.2,   0.001
    arand     randi      aamp, 2500
    outs (a1+arand)*p6, (a1+arand)*p6
endin

instr 3000; kick
    k1  expon    p4, 0.2, p4-40   
    aenv expon 1, p3, 0.001
    a1  poscil    aenv, k1, p5
    outs a1*p6, a1*p6
endin

instr 4000; who konws...
    k1 expon .5, p3, 0.01
    a1 randi k1, p5
    a2 oscili a1, p4, p5
    outs a2*p6, a2*p6
endin

;really simple background synth
instr Synth
kIntervals[] array .07, 0, -.07, .05
a1 init 0
kNote init 0
kTable init p5
kTrans init 0
kIndex init 0
Schannel1 sprintf "voice%dvol", p6
Schannel2 sprintf "voice%dtable", p6
Schannel3 sprintf "voice%dfold", p6
Schannel4 sprintf "voice%dbit", p6
Schannel5 sprintf "voice%dtrans", p6

kGain chnget Schannel1
kTable chnget Schannel2
kBits chnget Schannel3
kFold chnget Schannel4
kTrans chnget Schannel5

if metro(1)==1 then
    Schannel6 sprintf "voice%dfreq", p6
    kFreq chnget Schannel6
endif

if changed:k(kTrans)==1 then
kTrans = kIntervals[kIndex]
kIndex = kIndex==4 ? 0 : kIndex+1
endif
;kGain=1
if kTable==1 then
kNote oscil 1, (1/p4)*kFreq, 99
elseif kTable==2 then
kNote oscil 1, (1/p4)*kFreq, 98
elseif kTable==3 then
kNote oscil 1, (1/p4)*kFreq, 97
elseif kTable==4 then
kNote oscil 1, (1/p4)*kFreq, 96
elseif kTable==5 then
kNote oscil 1, (1/p4)*kFreq, 95
endif

if p8==1 then
aEnv oscili 1, abs(p4), 1
else
aEnv=.5;
endif
a1 oscili aEnv, cpspch(kNote+kTrans)*p7, 2
a1 LoFi a1, kBits, kFold
kPan jspline 1, .3, .5
outs abs(kPan)*((a1*.25)*kGain), ((a1*.25)*kGain)*(1-kPan)
endin



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------

_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-06-02 21:55
FromOeyvind Brandtsegg
SubjectRe: [ot] Csound music...
Groovy!

2015-06-02 21:21 GMT+02:00 Rory Walsh :
> Here is a short clip of the demo game in action.
>
> https://drive.google.com/a/ear.ie/file/d/0B8d5v5-MID4NQlF2UUNPNEROaXM/view?usp=sharing
>
> As you see, I have access to the various manipulations that can occur on
> each track, which are colour coded. Users however will have to unlock these
> privileges by destroying enemies. It's nothing more than a fun experiment
> with Csound and Unity.
>
> On 2 June 2015 at 20:01, Aaron Krister Johnson  wrote:
>>
>> Very cool, and hypnotic, Rory! Also, ripe for some experimenting with
>> ethnic/untwelve scales....
>>
>> So, I assume these channels are fed with events from the game...the
>> instruments are nice sounding but basic. What I'm really interested in are
>> the event-generating algorithms and how they relate to game actions,
>> specifically.
>>
>> AKJ
>>
>> Aaron Krister Johnson
>> http://www.untwelve.org
>>
>> On Tue, Jun 2, 2015 at 1:32 PM, Paul Batchelor 
>> wrote:
>>>
>>> Neat concept!
>>>
>>> I'd be curious to see what the accompanying game footage looks like.
>>>
>>> On Tue, Jun 2, 2015 at 1:04 PM, Rory Walsh  wrote:
>>>>
>>>> I just posted some music I made with Csound to my soundcloud page(link
>>>> below). It is made with a generative instrument that responds to actions
>>>> made while playing a space scroller video game I created with Unity. As the
>>>> player shoots enemies and avoids being killed they unlock different effects
>>>> they can apply to the music. They can mute any of the six tracks, transpose
>>>> them, randomly shuffle them, change the tempo, etc. Each action causes a
>>>> slight change in the underlined audio. On top of that there are a few random
>>>> elements thrown in too to give each turn a different feel. Here's the audio
>>>> but I'm going to wait till I have an Android version before I release the
>>>> game. For anyone interested these are the instruments I use to generate the
>>>> audio. I had to keep it as simple as I could in the hope that it will run on
>>>> Android. On top of this I randomly fill tables with note and rhythmic
>>>> values. These are then used to sequence the instruments.
>>>>
>>>> https://soundcloud.com/rorywalsh/output5
>>>>
>>>> ;simple drums
>>>> instr 1000; hihat closed
>>>>     aamp      expon     .1,  0.05,   0.001
>>>>     arand     rand      aamp
>>>>     outs arand*p4, arand*p4
>>>> endin
>>>>
>>>> instr 2000; snare
>>>>     aenv1  expon  .1, 0.3, 0.005
>>>>     a1   oscili aenv1, p4, p5
>>>>     aamp      expon     .1,  0.2,   0.001
>>>>     arand     randi      aamp, 2500
>>>>     outs (a1+arand)*p6, (a1+arand)*p6
>>>> endin
>>>>
>>>> instr 3000; kick
>>>>     k1  expon    p4, 0.2, p4-40
>>>>     aenv expon 1, p3, 0.001
>>>>     a1  poscil    aenv, k1, p5
>>>>     outs a1*p6, a1*p6
>>>> endin
>>>>
>>>> instr 4000; who konws...
>>>>     k1 expon .5, p3, 0.01
>>>>     a1 randi k1, p5
>>>>     a2 oscili a1, p4, p5
>>>>     outs a2*p6, a2*p6
>>>> endin
>>>>
>>>> ;really simple background synth
>>>> instr Synth
>>>> kIntervals[] array .07, 0, -.07, .05
>>>> a1 init 0
>>>> kNote init 0
>>>> kTable init p5
>>>> kTrans init 0
>>>> kIndex init 0
>>>> Schannel1 sprintf "voice%dvol", p6
>>>> Schannel2 sprintf "voice%dtable", p6
>>>> Schannel3 sprintf "voice%dfold", p6
>>>> Schannel4 sprintf "voice%dbit", p6
>>>> Schannel5 sprintf "voice%dtrans", p6
>>>>
>>>> kGain chnget Schannel1
>>>> kTable chnget Schannel2
>>>> kBits chnget Schannel3
>>>> kFold chnget Schannel4
>>>> kTrans chnget Schannel5
>>>>
>>>> if metro(1)==1 then
>>>>     Schannel6 sprintf "voice%dfreq", p6
>>>>     kFreq chnget Schannel6
>>>> endif
>>>>
>>>> if changed:k(kTrans)==1 then
>>>> kTrans = kIntervals[kIndex]
>>>> kIndex = kIndex==4 ? 0 : kIndex+1
>>>> endif
>>>> ;kGain=1
>>>> if kTable==1 then
>>>> kNote oscil 1, (1/p4)*kFreq, 99
>>>> elseif kTable==2 then
>>>> kNote oscil 1, (1/p4)*kFreq, 98
>>>> elseif kTable==3 then
>>>> kNote oscil 1, (1/p4)*kFreq, 97
>>>> elseif kTable==4 then
>>>> kNote oscil 1, (1/p4)*kFreq, 96
>>>> elseif kTable==5 then
>>>> kNote oscil 1, (1/p4)*kFreq, 95
>>>> endif
>>>>
>>>> if p8==1 then
>>>> aEnv oscili 1, abs(p4), 1
>>>> else
>>>> aEnv=.5;
>>>> endif
>>>> a1 oscili aEnv, cpspch(kNote+kTrans)*p7, 2
>>>> a1 LoFi a1, kBits, kFold
>>>> kPan jspline 1, .3, .5
>>>> outs abs(kPan)*((a1*.25)*kGain), ((a1*.25)*kGain)*(1-kPan)
>>>> endin
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Csound-users mailing list
>>>> Csound-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Csound-users mailing list
>>> Csound-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Csound-users mailing list
>> Csound-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-users
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>