Defines | Functions

/Users/garethloy/Musimathics/Musimat1.2/MusimatTutorial/MusimatTutorial.h File Reference

#include "Musimat.h"
#include "Pitches.h"

Go to the source code of this file.

Defines

#define MusimatTutorialSection(x)   void x()

Functions

void B0100 ()
void B0101 ()
void B0102 ()
void B0103 ()
void B0104 ()
void B0105 ()
void B0106 ()
void B0107 ()
void B0108 ()
void B0109 ()
void B0110 ()
void B0111 ()
void B0112 ()
void B0113 ()
void B0114 ()
void B0115 ()
void B0116 ()
void B0117 ()
void B0118 ()
void B0119 ()
void B0120 ()
void B0121 ()
void B0122 ()
void B0123 ()
void B0124 ()
void B0125 ()
void B0126 ()
void B0127 ()
void B0128 ()
void B0129 ()
void B0200 ()
void B0201 ()
void B0201a ()
void B0201b ()
void B0201c ()
void B0201d ()
void B0202 ()
void B0203 ()
void B0204 ()
void B0300 ()
void B0400 ()
void testEuclid ()
Real pitchToHz (Pitch, Real, RealList)

Define Documentation

#define MusimatTutorialSection (   x )    void x()

Definition at line 71 of file MusimatTutorial.h.


Function Documentation

void B0100 (  )
void B0101 (  )
void B0102 (  )
void B0103 (  )
void B0104 (  )
void B0105 (  )
void B0106 (  )
void B0107 (  )
void B0108 (  )
void B0109 (  )
void B0110 (  )
void B0111 (  )
void B0112 (  )
void B0113 (  )
void B0114 (  )
void B0115 (  )
void B0116 (  )
void B0117 (  )
void B0118 (  )
void B0119 (  )
void B0120 (  )
void B0121 (  )
void B0122 (  )
void B0123 (  )
void B0124 (  )
void B0125 (  )
void B0126 (  )
void B0127 (  )
void B0128 (  )
void B0129 (  )
void B0200 (  )
void B0201 (  )
void B0201a (  )
void B0201b (  )
void B0201c (  )
void B0201d (  )
void B0202 (  )
void B0203 (  )
void B0204 (  )
void B0300 (  )
void B0400 (  )
Real pitchToHz ( Pitch  ,
Real  ,
RealList   
)

Definition at line 40 of file B0201b.cpp.

References key().

                             {
        Integer key = PitchClass(p) + Accidental(p);    // get key from pitch
        Real oct = Octave(p);                                                   // get octave from pitch
        Return(refC * scale[key] * Pow(2.0, (oct - 4)));// compute frequency
}  
void testEuclid (  )

Definition at line 28 of file B0119.cpp.

References euclid(), and x.

                  {
        /*****************************************************************************
         The function euclid() is declared to be of type Integer because it will return an Integer result. 
         
         Note that Return(n) has been substituted for the Halt(n) function shown previously. Instead 
         of halting execution altogether, the Return(n) statement only exits the current function, carrying 
         with it the value of its argument back to the context that invoked it. The program can then continue 
         executing from there, if there are statements following its invocation. Here's an example of invok-
         ing the euclid() function:
         *****************************************************************************/                                                                                 
        
        Integer x = euclid(91, 416);
        Print(x);
        
        /*****************************************************************************
         which will print 13. If we had used Halt() in euclid(), we'd never reach the Print statement 
         because the program would stop.
         
         Here's another way to compute the same thing:
         *****************************************************************************/
        
        Print(euclid(91, 416));
        
        /*****************************************************************************
         This way we can eliminate the "middleman" variable x, which only existed to carry the value from 
         the euclid() function to the Print() function. In this example, the call to the euclid() func-
         tion is nested within the Print() function. Musimat invokes the nested function first, and the 
         value that euclid() returns is supplied automatically as an argument to the enclosing function, 
         Print(). Functions can be nested to an arbitrary extent. The most deeply nested function is 
         always called first.
         
         *****************************************************************************/
}