Audio track velocity editing in the sequencer.
This commit is contained in:
parent
b46d4f09bb
commit
896a7907d3
10 changed files with 292 additions and 6 deletions
|
|
@ -64,6 +64,35 @@ int main(int argc,char **argv) {
|
|||
MainWindow window(false,"");main_window=&window;window.resize(0,0,1400,900);window.show();check(window.open_project(project.c_str()));pump();
|
||||
auto *s=first<SequencerWidget>(window);if(!s)throw std::runtime_error("Sequencer missing");
|
||||
auto reset=[&](){window.reset_layout();check(window.open_project(project.c_str()));window.resize(0,20,1400,900);tab("Sequencer");s->select(0,0);s->position(0);check(window.set_loop(3840,7680,true));window.fit_song();pump();};
|
||||
auto audio_velocity_capture=[&]() {
|
||||
reset();
|
||||
char source[4096]; if(!realpath("examples/projects/original-pluck.wav",source)) throw std::runtime_error("Missing audio source");
|
||||
check(window.create_track(false)); check(window.import_audio(source));
|
||||
uint64_t track=s->selected_track();
|
||||
check(s->rename_selection("Pluck audio")); check(s->repeat_selection(7));
|
||||
for(int i=0;i<5;++i) check(s->move_track(-1));
|
||||
check(s->set_zoom(192)); s->expand_track(track,true); s->expand_track(0,true);
|
||||
pump();
|
||||
// Use the real lane gestures, including its undo/publication callbacks.
|
||||
for(auto point:{std::pair<int,int>{0,65},{48,50},{96,72},{192,58},{288,65},{384,50},{576,68},{768,65}}) {
|
||||
int ox=Fl::e_x,oy=Fl::e_y,ok=Fl::e_keysym;
|
||||
Fl::e_x=s->x()+s->header_width()+point.first; Fl::e_y=s->track_top(0)+56+point.second;
|
||||
Fl::e_keysym=FL_Button+FL_LEFT_MOUSE;
|
||||
s->handle(FL_PUSH); s->handle(FL_RELEASE);
|
||||
Fl::e_x=ox; Fl::e_y=oy; Fl::e_keysym=ok;
|
||||
}
|
||||
pump(); capture("audio-velocity-expanded");
|
||||
int ox=Fl::e_x,oy=Fl::e_y,ok=Fl::e_keysym;
|
||||
Fl::e_x=s->x()+s->header_width()+48; Fl::e_y=s->track_top(0)+56+50;
|
||||
Fl::e_keysym=FL_Button+FL_LEFT_MOUSE; s->handle(FL_PUSH);
|
||||
Fl::e_y+=10; s->handle(FL_DRAG);
|
||||
pump(); capture("audio-velocity-editing");
|
||||
Fl::e_keysym=FL_Escape; s->handle(FL_KEYDOWN);
|
||||
Fl::e_x=ox; Fl::e_y=oy; Fl::e_keysym=ok;
|
||||
};
|
||||
if(std::getenv("XTC_CAPTURE_AUDIO_VELOCITY_ONLY")) {
|
||||
audio_velocity_capture(); window.do_callback(); return 0;
|
||||
}
|
||||
if(std::getenv("XTC_CAPTURE_VELOCITY_ONLY")) {
|
||||
reset(); capture("compact-workspace"); capture("sequencer-loop");
|
||||
check(s->set_zoom(96));
|
||||
|
|
@ -145,7 +174,8 @@ int main(int argc,char **argv) {
|
|||
}
|
||||
reset();capture("overview");capture("sequencer-loop");capture("arrangement-markers");
|
||||
check(s->set_zoom(96)); s->expand_track(0,true); s->expand_track(1,true);
|
||||
pump(); capture("track-velocity-expanded"); reset();
|
||||
pump(); capture("track-velocity-expanded");
|
||||
audio_velocity_capture(); reset();
|
||||
s->position(4800);check(window.loop_section());capture("section-navigation");
|
||||
dialog("marker-edit",[&]{s->marker_dialog();});
|
||||
dialog("ripple-time",[&]{s->ripple_dialog(false);});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue