Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3276966
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:19:05+00:00 2026-05-17T19:19:05+00:00

Good day good-looking computer people, I might be asking a bit too much, but

  • 0

Good day good-looking computer people,

I might be asking a bit too much, but here it goes.

I’m trying to do a bit of reserve engineering on this sound library. Looking at the main.cpp file (which I have posted below) it has two methods, setup and play. I’m a bit confused as to how this is working:

  1. When you run the Xcode project, shouldn’t there be a main function that is the first method called? I don’t see that here.

  2. The play function is being called (because I hear music), but it must be from elsewhere since in needs the argument output. Where could it be being called from?

To try to be a bit more specific, this is my question:

  1. If the program isn’t starting from a main method in the main.cpp file, where else could it be starting from ?

#include "maximilian.h"

double outputs[2],moreoutputs[2]; //some track outputs
double filtered, ramped, filtered2; 
osc buffertest,ramp;
mix mymix,bobbins;//some panning busses
double env[4]={200,0,0,50};//the kick drum pitch envelope data
double env2[6]={10000,0,9000,5,0,5};//the hi hat pitch envelope dat
envelope b,f;//two envelopers
sample beats;


extern int channels=2;//stereo-must be supported by hardware
extern int buffersize=256;//should be fine for most things
extern int samplerate=44100;//SR must be supported by card. It's always the default

void setup() {//some inits
    b.amplitude=env[0];//starting value for envelope b
    f.amplitude=env2[0];//same for f
    beats.load("/Users/ericbrotto/Desktop/beats.wav");//put a path to a soundfile here.           Wav format only.
    printf("Summary:\n%s", beats.getSummary());//get info on samples if you like
 }

 void play(double *output) {//this is where the magic happens. Very slow magic.
    filtered2=beats.play(1*(1./34), 0, beats.length()); 
    bobbins.stereo(filtered2, moreoutputs, 0.5);//invert the pan
    output[0]=outputs[0]+moreoutputs[0];//stick it in the out!!
    output[1]=outputs[1]+moreoutputs[1];
 }

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:19:06+00:00Added an answer on May 17, 2026 at 7:19 pm

    If the program isn’t starting from a
    main method in the main.cpp file,
    where else could it be starting from ?

    From a main method in a different source file or pre-compiled library, probably, or definitely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, We just converted our web application .NET 1.1 to .NET 2.0. We
Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to
Good day, In visual studio 2005, when I drop a webcontrol in the designer,
I've spent a good part of the day searching, writing and finally scrapping a
Good morning, I am about to start writing an Excel add-in for Excel 2002.
Good morgning, I would like to be able to analyze text where I am
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good morning. I have an XML file which contains lists of warning and errors
Good evening I've got a little problem with my DataGridView in a .NET Windows
Good morning, I am the developer of a medium sized PDA application that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.