electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Antimon Antimon's Half Year Report
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
Writing User Interface...
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [29 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
jimmysword



Joined: Jan 11, 2008
Posts: 13
Location: Leeds, W Yorks

PostPosted: Mon Jan 21, 2008 5:24 pm    Post subject: Writing User Interface...
Subject description: possible to control chuck from custom interface?
Reply with quote  Mark this post and the followings unread

I'm wondering if it's possible to write interfaces for controlling chuck. For instance I was thinking something with ncurses that would perhaps start chuck in interactive mode then send commands to chuck/report data back.

I'm pretty sure it's possible to construct guis for supercollider but don't know much about the subject... something tells me that SC has it's own widgets and stuff for that?

Anyway just an idea, would be nice if it is possible.
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Jan 21, 2008 5:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi!

I'd say that's quite possible. ChucK is just a command-line program so anything that can send commands to those can send them to ChucK. You can also enter code into the VM purely through the command-line, this code may -for example- receive OSC instructions coming from interface elements in the program you would write.

However, it might be good to know ChucK will have such things build into it, some of these already work on the Apple platform but porting them to Linux and Windows seems to be taking some time. That might affect how much effort you are willing to invest into rolling your own?

Welcome on board!

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Jan 21, 2008 6:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
However, it might be good to know ChucK will have such things build into it, some of these already work on the Apple platform but porting them to Linux and Windows seems to be taking some time. That might affect how much effort you are willing to invest into rolling your own?


That's ChucKtastic news to hear. And welcome ChucKist jimmysword.
Back to top
View user's profile Send private message Send e-mail
renderful



Joined: Apr 18, 2007
Posts: 29
Location: Boulder, Co

PostPosted: Mon Jan 21, 2008 7:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here to spread the MAUI love, using it as I type this:

http://audicle.cs.princeton.edu/mini/mac/doc/maui_api.html
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Jan 21, 2008 7:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Maui-wowie, that was awesome!
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Jan 21, 2008 7:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah, I've been lusting after that! It looks like some truly choice stuff, lots of lovely functions as well, I hope the porting issues get resolved.
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Jan 21, 2008 8:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Did I see an X-Y plot in there, or would I make one out of LED's? Thinking of using this on the math/music project if possible...
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Jan 21, 2008 9:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

I don't see one but if you wanted to I imagine there is nothing keeping you from using LED's as pixels? That sounds like a highly impractical and perverse idea; I love it!
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Jan 21, 2008 11:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
I don't see one but if you wanted to I imagine there is nothing keeping you from using LED's as pixels? That sounds like a highly impractical and perverse idea; I love it!


Yes, that is what I was thinking of... creating an LED display panel that acts as an oscilloscope, for example, displaying the waveform of the current sound. Could be the video component of the project. Highly impractical and perverse indeed! I aspire to that!
Back to top
View user's profile Send private message Send e-mail
jimmysword



Joined: Jan 11, 2008
Posts: 13
Location: Leeds, W Yorks

PostPosted: Tue Jan 22, 2008 2:53 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
Hi!

I'd say that's quite possible. ChucK is just a command-line program so anything that can send commands to those can send them to ChucK. You can also enter code into the VM purely through the command-line, this code may -for example- receive OSC instructions coming from interface elements in the program you would write.

However, it might be good to know ChucK will have such things build into it, some of these already work on the Apple platform but porting them to Linux and Windows seems to be taking some time. That might affect how much effort you are willing to invest into rolling your own?

Welcome on board!


Great news all round! I did notice there was some work being done for sliders and things but rather hoped that the bindings or whatever were already present in chuck. Interactive mode will do for the time being. I'll have a play anyway and see what can be done.

Would be cool to program arrays from a little gui. I'm seeing the bigger picture more and more while I think about it and I'm near certain some aspects of this will be achieved relatively simply.
Back to top
View user's profile Send private message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Tue Jan 22, 2008 3:52 am    Post subject: Reply with quote  Mark this post and the followings unread

It would be great to see that MAUI frontend available for windows platforms.

I'm fortunate enough to have a MacBook partitioned with both operating systems on, but I find the Mac OSX port of ChucK has some incredibly odd timing issues and problems with the console input, etc.

Welcome to the board jimmy!

Rhys
Back to top
View user's profile Send private message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Jan 22, 2008 8:41 am    Post subject: Reply with quote  Mark this post and the followings unread

I once work on PD to act as a control interface for ChucK
(but my effort was 1-way.. from PD to ChucK)

I use sliders to send midi control change and wire it to chuck by Jack on linux.
it's quite convenient with Jack this way and it's quite flexible coz I don't have to compile any codes or anything.
just save in patches and load them on chuck & puredata and connect midi with Jack.

it's a simple idea and it's the only thing i can do now, hahahah,
but if you haven't tried, i think it worths a try.

on other system other than linux, i guess we'll have to use midi loopback programs for that.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
jimmysword



Joined: Jan 11, 2008
Posts: 13
Location: Leeds, W Yorks

PostPosted: Tue Jan 22, 2008 9:14 am    Post subject: Reply with quote  Mark this post and the followings unread

Using Pd's internal gui for sending midi is not a bad idea... I'd probably give it a go but I'm trying to have an x-less system for chucking as it doesn't need one.

I have a 16 knob midi controller which I'm sure I'll end up using (possibilties are endless Very Happy) but I want something graphical(ish) for pattern design/tweaking/selection. I've thought about it some more and I don't really need to have chuck report back to whatever interface I make (although it would be nice). As long as I have a range of fields I can insert values to (which then get sent to chuck) then I'm rockin' Cool
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Jan 22, 2008 10:00 am    Post subject: Reply with quote  Mark this post and the followings unread

Dr. Spankenstein wrote:
I find the Mac OSX port of ChucK has some incredibly odd timing issues and problems with the console input, etc.


Really? Could you go into a bit more detail?

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
renderful



Joined: Apr 18, 2007
Posts: 29
Location: Boulder, Co

PostPosted: Tue Jan 22, 2008 10:24 am    Post subject: Reply with quote  Mark this post and the followings unread

I'd also like to hear more about the OSX timing issues. Considering that Perry Cook, Ge and many others use Macbooks for demos and performances, I'd be surprised if it's not a configuration issue local to you machine. But this is PURE speculation.



By the way, I'm LOVING MAUI. Right now... since it's lacking many features of a normal GUI, it is GREAT for prototyping. Especially for using it to emulate a physical control interface, which I've yet to build. The quick syntax and prototyping ability really adds to the live programming concept, which I love.
Back to top
View user's profile Send private message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Sat Feb 16, 2008 5:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sorry for the late reply guys, I've been out of action for a while.

I can upload 2 sound files running from the same piece of code if you like, that both behave completely differently in terms of timing.

Console input refuses to work on MacBooks using the same code as PC.

I'll upload the code and sound files should you wanna investigate things further.

Thanks,

Rhys
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Feb 17, 2008 11:05 am    Post subject: Reply with quote  Mark this post and the followings unread

That would be good, yes.

Don't tell Steve but to me the largest appeal in getting a Mac would be that Ge uses one. I'm quite surprised to hear this, let's try&get to the bottom of this, and hand in a bug report because this is quite clearly wrong.

Could this be a matter of using different buffer-sizes on the two OS's and the influence of outside factors like HID or MIDI or OSC?

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
soundcyst



Joined: Feb 17, 2008
Posts: 18
Location: santa cruz, ca

PostPosted: Sun Feb 17, 2008 2:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi, I'm not sure if this is the right thread, but I'm really interested in figuring out a number box/text box input for MAUI. is this really hard to accomplish?
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Feb 18, 2008 12:18 am    Post subject: Reply with quote  Mark this post and the followings unread

I just figured out that downloading the latest Mac release of the ChucK mini-audicle will give me MAUI powers (I'm slow that way), so I did it and started playing with guitar_lab.ck to make a user interface for it. So far I only have the logic of the boolean sequence (which says when to play the notes), and the only logic available is the or of ANDed terms. Though a limited first attempt, it does make some nice guitar riffs.

If you have a Mac and the latest version of ChucK, then you can load up the attached file. When you run it, you will see a start/stop button and an array of 8x8 buttons, plus 8 LEDs. Each column is a binary digit in an 8-bit count, while each row is an ANDed term. Just click on some of the array buttons, preferably some of the lower-order buttons to the right, and then click on start/stop. You will be treated to a guitar riff that you just created using kijjaz's guitar class.

There is so much more to add/do to this, but I thought I would send out the first working version to see if anyone finds it useful. I'm having a lot of fun with it. MAUI wowie dude!


MAUI_BS_guitar_lab1.ck
 Description:
MAUI Boolean Sequencing Guitar Riff Lab - makes it easy to create your own guitar riffs. First attempt, logic only.

Download
 Filename:  MAUI_BS_guitar_lab1.ck
 Filesize:  5.29 KB
 Downloaded:  144 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Feb 18, 2008 2:00 am    Post subject: Reply with quote  Mark this post and the followings unread

I worked on it some more and came up with the attached MAUI file for guitar_lab. It has sliders to control frequency and various parameters plus a clear button and an XOR option for the Boolean Sequencing. Enjoy!


MAUI_BS_guitar_lab2.ck
 Description:
This version has sliders and frequency control plus XORed Boolean Sequencing.

Download
 Filename:  MAUI_BS_guitar_lab2.ck
 Filesize:  9.08 KB
 Downloaded:  125 Time(s)

Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Feb 18, 2008 3:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Code:
for (0 => j[7]; j[7] < n; j[7]++) {
    for (0 => j[6]; j[6] < n; j[6]++) {
        for (0 => j[5]; j[5] < n; j[5]++) {
            for (0 => j[4]; j[4] < n; j[4]++) {
                for (0 => j[3]; j[3] < n; j[3]++) {
                    for (0 => j[2]; j[2] < n; j[2]++) {
                        for (0 => j[1]; j[1] < n; j[1]++) {
                            for (0 => j[0]; j[0] < n; j[0]++) {


erm...... WHAT? Shocked

Could you please explain why you are using this -erm- rather involved construction? I don't really understand what's going on here, particularly as I can't find any of those indexes in the code within the innermost loop? As far as I can see it just states "do this lots and lots of times" but the "while (true)" already did that as well? This looks very mysterious to me.

I already have trouble juggling all of the variables when I'm three layers of "for" loops deep and you're at 9 or something here... quite casually or so it appears, but I don't understand why? It looks like some way of dealing with permutations but I can't find the actual dealing with the permutations?

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Feb 18, 2008 5:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen, my man, thanks for looking at my code. I admit that eight nested for loops is probably a crude way to make a base-n counter but it is how I've been doing it. In the inner part of that loop you will see the term "j[b]", which is how I access the values of the loops.

The way it works is I first have an integer slider set "n", which is the base of the count. Then the for loops count from 0 to n-1 each and since they are nested, they act like the digits of a base-n counter.

I'm sure there's better ways of doing it, but that's how I have been doing it so far. It works OK for me.

Also, I took a photo of the front end for folks to see it if they don't have a Mac (cursed incompatibilities). Here is the image:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

I have been playing around with the buttons for a few hours now, and I find that almost anything you put into the controls makes an interesting guitar riff. Adjusting the mandolin bodySize helps make different guitar sounds, especially when done in combination with different values of reverb. As to the base, only base 2 seems to work satisfactorily. At any rate, it's kind of fun to play with it and make some cool guitar riffs.
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Feb 18, 2008 5:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Ah, thanks, makes perfect sense now. That's probably quite efficient as well but if you see it for the first time it looks completely crazy. :¬)

Interface looks great, BTW, good stuff!

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Feb 18, 2008 12:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, Kassen, I've been working on it for half a day now and its turning out quite nice indeed. I added other instruments, so there is a Flute, kijjaz's Snare and Drum, plus a Mandolin. I recorded an mp3 file of the audio output of the program for one of the more interesting riffs.

Although almost anything sounds OK, it takes work and strategy to get a riff that changes over time with different sounding sections to the music. I got good results by using an increasing / alternating pattern for frequency, an "X" pattern for the sequencing, and turning the bodySize down and the reverb up, plus setting a low range of frequencies for the guitar. Also I'm discovering that you can divide-and-conquer the sequencing by setting treating the upper-order bits as a time counter and the lower order bits as multiple sub-sequences that launch or not according to the upper bit settings.

Anyway it turned out pretty good so far.


MAUI_good_riff.mp3
 Description:
Recorded output of MAUI guitar lab, one of the better riffs with deep bass like thunder and a big buildup to a reverb-echoed ending.

Download
 Filename:  MAUI_good_riff.mp3
 Filesize:  1016.73 KB
 Downloaded:  407 Time(s)

Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Feb 18, 2008 1:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

I love it.

I'm hoping the interface thingies will come to Windows and/or Linux soon as well because this looks great.... Keep at it!

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [29 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use