electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
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 
Coming up on Radio 1 at
Twyndyllyngs live on Chez Mosc
 
 Forum index » DIY Hardware and Software » ChucK programming language
newbie questions about keyboard-organ.ck
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [7 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
octavius



Joined: Oct 19, 2008
Posts: 4
Location: seattle

PostPosted: Sun Oct 19, 2008 9:56 am    Post subject: newbie questions about keyboard-organ.ck Reply with quote  Mark this post and the followings unread

Hi,

Firs time poster. I'm new to electronic music and after checking out csound and chuck I've started digging around some of the sample code. Chuck looks pretty cool.

I've been looking at the keyboard-organ sample and have a couple of questions about it. I learn new languages best by trying to change samples to make them do what I'd like. So... here are a couple of questions:

1. can I prevent this example from needing to output the keys that I press while playing the organ? whether I'm doing this in a command shell, or in miniAudicle, the keys I press are sent to standard output... so it appears. (i'm using the windows version)

2. when I press a key while another is still pressed, it appears that the sound from the first key stops... at least that is how it sounds to me... maybe my untrained ear just can't hear the first key anymore... how could I modify this code to allow the sound from the first key to continue through the second key? that would make this more like a true organ.

3. does chuck support file IO? i think it would be pretty cool to modify the organ to save the keys to a .ck file, that could then be sent to chuck and chuck would replay the keys.

If I can get these changes working, I'll post my code.

Thanks!
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 Oct 19, 2008 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Welcome on board!

1) I'm not sure I understand this issue. In what ways are the keys being send to output? Are you sure you weren't accidentally also running something else at the same time? I'm looking at the code for keyboard organ right now and it should only affect the pitch of the sound, not output in some other way.

2)Yes, that's right. This example only uses one pitch at a time as there is only one sound-source. If you want more "voices" (a voice means a sound-source, with more "voices" you'll have more at a time, like a choir) you will need to write some infrastructure for it. There is a good example on this in /examples/midi/polyphonic.ck See if you can follow that (this might be hard if you don't use midi). I could write it for you but I feel it would be more educational if you'd try on your own first. Shout if this is beyond you now; it's hard to estimate the level of knowledge in people you just meet. I (or somebody else) will help you if this makes no sense to you at the moment.

3) Not yet... but it's in the works. Word on the street has it that a early version of file I/O will be in the next update.

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



Joined: Oct 19, 2008
Posts: 4
Location: seattle

PostPosted: Sun Oct 19, 2008 6:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks!

Regarding #1:
I'm not running anything else that I'm aware of, unless it is some background Windows thing, but I don't notice this behavior in anything else. I notice the kb.ck has the same behavior... after I exit the program (ctrl-c) all of the keys that I pressed while it was running are then sent to the shell.

Regarding #2:
I'll take a look at that other code. I don't use MIDI yet but I'll see if I can figure it out. Just knowing that it is possible gives me the extra motivation to see what I can figure out.

Regards
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 Oct 19, 2008 7:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

1) Oh, wait, yes. That's a known problem and is indeed a bug. I had a bit of trouble understanding exactly what you meant and thought you were seeing characters *while* the example was running.

2)Yes, completely possible. Basically anything that can be done in digital sound generation is possible, as long as you know exactly what you want. That doesn't mean it's all easy, of course... This one would probably be a little more advanced as a first project but far from impossible; actually quite a few people have started ChucKing by taking on a project that looked a bit harder at first. Just jump in at the deep and; I guarantee you we won't let your drown :¬).

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



Joined: Oct 19, 2008
Posts: 4
Location: seattle

PostPosted: Sun Oct 19, 2008 9:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

So, for #1, is there a simple code change I could make to prevent the characters from spitting back?

BTW, in the command line version, the come out when I quit (ctrl-c). In the MA version, they appear right away, and get inserted into the code, wherever the cursor happens to be when I invoke it.

Thanks again
Back to top
View user's profile Send private message
rogan



Joined: Dec 16, 2007
Posts: 83
Location: Urbana, IL
Audio files: 5

PostPosted: Mon Oct 20, 2008 6:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

This is a lame workaround, but in MA, I usually type into a new, blank document.
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 Oct 21, 2008 3:26 am    Post subject: Reply with quote  Mark this post and the followings unread

octavius wrote:

BTW, in the command line version, the come out when I quit (ctrl-c).


Yes, and that's a bug, I think, it has to do with the incorrect flushing of buffers, or so I seem to remember.

Quote:
In the MA version, they appear right away, and get inserted into the code, wherever the cursor happens to be when I invoke it.


I think that in you'd start the mini from the prompt you'd get them back at the prompt as well, after quitting. That you get characters to appear when you type, however, is not a bug, this is correct behaviour and can actually be useful though it can indeed lead to confusion and mistakes. I sometimes like to start livecoding sessions by writing code that will make my keyboard presses make sounds, then use that while typing up other things.

_________________
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 1 [7 Posts]
View unread posts
View new posts in the last week
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
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org