RPN Calculator - Reverse Polish Notation

Until our dedicated user library is in place you can post examples and modules here

Moderators: electrogear, exonerate

RPN Calculator - Reverse Polish Notation

Postby DigitalWhiteByte on Sun Jan 01, 2012 10:37 pm

My gift for 2012

RPN_Infix_to_Postfix_DWB.osm
(29.19 KiB) Downloaded 121 times

RPN Calculator
Reverse Polish Notation
Infix to Postfix & Evaluate Expression
Shunting-yard algorithm used.

Ruby?
Mubarak's grandson?
;)

Hoping that you get ruby as gift of Epiphany.
Happy New Year to everyone
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: RPN Calculator - Reverse Polish Notation

Postby cyto on Mon Jan 02, 2012 7:24 am

Wow! That is interesting work, DWB!!! I need to spend a bit of time examining this, but I can already think of some situations where this would be very useful. Perhaps you may see an emulation of my HP12C calculator coming soon. Is there a future for SM in the field of finance? ;)

-cyto
User avatar
cyto
essemilian
 
Posts: 317
Joined: Sun Nov 28, 2010 4:36 am
Location: CIN | OH | USA

Re: RPN Calculator - Reverse Polish Notation

Postby stw on Mon Jan 02, 2012 7:29 am

Awesome work! Thaks for that DWB!
stw
smanatic
 
Posts: 639
Joined: Mon Jun 30, 2008 2:55 pm

Re: RPN Calculator - Reverse Polish Notation

Postby DigitalWhiteByte on Mon Jan 02, 2012 8:24 am

I forgot to say that it is expandable, and other mathematical functions can be implemented as desired.
The main benefit that I delegate for this module,
is to have the possibility, for example, when designing a filter,
have the opportunity to recalculate some things, like the coefficients directly in the exported plugin
only changing the mathematical formula, and see the results, so focus on the mathematics.

Anyone who wants to work together to extend the functions, is welcome.
If you have questions about how the schematic, do not hesitate to do it.

In a few days, how to add the functions in the schematic.
I'm glad they like the idea.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: RPN Calculator - Reverse Polish Notation

Postby DigitalWhiteByte on Mon Jan 02, 2012 8:27 am

cyto wrote:Is there a future for SM in the field of finance? ;)


oohhh, yes
If only he had the chance to have a socket server and client UDP oTCP ....
perhaps I have already seen, in an other software .... can not remember the name though
:)
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: RPN Calculator - Reverse Polish Notation

Postby mwvdlee on Wed Jan 04, 2012 5:55 pm

DigitalWhiteByte wrote:RPN Calculator

Nice!
I've done math expression parsers in most languages I used and planned to do one in SM a few years ago, but never got beyond the planning stage.
A lot of it still doesn't seem to work though; anything complex or recursive seems to give "Error" in the RPN output.
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: RPN Calculator - Reverse Polish Notation

Postby DigitalWhiteByte on Wed Jan 04, 2012 6:17 pm

mwvdlee wrote:
DigitalWhiteByte wrote:RPN Calculator

Nice!
I've done math expression parsers in most languages I used and planned to do one in SM a few years ago, but never got beyond the planning stage.
A lot of it still doesn't seem to work though; anything complex or recursive seems to give "Error" in the RPN output.

THX
Recursive math implemented for now, is only FRACTIONAL n!, in rpn only use simbol ! before number.
For complex calculations, we must integrate the mathematical process, not implemented for now.
but the module is fully upgradeable, I'm trying to create a simple tutorial to help everyone to expand the mathematical functions.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: RPN Calculator - Reverse Polish Notation

Postby stw on Fri Jan 06, 2012 12:11 pm

Hi,
here's a first approach for the calculators use as a function plotter. Maybe a starter for further improvements.
No guarantee that it's bugfree!
Hope you like it!

Cheers

capture.png
capture.png (43.89 KiB) Viewed 866 times

RPN_Infix_to_Postfix_DWB-stw-plot.osm
(64.42 KiB) Downloaded 60 times


EDIT: Ups... i failed. Detected a wrong link to the result float display. Fixed version upped.
stw
smanatic
 
Posts: 639
Joined: Mon Jun 30, 2008 2:55 pm

Re: RPN Calculator - Reverse Polish Notation

Postby DigitalWhiteByte on Wed Jan 11, 2012 10:38 pm

stw@ good implementation.

I updated the version, with the support of variables, like x, y, z
a tip:
the power is calculated as follows: pow (n, n)
Attachments
RPN_Infix_to_Postfix_DWB_v1.0.1.osm
Update: added support variable
(29.51 KiB) Downloaded 49 times
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: RPN Calculator - Reverse Polish Notation

Postby trogluddite on Wed Jan 11, 2012 10:53 pm

:o ! (lost for words).
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3024
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: RPN Calculator - Reverse Polish Notation

Postby stw on Thu Jan 12, 2012 7:47 am

DigitalWhiteByte wrote:I updated the version, with the support of variables, like x, y, z

Yes, why not teaching us beeing fools... ;)
Really great work!
stw
smanatic
 
Posts: 639
Joined: Mon Jun 30, 2008 2:55 pm

Re: RPN Calculator - Reverse Polish Notation

Postby mwvdlee on Thu Jan 12, 2012 10:45 am

stw wrote:
DigitalWhiteByte wrote:I updated the version, with the support of variables, like x, y, z

Yes, why not teaching us beeing fools... ;)
Really great work!

So guys.... how about some mathematical music composition and/or synth?
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL


Return to Examples

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron