Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 1954 additions and 0 deletions
This diff is collapsed.
This diff is collapsed.
//
// SigTools.cpp
//
//
// Created by James on 08/01/17.
//
//
#include "SigTools.hpp"
double MTOF ( unsigned char midi ) {
return pow( 2, static_cast< double >( midi-69 ) / 12.0 ) * 440.0;
}
double FTOM ( double freq ) {
return 12.0 * log2( freq / 440.0 ) + 69;
}
//
// SigTools.hpp
//
//
// Created by James on 08/01/17.
//
//
#ifndef SigTools_hpp
#define SigTools_hpp
#include <stdio.h>
#include <math.h>
double MTOF ( unsigned char midi );
double FTOM ( double freq );
#endif /* SigTools_hpp */
//
// Spinlock.h
// beladrum
//
// Created by James on 11/05/17.
// Copyright © 2017 HKU. All rights reserved.
//
#ifndef Spinlock_h
#define Spinlock_h
#include <atomic>
class Spinlock {
std::atomic_flag locked = ATOMIC_FLAG_INIT ;
public:
void lock ( void ) {
while (locked.test_and_set(std::memory_order_acquire)) { ; }
}
void unlock ( void ) {
locked.clear(std::memory_order_release);
}
};
#endif /* Spinlock_h */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "ofApp.h"
#include "ofAppGlutWindow.h"
//========================================================================
int main( ){
ofAppGlutWindow window;
ofSetupOpenGL( &window, 1024, 768, OF_WINDOW ); // <-------- setup the GL context
ofRunApp( new ofApp( ) );
}
This diff is collapsed.
This diff is collapsed.
File added
File added
File added
File added
File added
File added