Csound Csound-dev Csound-tekno Search About

[Csnd] [ANN] Gamepad API + WebAudio Csound

Date2020-10-01 01:51
FromSteven Yi
Subject[Csnd] [ANN] Gamepad API + WebAudio Csound
Hi All,

I put together a proof-of-concept web application for using the
Gamepad API [1] together with Webaudio Csound to create a simple web
instrument.  The code is hardcoded to work with an Xbox One controller
(I'm using an AmazonBasics version; pretty affordable).  The web page
is hosted at:

https://kunstmusik.github.io/gamepad-csound-web/

with source code at:

https://github.com/kunstmusik/gamepad-csound-web/

To run the page, simply load it up and press the "Start App" button
and connect an Xbox One controller to your computer. Button presses
will turn on notes and releases will turn them off. Analog joystick
input is used to affect filter cutoff, pitch bend, and LFO amplitude
and frequency. The instrument is pretty basic but I think was good for
proof-of-concept purposes.

If you're using the gamepad API, I found https://gamepad-tester.com/
to be extremely handy for identifying button numbers and axes values.

Enjoy!
Steven


[1] - https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

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-10-01 02:51
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] [ANN] Gamepad API + WebAudio Csound
Steven,

Awesome.  Ordering the controller now. (Will try other controllers later to see if anything that I have will work.)

- wired or wireless?  or both?  The AmazonBasics version is USB

Does this mean that there will be an XBOX one controller opcode in the next release of Csound
- I hope so!

-dB

Dr. Richard Boulanger

Professor of Electronic Production and Design

Berklee College of Music

Professional Writing and Technology Division


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/

Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Wed, Sep 30, 2020 at 8:52 PM Steven Yi <stevenyi@gmail.com> wrote:
Hi All,

I put together a proof-of-concept web application for using the
Gamepad API [1] together with Webaudio Csound to create a simple web
instrument.  The code is hardcoded to work with an Xbox One controller
(I'm using an AmazonBasics version; pretty affordable).  The web page
is hosted at:

https://us-west-2.protection.sophos.com?d=kunstmusik.github.io&u=aHR0cHM6Ly9rdW5zdG11c2lrLmdpdGh1Yi5pby9nYW1lcGFkLWNzb3VuZC13ZWIv&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=RjMzSDMwcHJMNndJMUErOWNGVHQ3WDlPNVVwVytoc3Y0V1BBMTAxSFRYUT0=&h=cf0ef124fb744c349a222e40008d2c32

with source code at:

https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2t1bnN0bXVzaWsvZ2FtZXBhZC1jc291bmQtd2ViLw==&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=YkZUbVFpQlRVNzg5YjJtS29WUi9zVjJJalpHVFdtU1RsY1QxQStiQTZFUT0=&h=cf0ef124fb744c349a222e40008d2c32

To run the page, simply load it up and press the "Start App" button
and connect an Xbox One controller to your computer. Button presses
will turn on notes and releases will turn them off. Analog joystick
input is used to affect filter cutoff, pitch bend, and LFO amplitude
and frequency. The instrument is pretty basic but I think was good for
proof-of-concept purposes.

If you're using the gamepad API, I found https://us-west-2.protection.sophos.com?d=gamepad-tester.com&u=aHR0cHM6Ly9nYW1lcGFkLXRlc3Rlci5jb20v&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cnd1ZFdoVXBIU1ltMmhZUmFtZFJCUTlPZ1VnK1dNOWxscUtsandpTXJnND0=&h=cf0ef124fb744c349a222e40008d2c32
to be extremely handy for identifying button numbers and axes values.

Enjoy!
Steven


[1] - https://us-west-2.protection.sophos.com?d=mozilla.org&u=aHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4tVVMvZG9jcy9XZWIvQVBJL0dhbWVwYWRfQVBJL1VzaW5nX3RoZV9HYW1lcGFkX0FQSQ==&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=OHBxb3F6ODd0emxlQkdVWkZBTzFXYjhQVTVoeElTNGxockdKVUZPRVk4WT0=&h=cf0ef124fb744c349a222e40008d2c32

Csound mailing list
Csound@listserv.heanet.ie
https://us-west-2.protection.sophos.com?d=heanet.ie&u=aHR0cHM6Ly9saXN0c2Vydi5oZWFuZXQuaWUvY2dpLWJpbi93YT9BMD1DU09VTkQ=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=V2MrMzVGMU1BZEZaZ1lZck9kUnhTTC9YN1BHMnUxSDd4THhWY0dLeURxYz0=&h=cf0ef124fb744c349a222e40008d2c32
Send bugs reports to
        https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9jc291bmQvaXNzdWVz&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cWpnbGx6KzZUci9yQkZQMDNaTDdyZFdzK1l1WDE0TVhzOXR1dHltRUx5RT0=&h=cf0ef124fb744c349a222e40008d2c32
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-10-03 19:43
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] [ANN] Gamepad API + WebAudio Csound
Steven,

