Skip to content

Commit

Permalink
Newer C++.
Browse files Browse the repository at this point in the history
  • Loading branch information
gogins committed Jun 28, 2021
1 parent 68b94dd commit d18fef2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .SciTEUser.properties
Original file line number Diff line number Diff line change
Expand Up @@ -730,13 +730,13 @@ command.6.*=g++ -Dlinux --std=gnu++17 -lstdc++fs -Wno-write-strings -I. -I/usr/
# not to end up on Dropbox.

command.name.7.*=Render csd piece to audio
command.7.*=cd "$(FileDir)" && csound "$(FileNameExt)" --simple-sorted-score -odac:plughw:1,0 -m163 -+msg_color=0
command.7.*=cd "$(FileDir)" && csound "$(FileNameExt)" --simple-sorted-score -odac:plughw:2,0 -m163 -+msg_color=0
command.name.8.*=Render csd piece to soundfile and play
command.8.*=cd "$(FileDir)" && csound "$(FileNameExt)" --simple-sorted-score -o"/tmp/$(FileNameExt).wav" -m163 -+msg_color=0 && audacity "/tmp/$(FileNameExt).wav"
command.name.9.*=Render csd piece to soundfile and post-process and play
command.9.*=cd "$(FileDir)" && csound "$(FileNameExt)" --simple-sorted-score -o"/tmp/$(FileNameExt).wav" -m163 -+msg_color=0 && python /home/mkg/csound-extended/post-process.py "/tmp/$(FileNameExt).wav"
command.name.10.*=Render orc+sco piece to audio
command.10.*=cd "$(FileDir)" && csound "$(FileName).orc" "$(FileName).sco" --simple-sorted-score -odac:plughw:1,0 -m163 -+msg_color=0
command.10.*=cd "$(FileDir)" && csound "$(FileName).orc" "$(FileName).sco" --simple-sorted-score -odac:plughw:2,0 -m163 -+msg_color=0
command.name.11.*=Render orc+sco piece to soundfile and play
command.11.*=cd "$(FileDir)" && csound "$(FileName).orc" "$(FileName).sco" --simple-sorted-score -o"/tmp/$(FileNameExt).wav" -m163 -+msg_color=0 && audacity "/tmp/$(FileNameExt).wav"
command.name.12.*=Test patch file to soundfile
Expand Down
11 changes: 3 additions & 8 deletions CsoundAC/CsoundProducer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void defun(const std::string &name, cl_object fun(Params... params)) {
* tagged with metadata. This function is called automatically by
* PerformAndPostProcess.
*/
static void PostProcess_(std::map<std::string, std::string> &tags, std::string filename, CsoundThreaded *csound) {
static void PostProcess(std::map<std::string, std::string> &tags, std::string filename, CsoundThreaded *csound) {
auto period_index = filename.rfind(".");
std::string filename_base = filename.substr(0, period_index);
std::string filename_extension = filename.substr(period_index + 1, std::string::npos);
Expand Down Expand Up @@ -219,11 +219,6 @@ void defun(const std::string &name, cl_object fun(Params... params)) {
std::fprintf(stderr, "Ended PostProcess.\n");
}

static void PostProcess(std::map<std::string, std::string> &tags, std::string filename) {
PostProcess_(tags, filename, nullptr);
}


/**
* Optionally adds metadata, performs post-processing, translates to
* various soundfile formats as automatic steps in the Csound rendering of
Expand Down Expand Up @@ -267,7 +262,7 @@ void defun(const std::string &name, cl_object fun(Params... params)) {
if (do_git_commit == true) {
char temporary_filename[0x200];
auto discard = std::tmpnam(temporary_filename);
char command[0x200];
char command[0x300];
std::sprintf(command, "git rev-parse --short HEAD > %s", temporary_filename);
auto result = std::system(command);
std::fstream hash_file(temporary_filename);
Expand Down Expand Up @@ -374,7 +369,7 @@ void defun(const std::string &name, cl_object fun(Params... params)) {
output_filename.append(".");
output_filename.append(output_type);
Message("Post-processing output file: %s.\n", output_filename.c_str());
PostProcess_(tags, output_filename, this);
PostProcess(tags, output_filename, this);
seconds = stopTiming(clock_started);
Message("Post-processing %s took %9.4f seconds.\n", output_filename.c_str(), seconds);
Message("Ended CsoundProducer::PerformAndPostProcessRoutine with %d.\n", result);
Expand Down

0 comments on commit d18fef2

Please sign in to comment.