Skip to content

Commit f2caf31

Browse files
committed
fixed clamp and casting
1 parent 3792e68 commit f2caf31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/objects/sound/FrequencyToNote.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ void FrequencyToNote::updateObjectContent(map<int,shared_ptr<PatchObject>> &patc
9292
frequency = ofClamp(*(float *)&_inletParams[0],1.0f,13289.0f);
9393
}
9494

95-
*(float *)&_outletParams[0] = frequencyToPitch(frequency);
96-
lastNote = static_cast<int>(*(float *)&_outletParams[0]);
95+
lastNote = static_cast<int>(frequencyToPitch(frequency));
96+
*(float *)&_outletParams[0] = lastNote;
9797

9898
if(!loaded){
9999
loaded = true;

0 commit comments

Comments
 (0)