Wonderful!!  Fun... and hoping you will do and share more with this!!!

My Amazon Basics Xbox One controller arrived today.

To recognize the USB device on the Mac, one needs to install:


Nice to play with.  
Hoping that you will turn it into an opcode so that I/we could connect it to some of our Csound instruments from within Csound itself.

Thanks so much for making and sharing.

-dB




Dr. Richard Boulanger

Professor of Electronic Production and Design

Berklee College of Music

Professional Writing and Technology Division


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/

Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Wed, Sep 30, 2020 at 8:52 PM Steven Yi <stevenyi@gmail.com> wrote:
Hi All,

I put together a proof-of-concept web application for using the
Gamepad API [1] together with Webaudio Csound to create a simple web
instrument.  The code is hardcoded to work with an Xbox One controller
(I'm using an AmazonBasics version; pretty affordable).  The web page
is hosted at:

https://us-west-2.protection.sophos.com?d=kunstmusik.github.io&u=aHR0cHM6Ly9rdW5zdG11c2lrLmdpdGh1Yi5pby9nYW1lcGFkLWNzb3VuZC13ZWIv&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=RjMzSDMwcHJMNndJMUErOWNGVHQ3WDlPNVVwVytoc3Y0V1BBMTAxSFRYUT0=&h=cf0ef124fb744c349a222e40008d2c32

with source code at:

https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2t1bnN0bXVzaWsvZ2FtZXBhZC1jc291bmQtd2ViLw==&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=YkZUbVFpQlRVNzg5YjJtS29WUi9zVjJJalpHVFdtU1RsY1QxQStiQTZFUT0=&h=cf0ef124fb744c349a222e40008d2c32

To run the page, simply load it up and press the "Start App" button
and connect an Xbox One controller to your computer. Button presses
will turn on notes and releases will turn them off. Analog joystick
input is used to affect filter cutoff, pitch bend, and LFO amplitude
and frequency. The instrument is pretty basic but I think was good for
proof-of-concept purposes.

If you're using the gamepad API, I found https://us-west-2.protection.sophos.com?d=gamepad-tester.com&u=aHR0cHM6Ly9nYW1lcGFkLXRlc3Rlci5jb20v&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cnd1ZFdoVXBIU1ltMmhZUmFtZFJCUTlPZ1VnK1dNOWxscUtsandpTXJnND0=&h=cf0ef124fb744c349a222e40008d2c32
to be extremely handy for identifying button numbers and axes values.

Enjoy!
Steven


[1] - https://us-west-2.protection.sophos.com?d=mozilla.org&u=aHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4tVVMvZG9jcy9XZWIvQVBJL0dhbWVwYWRfQVBJL1VzaW5nX3RoZV9HYW1lcGFkX0FQSQ==&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=OHBxb3F6ODd0emxlQkdVWkZBTzFXYjhQVTVoeElTNGxockdKVUZPRVk4WT0=&h=cf0ef124fb744c349a222e40008d2c32

Csound mailing list
Csound@listserv.heanet.ie
https://us-west-2.protection.sophos.com?d=heanet.ie&u=aHR0cHM6Ly9saXN0c2Vydi5oZWFuZXQuaWUvY2dpLWJpbi93YT9BMD1DU09VTkQ=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=V2MrMzVGMU1BZEZaZ1lZck9kUnhTTC9YN1BHMnUxSDd4THhWY0dLeURxYz0=&h=cf0ef124fb744c349a222e40008d2c32
Send bugs reports to
        https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9jc291bmQvaXNzdWVz&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cWpnbGx6KzZUci9yQkZQMDNaTDdyZFdzK1l1WDE0TVhzOXR1dHltRUx5RT0=&h=cf0ef124fb744c349a222e40008d2c32
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