Thread: Scripts Writing Scripts

  1. #1
    Registered User Fauveboy's Avatar
    Join Date
    Apr 2014
    Posts
    42

    Scripts Writing Scripts

    Hi

    I've been learning to write music with Csound and C programming languages. During a performance I would need to launch a Csound script to play a selection of sounds. Each new script will be of similar design as the previous except I would need it be able to have access to a new collection of sound to perform the next song. Can scripts be designed which can be launched to "rewrite" text within a script in this case audio file names?
    I was basically wondering what sort of concepts/methods exist for what Im trying to achieve here.

    Thank you for reading

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Fauveboy View Post
    I was basically wondering what sort of concepts/methods exist for what Im trying to achieve here.
    The answer is correct programming techniques. Having code rewrite itself is a real bizarre way to accomplish anything.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    596
    I looked up Csound, as I'm not familiar with it, but am also interested in computer based composing.
    Csound 6 may have something that will do what you want:

    "The orchestra can be re-compiled at any time, or individual instruments can be compiled at any time,
    during a running performance. This enables true "live coding" in Csound performances."

    That is from here:

    Csound - Wikipedia, the free encyclopedia

    What type of music are you performing?

    -

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    1,658
    For dos / windows batch files, you can use the echo command with redirected output to create a text file. Echo should work with parameters (%1, %2), which would be on the command line with the batch file that includes the echo command. The batch files also have a for loop command sequence which can be used to iterate through a range of numbers or a list of file names (create a list of files with special names in the same directory as needed). Beyond this, you'll probably need to create a program to generate scripts.

  5. #5
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Having code rewrite itself is a real bizarre way to accomplish anything.
    O_o

    Also nightmarish to debug.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  6. #6
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    Rather than trying to generate a new script to launch csound, you could run csound in such a way that it can accept events from your generating program in realtime. One possibility is the realtime MIDI input interface. Take a look here

    Command-line Flags (by Category)

    I've never tried this, but from reading that section it looks like it is designed to accept MIDI events in realtime and then output them using csound. This might be a different approach to accomplish your goal.

  7. #7
    Registered User Fauveboy's Avatar
    Join Date
    Apr 2014
    Posts
    42
    its this kinda of stuff https://soundcloud.com/fauveboyxuuki a lot of predesigned audio Im then manipulating during a performance or recording

    So i think from what I can see of the command line flags its along the concept I've been introduced of using an API which from what I understand is an 'application' thats taking a instance of Csound and Im guessing
    one could give Csound messages to switch to different functions/scripts and therefore in this case new sounds/songs...Im hoping this can still be done through the terminal...Rather than MIDI I need to use OSC as the digital interface Im using provides serial data thats interpreted into OSC messages
    Last edited by Fauveboy; 06-03-2014 at 08:30 AM.

  8. #8
    Registered User Fauveboy's Avatar
    Join Date
    Apr 2014
    Posts
    42
    Thank you for your replies. I just wanted to mention when rcgldr mentioned what windows does which was interesting and I think begins to fall in line with the concept if using an API perhaps? However I hoping to get this to work on the Raspberry Pi/Raspien OS and Im becoming aware that one of the aethetics I like of a nice script is alot of the designs can run on any OS.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling other scripts
    By dciampa in forum C Programming
    Replies: 2
    Last Post: 11-15-2012, 02:01 AM
  2. Linker scripts
    By sabapathin in forum Tech Board
    Replies: 2
    Last Post: 05-17-2011, 05:09 PM
  3. about cgi scripts
    By xixpsychoxix in forum Networking/Device Communication
    Replies: 11
    Last Post: 07-08-2008, 06:03 PM
  4. C++ for CGI scripts
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-03-2003, 10:53 AM
  5. CGI scripts in c/c++ ?
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-14-2001, 01:24 PM