Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chinenual committed Apr 27, 2024
1 parent 0539e81 commit 3075c7c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Add some eye-candy to the Harp. Print the quantized note and also display it graphically on an LED strip.
* Fix an off-by-one in the quantization computation.
* Replace the TouchOSC v1 example client with one built in TouchOSC v2. Had some problems with the touch messages from v1 confusing cvOSCcv.

## 2.7.0-beta3

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ The signal range of the control surface is configured via the context menu:
Harp does not depend on any particular control surface and can be configured to work with a variety of CV input ranges. You can use it with anything that can create a continuous voltage as the musician "strums" (could be a slider on a MIDI control surface, a ribbon controller, heck, even an LFO) I've created a [simple control surface for the iPad using TouchOSC](https://github.com/chinenual/Chinenual-VCV/releases/latest). Use Trowasoft's cvOSCcv to convert its OSC messages to CV:

* **/1/fader1** - Left pitch - sends 0.0 through 10.0 corresponding to where the left control strip is being touched.
* **/1/fader1/z** - Left gate - 1 when the user is touching the left control strip; 0 when not touching
* **/1/fader1z** - Left gate - 1 when the user is touching the left control strip; 0 when not touching
* **/1/fader2** - Right pitch - sends 0.0 through 10.0 corresponding to where the right control strip is being touched.
* **/1/fader2/z** - Right gate - 1 when the user is touching the right control strip; 0 when not touching
* **/1/fader2z** - Right gate - 1 when the user is touching the right control strip; 0 when not touching

Works best when wired with a direct USB connection. Be sure to enable "touch messages" (/z).

Expand Down
Binary file modified doc/Harp-patched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/Harp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 21 additions & 12 deletions src/Harp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ namespace Harp {
std::string fontPath;
char displayStr[16];
std::string* text;

NoteDisplayWidget(std::string* t)
std::string fakeData;

NoteDisplayWidget(std::string* t, std::string fakeData)
{
text = t;
this->fakeData = fakeData;
fontPath = std::string(
asset::plugin(pluginInstance, "res/fonts/opensans/OpenSans-Bold.ttf"));
}
Expand All @@ -185,7 +187,7 @@ namespace Harp {
nvgFillColor(args.vg, ledTextColor);

nvgTextAlign(args.vg, NVG_ALIGN_LEFT | NVG_ALIGN_BOTTOM);
nvgText(args.vg, textPos.x, textPos.y, text ? text->c_str() : "", NULL);
nvgText(args.vg, textPos.x, textPos.y, text ? text->c_str() : fakeData.c_str(), NULL);
}
}
};
Expand Down Expand Up @@ -224,17 +226,24 @@ namespace Harp {
void drawLayer(const DrawArgs& args, int layer) override {
if (layer != 1)
return;

if (! module)
return;

if (module->notePlaying) {
int noteRange = (int)module->params[Harp::NOTE_RANGE_PARAM].getValue();
if ((!module) || module->notePlaying) {

int noteRange;
int currDegree;
if (module) {
noteRange = (int)module->params[Harp::NOTE_RANGE_PARAM].getValue();
currDegree = module->currDegree;
} else {
// fake data for the module browser:
noteRange = 24;
currDegree = 6;
}

#define STRIP_LED_Y_OFFSET 5.0
float height = (box.getHeight()-(2.f*STRIP_LED_Y_OFFSET)) / noteRange;
float x = STRIP_LED_X_OFFSET;
float y = STRIP_LED_X_OFFSET + (height * ((noteRange-1)-module->currDegree));
float y = STRIP_LED_X_OFFSET + (height * ((noteRange-1)-currDegree));
nvgBeginPath(args.vg);
nvgFillColor(args.vg, ledTextColor);
//INFO("rect %f %f %f %f %f",x, y, STRIP_LED_WIDTH, height, ratio);
Expand Down Expand Up @@ -272,17 +281,17 @@ namespace Harp {
addOutput(createOutputCentered<PJ301MPort>(
mm2px(Vec(FIRST_X_OUT + SPACING_X_OUT + 0 * SPACING_X_OUT, FIRST_Y + SPACING_Y * 7)), module, Harp::GATE_OUTPUT));

auto rootNoteDisplay = new NoteDisplayWidget(module ? &module->rootNote_text : NULL);
auto rootNoteDisplay = new NoteDisplayWidget(module ? &module->rootNote_text : NULL, "C4");
rootNoteDisplay->box.size = Vec(30, 10);
rootNoteDisplay->box.pos = mm2px(Vec(LED_OFFSET_X + FIRST_X_OUT + SPACING_X_OUT + 0 * SPACING_X_OUT, LED_OFFSET_Y + FIRST_Y + SPACING_Y * 1));
addChild(rootNoteDisplay);

auto playingNoteDisplay = new NoteDisplayWidget(module ? &module->playingNote_text : NULL);
auto playingNoteDisplay = new NoteDisplayWidget(module ? &module->playingNote_text : NULL, "E4");
playingNoteDisplay->box.size = Vec(30, 10);
playingNoteDisplay->box.pos = mm2px(Vec(LED_OFFSET_X + FIRST_X_OUT + SPACING_X_OUT + 0 * SPACING_X_OUT, LED_OFFSET_Y + FIRST_Y + SPACING_Y * 5));
addChild(playingNoteDisplay);

auto debugDisplay = new NoteDisplayWidget(module ? &module->debug_text : NULL);
auto debugDisplay = new NoteDisplayWidget(module ? &module->debug_text : NULL, "");
debugDisplay->box.size = Vec(30, 10);
debugDisplay->box.pos = mm2px(Vec(LED_OFFSET_X + FIRST_X_OUT + SPACING_X_OUT + 0 * SPACING_X_OUT, LED_OFFSET_Y + FIRST_Y + SPACING_Y * 4.5));
addChild(debugDisplay);
Expand Down
Binary file removed src/OSCHarp-v1.touchosc
Binary file not shown.
Binary file added src/OSCHarp-v2.tosc
Binary file not shown.

0 comments on commit 3075c7c

Please sign in to comment.