mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-04 16:51:37 -05:00
Merge branch 'master' into master
This commit is contained in:
commit
da8c6286fb
23 changed files with 153 additions and 32 deletions
42
meson.build
Normal file
42
meson.build
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
project( 'openav_luppp', ['c','cpp'],
|
||||||
|
default_options : [
|
||||||
|
'cpp_std=c++11',
|
||||||
|
])
|
||||||
|
|
||||||
|
conf_data = configuration_data()
|
||||||
|
conf_data.set('version', '1.1.1')
|
||||||
|
|
||||||
|
|
||||||
|
if(get_option('tests') == true)
|
||||||
|
add_project_arguments('-DBUILD_TESTS', language : 'cpp')
|
||||||
|
endif
|
||||||
|
|
||||||
|
add_project_arguments('-Wno-unused-variable', language : 'cpp')
|
||||||
|
add_project_arguments('-Wno-reorder', language : 'cpp')
|
||||||
|
add_project_arguments('-Wno-sign-compare', language : 'cpp')
|
||||||
|
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
|
cpp = meson.get_compiler('cpp')
|
||||||
|
|
||||||
|
luppp_src = []
|
||||||
|
subdir('src')
|
||||||
|
|
||||||
|
|
||||||
|
dep_names = [
|
||||||
|
'ntk',
|
||||||
|
'cairo',
|
||||||
|
'liblo',
|
||||||
|
'jack',
|
||||||
|
'sndfile',
|
||||||
|
'samplerate',
|
||||||
|
'x11'
|
||||||
|
]
|
||||||
|
deps = []
|
||||||
|
|
||||||
|
foreach dep : dep_names
|
||||||
|
deps += dependency(dep)
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
# compile the main project
|
||||||
|
executable('luppp', luppp_src + [version_hxx],
|
||||||
|
dependencies: deps)
|
1
meson_options.txt
Normal file
1
meson_options.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
option('tests', type : 'boolean', value : true, description : 'Build tests')
|
|
@ -76,7 +76,7 @@ public:
|
||||||
clips[5].state = UnitState::UNIT_STOPPING;
|
clips[5].state = UnitState::UNIT_STOPPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const int numClips = 10;
|
static const int numClips = NSCENES;
|
||||||
UnitState clips[numClips];
|
UnitState clips[numClips];
|
||||||
|
|
||||||
bool mouseOver;
|
bool mouseOver;
|
||||||
|
|
|
@ -47,7 +47,7 @@ ClipSelector::ClipSelector( int _x, int _y, int _w, int _h,
|
||||||
_master = master;
|
_master = master;
|
||||||
|
|
||||||
if ( _master ) {
|
if ( _master ) {
|
||||||
for(int i = 0; i < numClips; i++ ) {
|
for(int i = 0; i < NSCENES; i++ ) {
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << "Scene " << i + 1;
|
s << "Scene " << i + 1;
|
||||||
clips[i].setName( s.str() );
|
clips[i].setName( s.str() );
|
||||||
|
|
|
@ -97,8 +97,7 @@ public:
|
||||||
|
|
||||||
int ID;
|
int ID;
|
||||||
|
|
||||||
// FIXME: NSCENES?
|
static const int numClips = NSCENES;
|
||||||
static const int numClips = 11;
|
|
||||||
ClipState clips[numClips];
|
ClipState clips[numClips];
|
||||||
|
|
||||||
/// indicates if a clip is the "special" clip
|
/// indicates if a clip is the "special" clip
|
||||||
|
|
1
src/avtk/meson.build
Normal file
1
src/avtk/meson.build
Normal file
|
@ -0,0 +1 @@
|
||||||
|
luppp_src += files( 'bindings.cxx', 'volume.cxx', 'clipselector.cxx')
|
1
src/cjson/meson.build
Normal file
1
src/cjson/meson.build
Normal file
|
@ -0,0 +1 @@
|
||||||
|
luppp_src += files('cJSON.c')
|
|
@ -51,6 +51,10 @@
|
||||||
#define NSCENES 10
|
#define NSCENES 10
|
||||||
#define MAX_BUFFER_SIZE 1024
|
#define MAX_BUFFER_SIZE 1024
|
||||||
|
|
||||||
|
/// TEMPO
|
||||||
|
#define MIN_TEMPO 60
|
||||||
|
#define MAX_TEMPO 220
|
||||||
|
|
||||||
#define CONTROLLERS_PREALLOC 20
|
#define CONTROLLERS_PREALLOC 20
|
||||||
|
|
||||||
// nsamples remaining during recording before Looper requests larger buffer
|
// nsamples remaining during recording before Looper requests larger buffer
|
||||||
|
|
|
@ -547,7 +547,7 @@ void GenericMIDI::midi(unsigned char* midi)
|
||||||
break;
|
break;
|
||||||
case Event::TIME_BPM:
|
case Event::TIME_BPM:
|
||||||
// FIXME: quick-fix for "ZeroOne" type value -> BPM range
|
// FIXME: quick-fix for "ZeroOne" type value -> BPM range
|
||||||
jack->getLogic()->setBpm( value * 160 + 60 );
|
jack->getLogic()->setBpm( value * (MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO );
|
||||||
break;
|
break;
|
||||||
case Event::METRONOME_ACTIVE:
|
case Event::METRONOME_ACTIVE:
|
||||||
jack->getLogic()->metronomeEnable( b->active );
|
jack->getLogic()->metronomeEnable( b->active );
|
||||||
|
|
6
src/controller/meson.build
Normal file
6
src/controller/meson.build
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
luppp_src += files(
|
||||||
|
'controller.cxx',
|
||||||
|
'genericmidi.cxx',
|
||||||
|
'guicontroller.cxx',
|
||||||
|
'nonseq.cxx'
|
||||||
|
)
|
1
src/dsp/meson.build
Normal file
1
src/dsp/meson.build
Normal file
|
@ -0,0 +1 @@
|
||||||
|
luppp_src += files('dsp_sidechain_gain.cxx')
|
|
@ -23,7 +23,7 @@
|
||||||
static void gmastertrack_tempoDial_callback(Fl_Widget *w, void *data)
|
static void gmastertrack_tempoDial_callback(Fl_Widget *w, void *data)
|
||||||
{
|
{
|
||||||
Avtk::Dial* b = (Avtk::Dial*)w;
|
Avtk::Dial* b = (Avtk::Dial*)w;
|
||||||
float bpm = (int)(b->value() * 160.f + 60);
|
float bpm = (int)(b->value() * (float)(MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO);
|
||||||
if(std::fabs(bpm-round(bpm))) {
|
if(std::fabs(bpm-round(bpm))) {
|
||||||
LUPPP_WARN("%f",bpm);
|
LUPPP_WARN("%f",bpm);
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,20 @@ static void gmastertrack_button_callback(Fl_Widget *w, void *data)
|
||||||
|
|
||||||
|
|
||||||
} else if ( strcmp( w->label(), "Tap" ) == 0 ) {
|
} else if ( strcmp( w->label(), "Tap" ) == 0 ) {
|
||||||
EventTimeTempoTap e;
|
if ( Fl::event_button() == FL_RIGHT_MOUSE ) {
|
||||||
writeToDspRingbuffer( &e );
|
const char* answer = fl_input("Enter BPM value (range %d and %d):", 0, MIN_TEMPO, MAX_TEMPO);
|
||||||
|
if(answer) {
|
||||||
|
int bpm = atoi(answer);
|
||||||
|
|
||||||
|
if ( bpm >= MIN_TEMPO && bpm <= MAX_TEMPO) {
|
||||||
|
EventTimeBPM e = EventTimeBPM( bpm );
|
||||||
|
writeToDspRingbuffer( &e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EventTimeTempoTap e;
|
||||||
|
writeToDspRingbuffer( &e );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("Error: unknown command string");
|
LUPPP_WARN("Error: unknown command string");
|
||||||
}
|
}
|
||||||
|
@ -260,7 +272,7 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
|
||||||
void GMasterTrack::setBpm( int b )
|
void GMasterTrack::setBpm( int b )
|
||||||
{
|
{
|
||||||
bpm = b;
|
bpm = b;
|
||||||
tempoDial.value( ( bpm - 60 ) / 160.f );
|
tempoDial.value( ( bpm - MIN_TEMPO ) / (float)(MAX_TEMPO - MIN_TEMPO) );
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << bpm;
|
s << bpm;
|
||||||
tempoDial.copy_label( s.str().c_str() );
|
tempoDial.copy_label( s.str().c_str() );
|
||||||
|
|
12
src/gui.cxx
12
src/gui.cxx
|
@ -880,7 +880,17 @@ int Gui::keyboardHandler(int event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// keyboard arrows to special key mapping
|
// keyboard arrows / space to special key mapping
|
||||||
|
if ( Fl::event_key( 32 ) && Fl::event_state( FL_SHIFT ) ) { //spacebar + shift
|
||||||
|
EventGridState e( gui->specialTrack, gui->specialScene, GridLogic::STATE_EMPTY );
|
||||||
|
writeToDspRingbuffer( &e );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( Fl::event_key( 32 ) ) { //spacebar
|
||||||
|
EventGridEvent e( gui->specialTrack, gui->specialScene, true );
|
||||||
|
writeToDspRingbuffer( &e );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if ( Fl::event_key( FL_Left ) ) {
|
if ( Fl::event_key( FL_Left ) ) {
|
||||||
EventGridSelectNewChosen e( gui->specialTrack-1, gui->specialScene );
|
EventGridSelectNewChosen e( gui->specialTrack-1, gui->specialScene );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
|
|
@ -36,10 +36,12 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
||||||
|
|
||||||
//Process previous AudioProcessor
|
//Process previous AudioProcessor
|
||||||
m_previousProcessor->process(nframes,buffers);
|
m_previousProcessor->process(nframes,buffers);
|
||||||
float* sendL=(float*)jack_port_get_buffer(m_sendport_l,(jack_nframes_t)(buffers->nframes));
|
|
||||||
float* sendR=(float*)jack_port_get_buffer(m_sendport_r,(jack_nframes_t)(buffers->nframes));
|
float* sendL=(float*)jack_port_get_buffer(m_sendport_l, (jack_nframes_t)(buffers->nframes));
|
||||||
float* retL=(float*)jack_port_get_buffer(m_returnport_l,(jack_nframes_t)(buffers->nframes));
|
float* sendR=(float*)jack_port_get_buffer(m_sendport_r, (jack_nframes_t)(buffers->nframes));
|
||||||
float* retR=(float*)jack_port_get_buffer(m_returnport_r,(jack_nframes_t)(buffers->nframes));
|
float* retL =(float*)jack_port_get_buffer(m_returnport_l,(jack_nframes_t)(buffers->nframes));
|
||||||
|
float* retR =(float*)jack_port_get_buffer(m_returnport_r,(jack_nframes_t)(buffers->nframes));
|
||||||
|
|
||||||
if(offset) {
|
if(offset) {
|
||||||
sendL+=offset;
|
sendL+=offset;
|
||||||
sendR+=offset;
|
sendR+=offset;
|
||||||
|
@ -50,11 +52,7 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
||||||
for(int i=0; i<nframes; i++) {
|
for(int i=0; i<nframes; i++) {
|
||||||
sendL[i]=m_sendvol*sendtrackL[i];
|
sendL[i]=m_sendvol*sendtrackL[i];
|
||||||
sendR[i]=m_sendvol*sendtrackR[i];
|
sendR[i]=m_sendvol*sendtrackR[i];
|
||||||
}
|
}
|
||||||
// if(nframes!=buffers->nframes)
|
|
||||||
// {
|
|
||||||
// cout<<send<<endl;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(offset)
|
if(offset)
|
||||||
assert(offset+nframes==buffers->nframes);
|
assert(offset+nframes==buffers->nframes);
|
||||||
|
@ -62,13 +60,11 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
||||||
if(m_active) {
|
if(m_active) {
|
||||||
memcpy(rettrackL,retL,nframes*sizeof(float));
|
memcpy(rettrackL,retL,nframes*sizeof(float));
|
||||||
memcpy(rettrackR,retR,nframes*sizeof(float));
|
memcpy(rettrackR,retR,nframes*sizeof(float));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
memcpy(rettrackL,
|
memcpy(rettrackL, sendtrackL,nframes*sizeof(float));
|
||||||
sendtrackL,nframes*sizeof(float));
|
memcpy(rettrackR, sendtrackR,nframes*sizeof(float));
|
||||||
memcpy(rettrackR,
|
}
|
||||||
sendtrackR,nframes*sizeof(float));
|
|
||||||
}
|
|
||||||
m_counter+=nframes;
|
m_counter+=nframes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ Looper::Looper(int t) :
|
||||||
//tmpRecordBuffer = (float*)malloc( sizeof(float) * MAX_BUFFER_SIZE );
|
//tmpRecordBuffer = (float*)malloc( sizeof(float) * MAX_BUFFER_SIZE );
|
||||||
//memset( tmpRecordBuffer, 0, sizeof(float) * MAX_BUFFER_SIZE );
|
//memset( tmpRecordBuffer, 0, sizeof(float) * MAX_BUFFER_SIZE );
|
||||||
|
|
||||||
for(int i = 0; i < 10; i++ ) {
|
for(int i = 0; i < NSCENES; i++ ) {
|
||||||
clips[i] = new LooperClip(track, i);
|
clips[i] = new LooperClip(track, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
|
||||||
// write the pitch-shifted signal to the track buffer
|
// write the pitch-shifted signal to the track buffer
|
||||||
//FIXME: pitchShift adds delay even for playSpeed = 1.0!!
|
//FIXME: pitchShift adds delay even for playSpeed = 1.0!!
|
||||||
//we should use something better (e.g librubberband)
|
//we should use something better (e.g librubberband)
|
||||||
if(playSpeed!=1.0f) {
|
if(0) { //playSpeed!=1.0f) {
|
||||||
pitchShift( 1, &tmpL, &outL[i] );
|
pitchShift( 1, &tmpL, &outL[i] );
|
||||||
pitchShift( 1, &tmpR, &outR[i] );
|
pitchShift( 1, &tmpR, &outR[i] );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -70,7 +70,7 @@ private:
|
||||||
int fpb;
|
int fpb;
|
||||||
|
|
||||||
//vector<float> tmpRecordBuffer;
|
//vector<float> tmpRecordBuffer;
|
||||||
LooperClip* clips[10];
|
LooperClip* clips[NSCENES];
|
||||||
|
|
||||||
// Pitch Shifting
|
// Pitch Shifting
|
||||||
void pitchShift(int count, float* input, float* output);
|
void pitchShift(int count, float* input, float* output);
|
||||||
|
|
|
@ -450,9 +450,9 @@ void LooperClip::getSample(float playSpeed, float* L, float* R)
|
||||||
|
|
||||||
std::vector<float>& vL = _buffer->getDataL();
|
std::vector<float>& vL = _buffer->getDataL();
|
||||||
std::vector<float>& vR = _buffer->getDataR();
|
std::vector<float>& vR = _buffer->getDataR();
|
||||||
*L = vL.at(_playhead);
|
*L = vL[_playhead];
|
||||||
*R = vR.at(_playhead);
|
*R = vR[_playhead];
|
||||||
_playhead +=playSpeed;
|
_playhead += playSpeed;
|
||||||
} else {
|
} else {
|
||||||
*L = 0.f;
|
*L = 0.f;
|
||||||
*R = 0.f;
|
*R = 0.f;
|
||||||
|
|
40
src/meson.build
Normal file
40
src/meson.build
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
version_hxx = vcs_tag(
|
||||||
|
input : 'version.hxx.in',
|
||||||
|
output : 'version.hxx')
|
||||||
|
|
||||||
|
luppp_src = files(
|
||||||
|
'audiobuffer.cxx',
|
||||||
|
'controllerupdater.cxx',
|
||||||
|
'debug.cxx',
|
||||||
|
'diskreader.cxx',
|
||||||
|
'diskwriter.cxx',
|
||||||
|
'event.cxx',
|
||||||
|
'eventhandlerdsp.cxx',
|
||||||
|
'eventhandlergui.cxx',
|
||||||
|
'gaudioeditor.cxx',
|
||||||
|
'gmastertrack.cxx',
|
||||||
|
'goptions.cxx',
|
||||||
|
'gridlogic.cxx',
|
||||||
|
'gtrack.cxx',
|
||||||
|
'gui.cxx',
|
||||||
|
'jack.cxx',
|
||||||
|
'jacksendreturn.cxx',
|
||||||
|
'logic.cxx',
|
||||||
|
'looperclip.cxx',
|
||||||
|
'looper.cxx',
|
||||||
|
'main.cxx',
|
||||||
|
'metronome.cxx',
|
||||||
|
'timemanager.cxx',
|
||||||
|
'trackoutput.cxx'
|
||||||
|
)
|
||||||
|
|
||||||
|
subdir('cjson')
|
||||||
|
subdir('dsp')
|
||||||
|
subdir('controller')
|
||||||
|
subdir('observer')
|
||||||
|
subdir('state')
|
||||||
|
subdir('avtk')
|
||||||
|
|
||||||
|
if(get_option('tests') == true)
|
||||||
|
subdir('tests')
|
||||||
|
endif
|
1
src/observer/meson.build
Normal file
1
src/observer/meson.build
Normal file
|
@ -0,0 +1 @@
|
||||||
|
luppp_src += files('midi.cxx', 'time.cxx')
|
1
src/state/meson.build
Normal file
1
src/state/meson.build
Normal file
|
@ -0,0 +1 @@
|
||||||
|
luppp_src += files('state.cxx', 'stately.cxx')
|
5
src/tests/meson.build
Normal file
5
src/tests/meson.build
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
luppp_src += files(
|
||||||
|
'diskreadertest.cxx',
|
||||||
|
'diskwritertest.cxx',
|
||||||
|
'goptionstest.cxx',
|
||||||
|
'gridlogictests.cxx')
|
|
@ -82,7 +82,7 @@ void TimeManager::setBpm(float bpm)
|
||||||
|
|
||||||
void TimeManager::setBpmZeroOne(float b)
|
void TimeManager::setBpmZeroOne(float b)
|
||||||
{
|
{
|
||||||
setBpm( b * 160 + 60 ); // 60 - 220
|
setBpm( b * (MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO ); // 60 - 220
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
src/version.hxx.in
Normal file
1
src/version.hxx.in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#define GIT_VERSION "@VCS_TAG@"
|
Loading…
Add table
Reference in a new issue