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 
 Forum index » Discussion » Composition
glass-bead game
Post new topic   Reply to topic Moderators: elektro80
Page 3 of 7 [155 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20471
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Thu Jun 12, 2008 7:38 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Quite a bad position to be in, over-aggressive and exposed to the world, so it seems.

Protest comes in many forms. Peace


Laughing But maybe not, that nice new queeny you got in there is just following the Scandinavian track it seems ... phew ... it's been quite a while since I last moved those pieces around, glad there is some internet help around nowadays Shocked

It's too bad I can't make those interesting lines, it would be interesting to stream the audio as well ... would it be hard to make a web (PHP) front end for this? I mean, as in "hard for me" Wink

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


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

PostPosted: Thu Jun 12, 2008 7:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Quite a bad position to be in, over-aggressive and exposed to the world, so it seems.


Am I missing something here? This is the Center Counter Defence, it's a book line - I looked it up in Modern Chess Openings. White's next move is 3. N-QB3 and then black can choose to retreat the queen or move it to QR4. I like the Bush joke though, peace bro.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20471
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Thu Jun 12, 2008 7:55 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
White's next move is 3. N-QB3


How does that notation work ... b1-c3 I'd think ...


chessboard-005.jpg
 Description:
 Filesize:  81.76 KB
 Viewed:  3672 Time(s)

chessboard-005.jpg



_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20471
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Thu Jun 12, 2008 9:47 am    Post subject: Reply with quote  Mark this post and the followings unread

I could use some better images for a starter Laughing

http://bluehell.electro-music.com/_tests/chess/

Just some java script thingie I found somewhere ...

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Thu Jun 12, 2008 12:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

Oh, no, don't tell me I am going to have to dig out a chess book thinking

I figure a Queen out early wastes moves retreating. I have not studied classic games, too busy! In fact, if anyone wants to take over this game for The Civilized World, be my guest! I suck at chess.

Well, I thought of capturing the tones for the current board configuration and posting the MP3, but I have some noise problems when the machine gets loaded, that may be Max/MSP or may be my Edirol driver. If I do a fresh boot and don't start anything else (like browsers or mail readers or DAWs etc.), it usually lasts a game. This is one reason to try ChucK or SC, to eliminate Max as the cause. Maybe this weekend.

As for the images and the graph lines, the source is not hard to run, if you get Python 2.4.x you can run it in a few minutes. Posted above. The originals are nice looking, but I guess I am squashing my screen dumps too much.

We have to do something about that Queen.

Back to my day job . . .

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


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

PostPosted: Thu Jun 12, 2008 1:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Oh, no, don't tell me I am going to have to dig out a chess book thinking

I figure a Queen out early wastes moves retreating. I have not studied classic games, too busy! In fact, if anyone wants to take over this game for The Civilized World, be my guest! I suck at chess.


Well, you're right on target, that is the main critique of the opening mentioned in MCO. But there are exceptions to rules, and this is one of them. Many a time I've gotten whooped by the center counter opening. By the way, I'm not good at chess either. My OTB rating was just under 1500 which is just average for someone who plays competitively. I played in the kid's section, haha!

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Thu Jun 12, 2008 1:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ah, the original looks fine, couldn't upload a bmp, don't know if this gif looks any better than a jpg. Getting short on file space here..

Here's my moves. Thanks for the URL!
Code:

B01 Scandinavian (centre counter) defence
1.e2e4 d7d5
   B01 Scandinavian defence, Lasker variation
   1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 g8f6 g1f3 c8g4 h2h3
   B01 Scandinavian defence
   1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 g8f6 g1f3 c8f5
      B01 Scandinavian defence, Gruenfeld variation
      1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 g8f6 g1f3 c8f5 f3e5 c7c6 g2g4
   B01 Scandinavian: Anderssen counter-attack
   1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 e7e5
      B01 Scandinavian: Anderssen counter-attack orthodox attack
      1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 e7e5 d4e5 f8b4 c1d2 b8c6 g1f3
      B01 Scandinavian: Anderssen counter-attack, Goteborg system
      1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 e7e5 g1f3
         B01 Scandinavian: Anderssen counter-attack, Collijn variation
         1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 d2d4 e7e5 g1f3 c8g4
   B01 Scandinavian, Mieses-Kotrvc gambit
   1.e2e4 d7d5 e4d5 d8d5 b1c3 d5a5 b2b4
   B01 Scandinavian: Pytel-Wade variation
   1.e2e4 d7d5 e4d5 d8d5 b1c3 d5d6
   B01 Scandinavian defence
   1.e2e4 d7d5 e4d5 g8f6
      B01 Scandinavian: Icelandic gambit
      1.e2e4 d7d5 e4d5 g8f6 c2c4 e7e6
      B01 Scandinavian gambit
      1.e2e4 d7d5 e4d5 g8f6 c2c4 c7c6
      B01 Scandinavian defence
      1.e2e4 d7d5 e4d5 g8f6 d2d4
         B01 Scandinavian: Marshall variation
         1.e2e4 d7d5 e4d5 g8f6 d2d4 f6d5
            B01 Scandinavian: Kiel variation
            1.e2e4 d7d5 e4d5 g8f6 d2d4 f6d5 c2c4 d5b4
         B01 Scandinavian: Richter variation
         1.e2e4 d7d5 e4d5 g8f6 d2d4 g7g6



d5-to-a5.gif
 Description:
 Filesize:  78.79 KB
 Viewed:  104 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

d5-to-a5.gif



_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20471
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Thu Jun 12, 2008 3:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Ah, the original looks fine, couldn't upload a bmp, don't know if this gif looks any better than a jpg. Getting short on file space here..


I meant the small ones with transparency, but I found 'm in your source.

BTW, I see you go into "boss mode" from time to time, you found a job? (I mean you were looking a while ago not?)

When you don't want to go on with the game here that's ok with me, I just could not resist making a first move on seeing the board Wink

Edit: I upped your quota.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Thu Jun 12, 2008 6:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Acoustic Interloper wrote:
Ah, the original looks fine, couldn't upload a bmp, don't know if this gif looks any better than a jpg. Getting short on file space here..


I meant the small ones with transparency, but I found 'm in your source.

Ah, OK. I'm a little brain addled today. My daughter is home from New Mexico for 5 weeks, first time for that long since she went away to college 4 years ago, and we've been staying up past midnight every night, some nights drinking wine, most nights going for walks, playing with dogs, etc. It's nice to be a dad again for a little while.

Quote:
BTW, I see you go into "boss mode" from time to time, you found a job? (I mean you were looking a while ago not?)

I'm still working on the remote programming job I have been doing since I got canned from post-Bell-Labs-Agere at end of '06, but I wanted something more reliable. Most places I tried don't seem interested in the mid-50's crowd, skills or no. I was afraid of getting stranded, jobless in my late 50's. So this autumn I will start teaching computer science at a state university about ten minutes from my house, a heavy 4-course load (3 preparations) but all good courses, and no requirement to pull research grants in. Plus, there's a music prof into electronics and music, and a collaboration is likely. So, I'm juggling my programming current job (Eclipse IDE enhancements for a DSP), music software, course preparations, and my daughter's visit this summer. All fun stuff, I am happy to say.

Thanks for asking. My neighbor is in his 50's, too, with kids also leaving, and we had a talk last month. "It doesn't get any easier, does it?" "No, not for me, either." This forum is a welcome escape from the B.S.
Quote:

When you don't want to go on with the game here that's ok with me, I just could not resist making a first move on seeing the board Wink

Edit: I upped your quota.

I'm glad you couldn't resist. And thanks for the up.

Incidentally, one of the things I'd really like to do when this program gets a little more mature, is allow fully networked play. That would be point-to-point, and presumably would require people opening up some ports in their firewalls. Both the game server and the GUI use XML/RPC server threads, the game server to support multiple GUIs, and the GUI to support events back from the game server, which is how the GUI updates the display. I'd also have to add music generation at both ends.

Beyond that, though, how would I go about streaming out of something like Max/MSP, ChucK or SC to a web stream? For New Year's I just ran Max/MSP out my Edirol DAC, and then looped two cables back into the Edirol ADC and from there to the streaming program. I assume there is an API for doing this without the overhead of going out a DAC and back in an ADC, to get it to the streaming program, but I don't know what that is. Seems silly to have to go digital->analog->digital to send a digital audio stream.

Next steps in this thing for me are sniffing some ChucK OSC packets similar to James' experiment with SC above, and then figuring out why I get bursts of crackly noise out of Max. A few weeks ago I doubled the number of oscillators in Max when I added triangle waves, and when the CPU load went up, the problem appeared. This was when I added triangles. So I halved them again, but kept half as triangles, half as sines. The problem isn't persistent, but it's annoying when it pops up. If ChucK or SC don't exhibit this problem, then it's bye bye, Max/MSP.

The Python program uses very little CPU, although if I were to add real chess search, it would go up. But of course, that's not the point.

One long term research project I have in mind is real-time collaborative musical ensembles over the Internet, where the node-to-node delays on the net get organized and incorporated into the meter. For example, if you play note A-at-time-1 and I play note B-at-time-1, you will hear it as note B-at-time-(1+delay) while you are playing note X-at-time-(1+delay), and I will hear note A-at-time-(1+delay) when I am playing note Y-at-time-(1+delay). Basically, you harmonize with my past and I harmonize with your past (by receiving notes after a delay), but it's also necessary for you to harmonize with my future and me with your future, because we are also sending notes before a delay. We would hear different pieces. Basically, this is more of the quantum-inspired, superpositional score stuff that I have mentioned elsewhere, and it is growing out of the delayed banjo stuff / Minimalist stuff I've been getting into. I don't know how you'd evaluate a performance as an observer, because the actual hearing of the piece is distributed. There is no single performance or audience; there is one at each node.

Maybe next year Smile

Take care

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Thu Jun 12, 2008 7:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Beyond that, though, how would I go about streaming out of something like Max/MSP, ChucK or SC to a web stream? For New Year's I just ran Max/MSP out my Edirol DAC, and then looped two cables back into the Edirol ADC and from there to the streaming program. I assume there is an API for doing this without the overhead of going out a DAC and back in an ADC, to get it to the streaming program, but I don't know what that is. Seems silly to have to go digital->analog->digital to send a digital audio stream.


If all else fails, something like Jack would very likely help.

SC has a module to stream audio to and from MP3 (or ogg) files using curl and lame (or oggdec), and I think I remember seeing once that you could hook that up to a streaming server. Never tried it myself.

Acoustic Interloper wrote:
Next steps in this thing for me are sniffing some ChucK OSC packets similar to James' experiment with SC above, and then figuring out why I get bursts of crackly noise out of Max. ... If ChucK or SC don't exhibit this problem, then it's bye bye, Max/MSP.


I think it's really unlikely to get that kind of behavior from SC.

hjh

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20471
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Fri Jun 13, 2008 3:56 am    Post subject: Reply with quote  Mark this post and the followings unread

dewdrop_world wrote:
If all else fails, something like Jack would very likely help.


For windows there is Virtual Audio Cable, not free though. Some sound cards may have similar support, and I think Max/Msp has such a utility as well?

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Fri Jun 13, 2008 6:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Right, the cycling 74 folks have something called sound flower. But I've heard Jack is more flexible.

But, if supercollider is the audio engine, another option is to broadcast OSC to all registered clients and do the audio rendering locally. I've heard of people doing that for some concerts and/or art installations taking place in two locations at the same time.

Right now I'm holding off on supercollider work for this project until I have a clearer idea how the audio is supposed to work. Structuring it as a bank of synths is not a problem -- they could run continuously or (preferably) switch on and off when needed. I've got another project on my plate anyway, so there's no hurry to come up with any kind of spec, no hurry at all.

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Fri Jun 13, 2008 6:44 am    Post subject: Reply with quote  Mark this post and the followings unread

dewdrop_world wrote:
Right now I'm holding off on supercollider work for this project until I have a clearer idea how the audio is supposed to work. Structuring it as a bank of synths is not a problem -- they could run continuously or (preferably) switch on and off when needed. I've got another project on my plate anyway, so there's no hurry to come up with any kind of spec, no hurry at all.

James

Sounds familiar. It's hard enough when hobby jobs get completely crowded out by day jobs, but when hobby jobs get crowded out by other people's hobby jobs, it really gets tough Razz

I do plan to keep this thing rolling, so I will post as it matures. Also, thanks to Kassen's original post, I am re-reading The Glass Bead Game for the first time in 35 years, and have some things to say about that. But, I am going to wait for that until I finish the book.

Thanks for all the feedback.

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Fri Jun 13, 2008 2:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Played a game using Max/MSP after a fresh boot, no crackly noise problems. So far, so good. I also made some more of the music generation parameters for my Just Intonation plugin tunable at play time. Slowly getting better.

Next, the ChucK OSC example was pretty close to what I needed. Made a few tweaks specific to this patch.

//chess1.ck

// Launch as a sound generator for chessgame.py as of
// 13 June 2008. This OSC type format is patch specific.
// There are 2 banks of ugens with 32 ugens each.
// Bank 0 generates sines and bank 1 triangles in the
// initial test. Incoming OSC fields are:
// bank(i) 0 or 1 for sine or triangle bank respectively
// osc(i) oscillator number 0..31 in that bank
// freq(f) frequency or -1.0 to shut it off
// phase(f) 0.0 .. 1.0 or -1.0 to shut it off (redundant)
// leftampl left channel amplitude 0.0 to 1.0
// rightampl right channel amplitude 0.0 to 1.0
// The amplitudes are 0.0 when freq is -1.0 for shut off.
// The output of all ACTIVE oscillators should be summed and
// normalized so that running many oscillators does not exceed
// some threshold. This entails some scaling.


// create our OSC receiver
OscRecv recv;
// use port 6449 (or whatever)
7401 => recv.port;
// start listening (launch thread)
recv.listen();

// create an address in the receiver, store in new variable
recv.event( "list, i i f f f f" ) @=> OscEvent @ oe;

// infinite event loop
while( true )
{
// wait for event to arrive
oe => now;

// grab the next message from the queue.
while( oe.nextMsg() )
{
int bank, osc ;
float freq, phase, leftampl, rightampl ;

// getFloat fetches the expected float (as indicated by "i f")
oe.getInt() => bank ;
oe.getInt() => osc ;
oe.getFloat() => freq ;
oe.getFloat() => phase ;
oe.getFloat() => leftampl ;
oe.getFloat() => rightampl ;


// print
<<< "got (via OSC):", bank, osc, freq, phase, leftampl, rightampl >>>;
}
}


Here are some print statements from ChucK:

[chuck](VM): sporking incoming shred: 2 (chess1.ck)...
got (via OSC): 0 1 0.000000 0.000000 0.000000 0.000000
got (via OSC): 0 0 247.500000 0.000000 0.375000 0.125000
got (via OSC): 0 0 -1.000000 -1.000000 0.000000 0.000000
got (via OSC): 0 2 0.000000 0.000000 0.000000 0.000000
got (via OSC): 0 1 247.500000 0.000000 0.000000 0.000000
got (via OSC): 0 1 -1.000000 -1.000000 0.000000 0.000000

The above code comments explain the 6 fields. A -1.0 for frequency means, "Shut this oscillator down." You can probably save some resources by getting rid of oscillators that are shut off. I guess I'll find out.

Anyway, Inventor, if you feel like spending a few minutes on this, bank 0 would just select an array of 32 sine ugens, and bank 1 an array of 32 triangle ugens, and the other fields are parameters for those ugens as explained. Then you can take the Python program and try it out. If you are on to other things (as we all are!), I'll probably write this beginner's ChucK code this weekend.

Nothing against SC by the way, James, it's just that I already attended a 3 hour ChucK class at EM2007, so I already have it installed.

Have a good weekend banana

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


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

PostPosted: Fri Jun 13, 2008 5:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

AI, are you kidding? Miss out on a chance to collaborate with my electro-music.com pals? No way!

So I coded up a neatly packaged little chess oscillator file, attached. It has a class that can be reused OOP style, plus examples of the other stuff you need to do like instantiate the class and make function calls. The tones sound really beautiful, I'm sure that following a game will be very nice.

Note that, as you would expect, those amplitudes for all those pieces add up quickly and saturate the audio system. We can just work with low amplitudes or I could modify the class to auto-normalize the volume by itself. Never did that trick but I'd give it a try. Enjoy!


Chess_Osc.ck
 Description:
The chess oscillator class with example usage and sounds

Download
 Filename:  Chess_Osc.ck
 Filesize:  2.31 KB
 Downloaded:  87 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Fri Jun 13, 2008 7:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
AI, are you kidding? Miss out on a chance to collaborate with my electro-music.com pals? No way!

So I coded up a neatly packaged little chess oscillator file, attached. It has a class that can be reused OOP style, plus examples of the other stuff you need to do like instantiate the class and make function calls. The tones sound really beautiful, I'm sure that following a game will be very nice.

Thanks, you beat me to the punch! I've been thinking about what to do next with ChucK, probably encode the piece type as part of the (extended) bank, so I can give a different timbre to each piece. You given me a nice head start Razz

Quote:
Note that, as you would expect, those amplitudes for all those pieces add up quickly and saturate the audio system. We can just work with low amplitudes or I could modify the class to auto-normalize the volume by itself. Never did that trick but I'd give it a try. Enjoy!

Yep, there is a block that auto-normalizes in Max/MSP, so I'll attack that tomorrow unless you get there first. I certainly don't mind, because there is always a next step.

I have to look at what MSP is doing when it 'normalizes,' because it still has fluctuations in amplitude, which of course you want, but the MSP normalizer keeps things from saturating (except in check!). Sounds like a compression algorithm. I also do some scaling in Python based on the number of simultaneous notes sent, but it's been so long since I looked at that part of the code, that I don't remember how it works. I'll have a little studying to do tomorrow.

I think I've figured out the lowest-bandwidth way to do distributed play, which will basically be a server process at each GUI, and just stream the chess events and let the audio generation occur at each local node. One interesting facet of this is that each player's note tempo is partly determined by how fast/slow that player plays, so Internet delay may make my tempo slower at a remote site than at my own (and vice versa). Also, the current musical plugin makes some 'virtual moves' on a virtual board cloned from the real one after so many seconds elapsed with no player moves, so again, if a remote machine gets my move late, it may be ahead in virtual moves. A real move eliminates any current virtual board, so things do sync up, but basically, with distributed music generators, the two playing sites may hear two somewhat different pieces, depending on network delay. That will especially be true if we extend the instrument banks, and if each site populates the banks with different instruments. Relativistic music. I like that.

Have a good night!

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Sat Jun 14, 2008 5:10 am    Post subject: Reply with quote  Mark this post and the followings unread

It appears normalization is just a matter of computing the sum of all amplitudes for each channel separately, and then scaling each component back by dividing by the sum of the respective channel only when the channel sum exceeds 1.0. I don't know how 1.0 works for gain in ChucK yet, but this normalized range of 0.0..1.0 may have to be finally scaled for use as a ChucK gain. I guess I'll know soon. Smile I use two normalize~ transforms in Max, one for each channel.

MSP's docs for the normalize~ transform says the following
Quote:
normalize~ performs real-time normalization of its input by multiplying each input sample value by a scalaing factor -- computed as the maximum output value (sent either a s a signal or a float in the right inlet (i.e., first parameter)) over the maximum signal input value received thus far. You can change the maximum input value with the reset message or with a float in the left input. If no arguments follow "reset" the new maximum input value (and the initial maximum input value) is 0.000001."

My Max patch initializes the latched ceiling to 1.0.

Shouldn't be hard.

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 7:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Nothing against SC by the way, James, it's just that I already attended a 3 hour ChucK class at EM2007, so I already have it installed.


No problem, I'm all for using whatever is at hand and fits the job.

I get the feeling that SC will be left out of the party if I don't whip something up soon... Razz The current OSC protocol looks pretty simple though, shouldn't be hard to pull a couple of stock synthdefs together.

SC also has a normalizer, but I don't like it because it tries to raise very low-level signals to the desired amplitude, making very noisy output. The Limiter UGen is better in SC - it never amplifies the signal, only reduces when the amp goes above the specified limit.

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Sat Jun 14, 2008 9:26 am    Post subject: Reply with quote  Mark this post and the followings unread

I added limiting this morning, similar to what you suggest. It only scales amplitudes back when the signal sum exceeds 1.0. It never boosts.

The amplitude is low but this did not help the problem. In Max/MSP I am using an envelope to ramp the changes in gain over a 100 msec interval, so you don't get instantaneous changes when switching oscillators on and off. As I recall, I needed to do that to avoid the problem of generating this crackly noise. I still occasionally hear vestiges of it in Max/MSP.

I tried ramping the gain changes in ChucK using its Envelope ugen, but the output of the Envelope never leaves 0.0. I've been on it all morning, just posted a plea for help here. I imagine there is a simple way to do it.

I also noticed that Max/MSP in the mix keeps the CPU around 50% busy, while ChucK is running around 66% and occasionally 80%. 80% would be trouble for Max, as well; I had to get rid of some unnecessary oscillators to bring Max back down, which was some cause for concern to me -- they were not generating anything (amplitude at 0.0), but they were eating CPU nevertheless.

I don't think 66% CPU is the main problem. It seems like the gain changes are too fast. We'll see how hard this is to fix. It's a test for ChucK. SC's sound engine may win my heart after all.

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 9:35 am    Post subject: Reply with quote  Mark this post and the followings unread

I just can't resist a good distraction... here's a very early prototype of how to handle the OSC in supercollider. I haven't hooked it up to the Python program yet, but I tested it with some of the sample messages AI posted before and it's doing what it should.

There is plenty of room to map in other synthdefs. Also I included hooks so that a GUI could show the current audio state -- the hooks are empty right now.

Something we haven't talked about so far is timing. Since the packets go through a network protocol, jitter is unavoidable. I'd suggest something like this:

- start running the audio program first
- then, when the Python program initializes, it sends a message with a base time value -- the audio program would remember this value and use it later
- each oscillator message coming from Python should have a time value as either a float or double (so that events could be quantized)
- with that information, the audio program knows not only when the message was received (which may not be precise) but also the intended timing from Python

The OSC protocol allows messages to be timestamped, which would be a reasonable way to go -- supercollider receives the message's timestamp in the OSCresponder function's "time" argument. But it should also be okay to send the time value as one of the numbers within the message.

James

EDIT: Deleted bad attachment - see below for replacement

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net

Last edited by dewdrop_world on Sat Jun 14, 2008 11:51 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 9:43 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
It seems like the gain changes are too fast.


Are these gain changes coming in from OSC? I was assuming an OSC message for oscillator-on and another for oscillator-off -- are you also changing parameters in the middle of an on-off cycle?

My code removes UGens from the server when not needed, so cpu use will be low unless activity is high.

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 1634
Location: Berks County, PA
Audio files: 35

PostPosted: Sat Jun 14, 2008 10:50 am    Post subject: Reply with quote  Mark this post and the followings unread

I downloaded PsyCollider on Windows XP and tried to run your example, but nothing happens. The server says it is Running and the volume is up, and when I type ctrl-Return at the end of the "r.next;" line, a nill prints on the Post Window, but no sound comes out.

Also, how do you set which audio IO to use. It should be working with the one it selected, but I don't see where I could change that.

Thanks.

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 11:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
I downloaded PsyCollider on Windows XP and tried to run your example, but nothing happens. The server says it is Running and the volume is up, and when I type ctrl-Return at the end of the "r.next;" line, a nill prints on the Post Window, but no sound comes out.


You need to run the bits before r.next, which load the messages into an array, create a NetAddr for sending the message, and create the Routine. And "r.next" should return 1 (which comes from the 1.yield line).

That's why the "// test code" comment comes several lines before r.next Smile

Code:
// test code -- START HERE for the test
m = #[
   [\list, 0, 0, 247.500000, 0.000000, 0.375000, 0.125000],
   [\list, 0, 0, -1.000000, -1.000000, 0.000000, 0.000000],
   [\list, 1, 1, 247.500000, 0.000000, 0.125000, 0.375000],
   [\list, 1, 1, -1.000000, -1.000000, 0.000000, 0.000000]
];

n = NetAddr("127.0.0.1", NetAddr.langPort);

r = Routine {
   m.do { |msg|
      n.sendMsg(*msg);
      1.yield;
   }
};

// each time you run this line, one of the test messages will be processed
r.next;


Acoustic Interloper wrote:
Also, how do you set which audio IO to use. It should be working with the one it selected, but I don't see where I could change that.


That's done by the server's options object:

s.options.device = "[name of your device]";

Then (re)start the audio server.
James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 11:50 am    Post subject: Reply with quote  Mark this post and the followings unread

And I found a couple of other mistakes... corrected here.

James


chess-music.txt
 Description:

Download
 Filename:  chess-music.txt
 Filesize:  2.75 KB
 Downloaded:  74 Time(s)


_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 14, 2008 3:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

My turn to ask a basic question...

Code:
dewdrops-computer:~/Downloads/chess/chess dewdrop$ python
Python 2.4.4 (#1, Oct 18 2006, 10:34:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from chess.chessgame import *
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named chess.chessgame


Mmm? OK then, let's try:

Code:
>>> from chessgame import *
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "chessgame.py", line 58, in ?
    from chess.interpreter import interpreter, ifactory
ImportError: No module named chess.interpreter


Oh... I see, the readme says to cd to chess/chess, but really it should be one directory higher...

Listening from ipaddr = 192.168.0.111, ipport = 4000

Cool

Never mind...
James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic Moderators: elektro80
Page 3 of 7 [155 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Discussion » Composition
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