Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a8b12b1
from now on fix addon release number to same as Mosaic
d3cod3 Dec 29, 2024
c289764
now graphical canvas drag&zoom managed from imgui
d3cod3 Jan 1, 2025
c728603
avoid canvas drag&zoom when over panel windows
d3cod3 Jan 2, 2025
b991ea3
Add canvas interaction from imgui ( select nodes for group drag, dupl…
d3cod3 Jan 4, 2025
07f9205
Fix duplicate filepath in objects with loaded file when duplicate
d3cod3 Jan 4, 2025
e70ba39
Add Piano keyboard object, to visualize MIDI notes from external devi…
d3cod3 Jan 6, 2025
b616994
fixed crash when input vector size < 2
d3cod3 Jan 7, 2025
e3c674b
Added scheme script object with live coding on output window
d3cod3 Jan 8, 2025
a54b347
added polyphonic oscillator, up to 16 voices
d3cod3 Jan 13, 2025
ac09cfd
small fixes
d3cod3 Jan 13, 2025
cd19da7
Add external panning control for mixer object
d3cod3 Jan 13, 2025
c8d2c56
testing gitsponsor badge
d3cod3 Jan 19, 2025
0c4d8ac
removing spammers badge
d3cod3 Jan 19, 2025
8a65c9a
updated midi receiver to receive multiple simultanously midi messages…
d3cod3 Jan 20, 2025
8f62e76
added parametric equalizer object
d3cod3 Jan 21, 2025
04b08d6
mute oscillator on pitch 0.0
d3cod3 Jan 23, 2025
02e76ea
added debug code to visualize dataflow pointer addresses
d3cod3 Jan 23, 2025
0791049
elegant cast template for inlets/outlets data proposal from @Daandela…
d3cod3 Jan 23, 2025
1fd0d58
fix crash when fail to scan plugin folder by @Daandelange
d3cod3 Jan 23, 2025
ad5ff7c
reordered code
d3cod3 Jan 24, 2025
81aed6f
added quantizer object
d3cod3 Jan 24, 2025
7dd439a
updated README
d3cod3 Jan 25, 2025
e63b785
added code reference
d3cod3 Jan 26, 2025
723868b
fixed debug vars
d3cod3 Jan 26, 2025
558f9bd
fixed debug vars
d3cod3 Jan 26, 2025
873849e
adjustments on parametric EQ object
d3cod3 Jan 28, 2025
5f9e396
Merge pull request #18 from d3cod3/master
d3cod3 Jan 28, 2025
9380004
added simple imgui toggle button
d3cod3 Jan 29, 2025
ad627c3
added 8 step address sequencer object
d3cod3 Jan 29, 2025
16ac7cd
fixed sequencer object step counter and added sync inlet
d3cod3 Jan 29, 2025
0376200
fixed set ratio on loading object
d3cod3 Jan 30, 2025
a157b5f
removed unused addon
d3cod3 Jan 30, 2025
6fa7821
updated readme
d3cod3 Jan 30, 2025
fed82df
fixed object name
d3cod3 Jan 31, 2025
d8b1edf
added summing mixer object
d3cod3 Jan 31, 2025
a518880
0.7.2 macos fixes
d3cod3 Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 27 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Table of Contents
* [INSTALLING](#installing)
* [USAGE](#usage)
* [CONTRIBUTING](#contributing)
* [COLLECTIONS](#collections)
* [OBJECTS LIST](#objects_list)
* [LICENSE](#license)
* [CREDITS](#credits)
Expand Down Expand Up @@ -72,8 +73,6 @@ In order to build ofxVisualProgramming, you'll need this addons:

#### [ofxFft](https://github.com/kylemcdonald/ofxFft)

#### [ofxJSON](https://github.com/jeffcrouse/ofxJSON)

#### [ofxImGui](https://github.com/d3cod3/ofxImGui)

#### [ofxInfiniteCanvas](https://github.com/d3cod3/ofxInfiniteCanvas)
Expand Down Expand Up @@ -117,7 +116,6 @@ git clone https://github.com/kylemcdonald/ofxCv
git clone https://github.com/arturoc/ofxEasing
git clone https://github.com/d3cod3/ofxFFmpegRecorder
git clone https://github.com/kylemcdonald/ofxFft
git clone https://github.com/jeffcrouse/ofxJSON
git clone https://github.com/d3cod3/ofxImGui
git clone https://github.com/d3cod3/ofxInfiniteCanvas
git clone https://github.com/danomatika/ofxLua
Expand All @@ -135,83 +133,31 @@ git clone https://github.com/d3cod3/ofxVisualProgramming

# USAGE

In ofApp.h include the ofxVisualProgramming addon:

```c

#include "ofMain.h"

#include "ofxVisualProgramming.h"

class ofApp : public ofBaseApp{

public:
void setup();
void update();
void draw();
// ....
// ....

ofxVisualProgramming *visualProgramming; /**/

};

```

then in ofApp.cpp:
Check [Mosaic](https://github.com/d3cod3/Mosaic) project to look at a ofxVisualProgramming addon usage and implementation

```c

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
ofSetWindowTitle("ofxVisualProgramming Example");

visualProgramming = new ofxVisualProgramming();
visualProgramming->setup();
}

//--------------------------------------------------------------
void ofApp::update(){
visualProgramming->update();
}

//--------------------------------------------------------------
void ofApp::draw(){
ofBackground(20);
visualProgramming->draw();
}

```

# CONTRIBUTING

Contributing to the project adding new objects is relatively easy, as ofxVisualProgramming is at the core of [Mosaic](https://github.com/d3cod3/Mosaic) software, i've implemented a plugin mechanism based on [Pugg](http://pugg.sourceforge.net/), in order to facilitate the extension and the creation of new objects/nodes to add at the ofxVisualProgramming/Mosaic default objects/nodes library. (see objects/nodes list below)

You can find the repo of the plugin template here: [ofxMosaicPlugin](https://github.com/d3cod3/ofxMosaicPlugin), with some generic objects templates and more detailed info in the readme.

# COLLECTIONS

A list of contributed collections of new objects

- [ofxVPObjectsDaan](https://github.com/Daandelange/ofxVPObjectsDaan) by [@Daandelange](https://github.com/Daandelange)

# OBJECTS LIST

Audio Analysis | Ready
---------- | ----------
audio analyzer | X |
bpm extractor | X |
centroid extractor | X |
dissonance extractor | X |
fft extractor | X |
hfc extractor | X |
hpcp extractor | X |
inharmonicity extractor | X |
mel bands extractor | X |
mfcc extractor | X |
onset extractor | X |
pitch extractor | X |
power extractor | X |
rms extractor | X |
rolloff extractor | X |
tristimulus extractor | X |

Communications | Ready
---------- | ----------
Expand All @@ -229,7 +175,6 @@ osc sender | X |
Computer Vision | Ready
---------- | ----------
background subtraction | X |
chroma key | X |
color tracking | X |
contour tracking | X |
haar tracking | X |
Expand All @@ -241,10 +186,13 @@ Data | Ready
bang multiplexer | X |
bang to float | X |
color palette | X |
data to file | X |
data to texture | X |
file to data | X |
float multiplexer | X |
floats to vector | X |
receiver | X |
sender | X |
texture to data | X |
vector at | X |
vector concat | X |
Expand All @@ -259,6 +207,9 @@ bang | X |
comment | X |
data viewer | X |
message | X |
multislider | X |
multitoggle | X |
piano keyboard | X |
player controls | X |
signal viewer | X |
slider | X |
Expand Down Expand Up @@ -286,10 +237,10 @@ Math | Ready
---------- | ----------
1D noise | X |
clamp | X |
constant | X |
cosine generator | X |
map | X |
metronome | X |
number | X |
operator | X |
simple random | X |
sine generator | X |
Expand All @@ -300,15 +251,15 @@ Scripting | Ready
bash script | X |
glsl shader | X |
lua script | X |
python script | X |
scheme script | |
scheme live coding | X |


Sound | Ready
---------- | ----------
ADSR envelope | X |
AHR envelope | X |
amplifier | X |
address sequencer | X |
audio exporter | X |
bit cruncher | X |
bit noise | X |
Expand All @@ -319,6 +270,7 @@ data oscillator | X |
decimator | X |
delay | X |
dimension chorus | X |
frequency to note | X |
high pass | X |
kick | X |
lfo | X |
Expand All @@ -327,20 +279,23 @@ mixer | X |
note to frequency | X |
oscillator | X |
panner | X |
parametric EQ | | X
parametric EQ | X |
pd patch | X |
polyphonic oscillator | X |
quad panner | X |
quantizer | | X
quantizer | X |
resonant filter | X |
reverb | X |
sample and hold | | X
sample player | X |
saturator | | X
sequencer | X |
sidechain compressor | X |
signal gate | X |
signal operator | X |
signal trigger | X |
soundfile player | X |
summing mixer | X |

Texture | Ready
---------- | ----------
Expand All @@ -349,20 +304,20 @@ image loader | X |
kinect grabber | X |
pixels to texture | X |
texture crop | X |
texture gate | X |
texture information | X |
texture mixer | X |
texture to pixels | X |
texture transform | X |
to grayscale texture | X |
syphon sender | X |
syphon receiver | X |
syphon sender ( osx only ) | X |
syphon receiver ( osx only ) | X |
video exporter | X |
video feedback | X |
video gate | X |
video grabber | X |
video player | X |
video receiver | X |
video sender | X |
video receiver ( osx only ) | X |
video sender ( osx only ) | X |
video streaming | X |
video timedelay | X |

Expand Down Expand Up @@ -390,8 +345,6 @@ ofxEasing original addon by [Arturo Castro](https://github.com/arturoc)

ofxFFmpegRecorder original addon by [Furkan Üzümcü](https://github.com/Furkanzmc)

ofxJSON original addon by [Jeff Crouse](https://github.com/jeffcrouse/)

ofxImGui original addon by [Jason Van Cleave](https://github.com/jvcleave)

ofxInfiniteCanvas original addon by [Roy Macdonald](https://github.com/roymacdonald)
Expand Down
4 changes: 3 additions & 1 deletion addon_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ common:
# or use += in several lines
ADDON_DEPENDENCIES = ofxKinect ofxOpenCv ofxOsc ofxXmlSettings
ADDON_DEPENDENCIES += ofxAudioFile ofxBTrack ofxCv ofxEasing ofxFFmpegRecorder ofxFft
ADDON_DEPENDENCIES += ofxJSON ofxImGui ofxInfiniteCanvas ofxLua ofxMidi ofxMtlMapping2D
ADDON_DEPENDENCIES += ofxGLEditor ofxImGui ofxLua ofxMidi ofxMtlMapping2D
ADDON_DEPENDENCIES += ofxOpenDHT ofxPd ofxPDSP ofxTimeline ofxWarp

# include search paths, this will be usually parsed from the file system
Expand Down Expand Up @@ -74,6 +74,7 @@ common:

linux64:
#ADDON_DEPENDENCIES += ofxNDI
ADDON_DEPENDENCIES += ofxScheme
ADDON_SOURCES_EXCLUDE = src/objects/video/VideoSender% src/objects/video/VideoReceiver% src/objects/video/SyphonSender% src/objects/video/SyphonReceiver%

msys2:
Expand All @@ -84,3 +85,4 @@ vs:

osx:
ADDON_DEPENDENCIES += ofxNDI ofxSyphon
ADDON_SOURCES_EXCLUDE = src/objects/scripting/SchemeScript%
24 changes: 17 additions & 7 deletions src/PatchObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
}
}

ImGuiEx::NodeConnectData connectData = _nodeCanvas.AddNodePin( nId, i, inletsNames.at(i).c_str(), tempLinkData, getInletTypeName(i), getInletWirelessReceive(i), inletsConnected[i], IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Left );
std::ostringstream inletInfo;
inletInfo << inletsNames.at(i); // << " " << _inletParams[i];
ImGuiEx::NodeConnectData connectData = _nodeCanvas.AddNodePin( nId, i, inletInfo.str().c_str(), tempLinkData, getInletTypeName(i), getInletWirelessReceive(i), inletsConnected[i], IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Left );

inletsPositions[i] = _nodeCanvas.getInletPosition(nId,i);

Expand Down Expand Up @@ -397,7 +399,10 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
}
}

_nodeCanvas.AddNodePin( nId, i, getOutletName(i).c_str(), tempLinkData, getOutletTypeName(i), getOutletWirelessSend(i), getIsOutletConnected(i), IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Right );
std::ostringstream outletInfo;
outletInfo << getOutletName(i); // << " " << _outletParams[i];

_nodeCanvas.AddNodePin( nId, i, outletInfo.str().c_str(), tempLinkData, getOutletTypeName(i), getOutletWirelessSend(i), getIsOutletConnected(i), IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Right );

outletsPositions[i] = _nodeCanvas.getOutletPosition(nId,i);
}
Expand Down Expand Up @@ -434,7 +439,7 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
linksDeactivated = _nodeCanvas.getDeactivatedLinks();

// Refresh objects selected to eventually duplicate or delete ( cmd-d or backsapce )
objectsSelected = _nodeCanvas.getSelectedNodes();
objectsSelected = _nodeCanvas.getSelectedNodesId();

// Let objects draw their own Gui
this->drawObjectNodeGui( _nodeCanvas );
Expand Down Expand Up @@ -1194,6 +1199,7 @@ void PatchObject::keyPressed(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>>
//--------------------------------------------------------------
void PatchObject::keyReleased(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>> &patchObjects){
if(!willErase){
// DELETE SELECTED OBJECTS
if(e.key == OF_KEY_BACKSPACE){
for (int j=0;j<static_cast<int>(linksToDisconnect.size());j++){
disconnectLink(patchObjects,linksToDisconnect.at(j));
Expand All @@ -1202,16 +1208,20 @@ void PatchObject::keyReleased(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>>

for(int j=0;j<static_cast<int>(objectsSelected.size());j++){
if(objectsSelected.at(j) == this->nId){
ofNotifyEvent(removeEvent, objectsSelected.at(j));
this->setWillErase(true);
if(this->getName() != "audio device"){
ofNotifyEvent(removeEvent, objectsSelected.at(j));
this->setWillErase(true);
}
}
}
objectsSelected.clear();
//objectsSelected.clear();
// OSX: CMD-D, WIN/LINUX: CTRL-D (DUPLICATE SELECTED OBJECTS)
}else if(e.hasModifier(MOD_KEY) && e.keycode == 68){
for(int j=0;j<static_cast<int>(objectsSelected.size());j++){
if(objectsSelected.at(j) == this->nId){
ofNotifyEvent(duplicateEvent, objectsSelected.at(j));
if(!this->getIsHardwareObject()){
ofNotifyEvent(duplicateEvent, objectsSelected.at(j));
}
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/core/imgui_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,4 +446,25 @@ SmartButtonState BangButton(const char* label, ImVec4& color, ImVec2 size) {
return state;
}

void ToggleButton(const char* str_id, bool* v)
{
ImVec4* colors = ImGui::GetStyle().Colors;
ImVec2 p = ImGui::GetCursorScreenPos();
ImDrawList* draw_list = ImGui::GetWindowDrawList();

float height = ImGui::GetFrameHeight()/3*2;
float width = height * 1.55f;
float radius = height * 0.50f;

ImGui::InvisibleButton(str_id, ImVec2(width, height));
if (ImGui::IsItemClicked()) *v = !*v;

if (ImGui::IsItemHovered())
draw_list->AddRectFilled(p, ImVec2(p.x + width, p.y + height), ImGui::GetColorU32(*v ? colors[ImGuiCol_ButtonActive] : ImVec4(0.78f, 0.78f, 0.78f, 1.0f)), height * 0.5f);
else
draw_list->AddRectFilled(p, ImVec2(p.x + width, p.y + height), ImGui::GetColorU32(*v ? colors[ImGuiCol_Button] : ImVec4(0.85f, 0.85f, 0.85f, 1.0f)), height * 0.50f);

draw_list->AddCircleFilled(ImVec2(p.x + radius + (*v ? 1 : 0) * (width - radius * 2.0f), p.y + radius), radius - 1.5f, IM_COL32(255, 255, 255, 255));
}

}
2 changes: 2 additions & 0 deletions src/core/imgui_controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ SmartButtonState SmartButton(const char* label, ImVec2 size = {0, 0});

SmartButtonState BangButton(const char* label, ImVec4& color, ImVec2 size = {0, 0});

void ToggleButton(const char* str_id, bool* v);

}
4 changes: 2 additions & 2 deletions src/core/imgui_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ inline void drawWaveform(ImDrawList* drawList, ImVec2 dim, float* data, int data
}

//--------------------------------------------------------------
inline void plotValue(float value, float min, float max, ImU32 color=IM_COL32(255,255,255,255), float retinaScale=1.0f){
inline void plotValue(float value, float min, float max, ImU32 color=IM_COL32(255,255,255,255), float height=OBJECT_STANDARD_HEIGHT, float scale=1.0f){
ImGuiEx::PlotVarConfig conf;
conf.value = value;
conf.frame_size = ImVec2(ImGui::GetWindowSize().x - 20, ImGui::GetWindowSize().y - ((IMGUI_EX_NODE_HEADER_HEIGHT+IMGUI_EX_NODE_FOOTER_HEIGHT)*retinaScale));
conf.frame_size = ImVec2(ImGui::GetWindowSize().x - (20*scale), height);
conf.scale.min = min;
conf.scale.max = max;
conf.buffer_size = 256;
Expand Down
Loading