├── .gitignore ├── .travis.yml ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── COPYING ├── COPYING.LESSER ├── CRUFT.md ├── Cargo.toml ├── OBJECTS.txt ├── README.md ├── pd-patches ├── README ├── mic_am220.pd ├── simple_osc.pd └── unittests │ ├── MessagePrint.pd │ ├── SendReceive.pd │ ├── audio.one-second.pd │ ├── golden │ ├── MessagePrint.txt │ ├── SendReceive.txt │ └── mod_rem.txt │ ├── mod_rem.pd │ ├── pack.pd │ └── unpack.pd ├── purezen.png ├── src ├── ArrayArithmetic.h ├── BufferPool.cpp ├── BufferPool.h ├── DeclareList.cpp ├── DeclareList.h ├── DelayReceiver.cpp ├── DelayReceiver.h ├── DspAdc.cpp ├── DspAdc.h ├── DspAdd.cpp ├── DspAdd.h ├── DspBandpassFilter.cpp ├── DspBandpassFilter.h ├── DspBang.cpp ├── DspBang.h ├── DspCatch.cpp ├── DspCatch.h ├── DspClip.cpp ├── DspClip.h ├── DspCosine.cpp ├── DspCosine.h ├── DspDac.cpp ├── DspDac.h ├── DspDelayRead.cpp ├── DspDelayRead.h ├── DspDelayWrite.cpp ├── DspDelayWrite.h ├── DspDivide.cpp ├── DspDivide.h ├── DspEnvelope.cpp ├── DspEnvelope.h ├── DspFilter.cpp ├── DspFilter.h ├── DspHighpassFilter.cpp ├── DspHighpassFilter.h ├── DspImplicitAdd.cpp ├── DspImplicitAdd.h ├── DspInlet.cpp ├── DspInlet.h ├── DspLetIndex.h ├── DspLine.cpp ├── DspLine.h ├── DspLog.cpp ├── DspLog.h ├── DspLowpassFilter.cpp ├── DspLowpassFilter.h ├── DspMinimum.cpp ├── DspMinimum.h ├── DspMultiply.cpp ├── DspMultiply.h ├── DspNoise.cpp ├── DspNoise.h ├── DspObject.cpp ├── DspObject.h ├── DspOsc.cpp ├── DspOsc.h ├── DspOutlet.cpp ├── DspOutlet.h ├── DspPhasor.cpp ├── DspPhasor.h ├── DspPrint.cpp ├── DspPrint.h ├── DspReceive.cpp ├── DspReceive.h ├── DspReciprocalSqrt.cpp ├── DspReciprocalSqrt.h ├── DspRfft.cpp ├── DspRfft.h ├── DspRifft.cpp ├── DspRifft.h ├── DspSend.cpp ├── DspSend.h ├── DspSignal.cpp ├── DspSignal.h ├── DspSnapshot.cpp ├── DspSnapshot.h ├── DspSqrt.cpp ├── DspSqrt.h ├── DspSubtract.cpp ├── DspSubtract.h ├── DspTablePlay.cpp ├── DspTablePlay.h ├── DspTableRead.cpp ├── DspTableRead.h ├── DspTableRead4.cpp ├── DspTableRead4.h ├── DspThrow.cpp ├── DspThrow.h ├── DspVCF.cpp ├── DspVCF.h ├── DspVariableDelay.cpp ├── DspVariableDelay.h ├── DspVariableLine.cpp ├── DspVariableLine.h ├── DspWrap.cpp ├── DspWrap.h ├── MersenneTwister.h ├── MessageAbsoluteValue.cpp ├── MessageAbsoluteValue.h ├── MessageAdd.cpp ├── MessageAdd.h ├── MessageArcTangent.cpp ├── MessageArcTangent.h ├── MessageArcTangent2.cpp ├── MessageArcTangent2.h ├── MessageBang.cpp ├── MessageBang.h ├── MessageChange.cpp ├── MessageChange.h ├── MessageClip.cpp ├── MessageClip.h ├── MessageCosine.cpp ├── MessageCosine.h ├── MessageCputime.cpp ├── MessageCputime.h ├── MessageDbToPow.cpp ├── MessageDbToPow.h ├── MessageDbToRms.cpp ├── MessageDbToRms.h ├── MessageDeclare.cpp ├── MessageDeclare.h ├── MessageDelay.cpp ├── MessageDelay.h ├── MessageDiv.cpp ├── MessageDiv.h ├── MessageDivide.cpp ├── MessageDivide.h ├── MessageEqualsEquals.cpp ├── MessageEqualsEquals.h ├── MessageExp.cpp ├── MessageExp.h ├── MessageFloat.cpp ├── MessageFloat.h ├── MessageFrequencyToMidi.cpp ├── MessageFrequencyToMidi.h ├── MessageGreaterThan.cpp ├── MessageGreaterThan.h ├── MessageGreaterThanOrEqualTo.cpp ├── MessageGreaterThanOrEqualTo.h ├── MessageInlet.cpp ├── MessageInlet.h ├── MessageInteger.cpp ├── MessageInteger.h ├── MessageLessThan.cpp ├── MessageLessThan.h ├── MessageLessThanOrEqualTo.cpp ├── MessageLessThanOrEqualTo.h ├── MessageLetIndex.h ├── MessageLetPair.h ├── MessageLine.cpp ├── MessageLine.h ├── MessageListAppend.cpp ├── MessageListAppend.h ├── MessageListLength.cpp ├── MessageListLength.h ├── MessageListPrepend.cpp ├── MessageListPrepend.h ├── MessageListSplit.cpp ├── MessageListSplit.h ├── MessageListTrim.cpp ├── MessageListTrim.h ├── MessageLoadbang.cpp ├── MessageLoadbang.h ├── MessageLog.cpp ├── MessageLog.h ├── MessageLogicalAnd.cpp ├── MessageLogicalAnd.h ├── MessageLogicalOr.cpp ├── MessageLogicalOr.h ├── MessageMakefilename.cpp ├── MessageMakefilename.h ├── MessageMaximum.cpp ├── MessageMaximum.h ├── MessageMessageBox.cpp ├── MessageMessageBox.h ├── MessageMetro.cpp ├── MessageMetro.h ├── MessageMidiToFrequency.cpp ├── MessageMidiToFrequency.h ├── MessageMinimum.cpp ├── MessageMinimum.h ├── MessageModulus.cpp ├── MessageModulus.h ├── MessageMoses.cpp ├── MessageMoses.h ├── MessageMultiply.cpp ├── MessageMultiply.h ├── MessageNamedDestination.h ├── MessageNotEquals.cpp ├── MessageNotEquals.h ├── MessageNotein.cpp ├── MessageNotein.h ├── MessageOpenPanel.cpp ├── MessageOpenPanel.h ├── MessageOutlet.cpp ├── MessageOutlet.h ├── MessagePack.cpp ├── MessagePack.h ├── MessagePipe.cpp ├── MessagePipe.h ├── MessagePow.cpp ├── MessagePow.h ├── MessagePowToDb.cpp ├── MessagePowToDb.h ├── MessagePrint.cpp ├── MessagePrint.h ├── MessageRandom.cpp ├── MessageRandom.h ├── MessageReceive.cpp ├── MessageReceive.h ├── MessageRemainder.cpp ├── MessageRemainder.h ├── MessageRmsToDb.cpp ├── MessageRmsToDb.h ├── MessageRoute.cpp ├── MessageRoute.h ├── MessageSamplerate.cpp ├── MessageSamplerate.h ├── MessageSelect.cpp ├── MessageSelect.h ├── MessageSine.cpp ├── MessageSine.h ├── MessageSoundfiler.cpp ├── MessageSoundfiler.h ├── MessageSpigot.cpp ├── MessageSpigot.h ├── MessageSqrt.cpp ├── MessageSqrt.h ├── MessageStripNote.cpp ├── MessageStripNote.h ├── MessageSubtract.cpp ├── MessageSubtract.h ├── MessageSwap.cpp ├── MessageSwap.h ├── MessageSwitch.cpp ├── MessageSwitch.h ├── MessageSymbol.cpp ├── MessageSymbol.h ├── MessageTable.cpp ├── MessageTable.h ├── MessageTableRead.cpp ├── MessageTableRead.h ├── MessageTableWrite.cpp ├── MessageTableWrite.h ├── MessageTangent.cpp ├── MessageTangent.h ├── MessageText.cpp ├── MessageText.h ├── MessageTimer.cpp ├── MessageTimer.h ├── MessageToggle.cpp ├── MessageToggle.h ├── MessageTrigger.cpp ├── MessageTrigger.h ├── MessageUnpack.cpp ├── MessageUnpack.h ├── MessageUntil.cpp ├── MessageUntil.h ├── MessageValue.cpp ├── MessageValue.h ├── MessageWrap.cpp ├── MessageWrap.h ├── ObjectFactoryMap.cpp ├── ObjectFactoryMap.h ├── OrderedMessageQueue.h ├── PdAbstractionDataBase.cpp ├── PdAbstractionDataBase.h ├── PdFileParser.cpp ├── PdFileParser.h ├── PdGraph.h ├── RemoteMessageReceiver.cpp ├── RemoteMessageReceiver.h ├── TableReceiverInterface.h ├── ZGCallbackFunction.h ├── ZenGarden.cpp ├── ZenGarden.h ├── allocator │ ├── fixed_size.rs │ └── mod.rs ├── error.rs ├── lib.rs ├── list.rs ├── message │ ├── element.rs │ ├── mod.rs │ ├── object │ │ ├── connection │ │ │ ├── list.rs │ │ │ ├── mod.rs │ │ │ └── table.rs │ │ ├── coordinates.rs │ │ ├── mod.rs │ │ └── types.rs │ ├── queue.rs │ ├── send │ │ ├── controller.rs │ │ └── mod.rs │ ├── symbol.rs │ └── timestamp.rs ├── pd │ ├── context.rs │ ├── graph.rs │ ├── message │ │ ├── atom.rs │ │ └── mod.rs │ └── mod.rs ├── prelude.rs └── utils.rs └── test ├── MessageAbsoluteValue.golden.txt ├── MessageAbsoluteValue.pd ├── MessageAdd.golden.txt ├── MessageAdd.pd ├── MessageArcTangent.golden.txt ├── MessageArcTangent.pd ├── MessageArcTangent2.golden.txt ├── MessageArcTangent2.pd ├── MessageBang.golden.txt ├── MessageBang.pd ├── MessageChange.golden.txt ├── MessageChange.pd ├── MessageClip.golden.txt ├── MessageClip.pd ├── MessageCosine.golden.txt ├── MessageCosine.pd ├── MessageDbToPow.golden.txt ├── MessageDbToPow.pd ├── MessageDbToRms.golden.txt ├── MessageDbToRms.pd ├── MessageDelay.golden.txt ├── MessageDelay.pd ├── MessageDiv.golden.txt ├── MessageDiv.pd ├── MessageDivide.golden.txt ├── MessageDivide.pd ├── MessageEqualsEquals.golden.txt ├── MessageEqualsEquals.pd ├── MessageExp.golden.txt ├── MessageExp.pd ├── MessageFloat.golden.txt ├── MessageFloat.pd ├── MessageFrequencyToMidi.golden.txt ├── MessageFrequencyToMidi.pd ├── MessageGreaterThan.golden.txt ├── MessageGreaterThan.pd ├── MessageGreaterThanOrEqualTo.golden.txt ├── MessageGreaterThanOrEqualTo.pd ├── MessageInletOutlet.golden.txt ├── MessageInletOutlet.pd ├── MessageInteger.golden.txt ├── MessageInteger.pd ├── MessageLessThan.golden.txt ├── MessageLessThan.pd ├── MessageLessThanOrEqualTo.golden.txt ├── MessageLessThanOrEqualTo.pd ├── MessageLine.golden.txt ├── MessageLine.pd ├── MessageListAppend.golden.txt ├── MessageListAppend.pd ├── MessageListLength.golden.txt ├── MessageListLength.pd ├── MessageLoadbang.golden.txt ├── MessageLoadbang.pd ├── MessageLog.golden.txt ├── MessageLog.pd ├── MessageLogicalAnd.golden.txt ├── MessageLogicalAnd.pd ├── MessageLogicalOr.golden.txt ├── MessageLogicalOr.pd ├── MessageMakefilename.golden.txt ├── MessageMakefilename.pd ├── MessageMaximum.golden.txt ├── MessageMaximum.pd ├── MessageMessageBox.golden.txt ├── MessageMessageBox.pd ├── MessageMetro.golden.txt ├── MessageMetro.pd ├── MessageMidiToFrequency.golden.txt ├── MessageMidiToFrequency.pd ├── MessageMinimum.golden.txt ├── MessageMinimum.pd ├── MessageModulus.golden.txt ├── MessageModulus.pd ├── MessageMoses.golden.txt ├── MessageMoses.pd ├── MessageMultiply.golden.txt ├── MessageMultiply.pd ├── MessageNotEquals.golden.txt ├── MessageNotEquals.pd ├── MessagePack.golden.txt ├── MessagePack.pd ├── MessagePipe.golden.txt ├── MessagePipe.pd ├── MessagePow.golden.txt ├── MessagePow.pd ├── MessagePowToDb.golden.txt ├── MessagePowToDb.pd ├── MessagePrint.golden.txt ├── MessagePrint.pd ├── MessageRandom.golden.txt ├── MessageRandom.pd ├── MessageReceive.golden.txt ├── MessageReceive.pd ├── MessageRemainder.golden.txt ├── MessageRemainder.pd ├── MessageRmsToDb.golden.txt ├── MessageRmsToDb.pd ├── MessageRoute.golden.txt ├── MessageRoute.pd ├── MessageSelect.golden.txt ├── MessageSelect.pd ├── MessageSend.golden.txt ├── MessageSend.pd ├── MessageSend_variable.golden.txt ├── MessageSend_variable.pd ├── MessageSine.golden.txt ├── MessageSine.pd ├── MessageSpigot.golden.txt ├── MessageSpigot.pd ├── MessageSqrt.golden.txt ├── MessageSqrt.pd ├── MessageSubtract.golden.txt ├── MessageSubtract.pd ├── MessageSwap.golden.txt ├── MessageSwap.pd ├── MessageSymbol.golden.txt ├── MessageSymbol.pd ├── MessageTable.golden.txt ├── MessageTable.pd ├── MessageTangent.golden.txt ├── MessageTangent.pd ├── MessageTimer.golden.txt ├── MessageTimer.pd ├── MessageToggle.golden.txt ├── MessageToggle.pd ├── MessageTrigger.golden.txt ├── MessageTrigger.pd ├── MessageUnpack.golden.txt ├── MessageUnpack.pd ├── MessageUntil.golden.txt ├── MessageUntil.pd ├── MessageValue.golden.txt ├── MessageValue.pd ├── MessageWrap.golden.txt ├── MessageWrap.pd ├── RegisterReceiver.pd ├── dsp ├── DspCos.golden.wav ├── DspCos.pd ├── DspInletOutlet.pd ├── DspLine.pd ├── DspOsc.golden.wav ├── DspOsc.pd ├── DspPhasorSignal.golden.wav ├── DspPhasorSignal.pd ├── DspSendReceive.pd ├── DspThrowCatch.pd ├── DspWrap.golden.wav └── DspWrap.pd ├── multiple-receiver-test.golden.txt └── multiple-receiver-test.pd /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | Cargo.lock 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | rust: stable 3 | os: linux 4 | cache: cargo 5 | 6 | branches: 7 | only: 8 | - master 9 | 10 | install: 11 | - rustup component add rustfmt 12 | - rustup component add clippy 13 | - rustup target add thumbv7em-none-eabihf # for NeoTrellis M4's SAMD51 14 | 15 | matrix: 16 | include: 17 | - name: rustfmt 18 | script: 19 | - cargo fmt -- --check 20 | - name: clippy 21 | script: 22 | - cargo clippy 23 | - name: build 24 | script: 25 | - cargo build --no-default-features --release 26 | - cargo build --release 27 | - name: build (thumbv7em-none-eabihf target) 28 | script: 29 | - cargo build --target thumbv7em-none-eabihf --no-default-features 30 | - cargo build --target thumbv7em-none-eabihf --no-default-features --release 31 | - name: test 32 | script: 33 | - cargo test --no-default-features 34 | - cargo test 35 | - cargo test --no-default-features --release 36 | - cargo test --release 37 | - name: doc build 38 | script: 39 | - cargo doc --all --no-deps 40 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | ## [v0.0.2] (2019-02-20) 2 | 3 | - Translate `pd::Context`, `message::Send`, and `message::send::Controller` 4 | into Rust ([#16]) 5 | 6 | ## [v0.0.1] (2019-02-19) 7 | 8 | - Initial release 9 | 10 | [v0.0.2]: https://github.com/NeoBirth/PureZen/pull/17 11 | [#16]: https://github.com/NeoBirth/PureZen/pull/16 12 | [v0.0.1]: https://github.com/NeoBirth/PureZen/pull/14 13 | -------------------------------------------------------------------------------- /CRUFT.md: -------------------------------------------------------------------------------- 1 | # Cruft Tracking 2 | 3 | Stuff we'd like to refactor, but aren't for now until the whole thing is 4 | translated, compiling, and passing tests 5 | 6 | ## `message::symbol` 7 | 8 | - "Intern" all symbol strings into an internal symbol cache with integer IDs 9 | 10 | ## `pd::message` 11 | 12 | - `is_float`/`is_symbol` etc should be moved to `pd::message::atom::Atom` 13 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "purezen" 3 | version = "0.0.2" # Also update html_root_url in lib.rs when bumping this 4 | authors = ["Tony Arcieri ", "Martin Roth "] 5 | license = "LGPL-3.0" 6 | edition = "2018" 7 | readme = "README.md" 8 | repository = "https://github.com/neobirth/purezen" 9 | categories = ["embedded", "multimedia::audio", "no-std"] 10 | keywords = ["audio", "music", "puredata", "signal-processing", "sound"] 11 | description = """ 12 | Runtime for the Pure Data (Pd) audio programming language, 13 | implemented as an extensible audio library allowing full control 14 | over signal processing, message passing, and graph manipulation. 15 | Pure Data is a graph-based programming language environment 16 | creating interactive music and multimedia works. 17 | """ 18 | 19 | [badges] 20 | travis-ci = { repository = "NeoBirth/PureZen" } 21 | 22 | [dependencies] 23 | failure = { version = "0.1", default-features = false } 24 | failure_derive = "0.1" 25 | generic-array = "0.11" 26 | heapless = "0.4" 27 | typenum = { version = "1", default-features = false } 28 | 29 | [features] 30 | default = ["std"] 31 | alloc = [] 32 | std = ["alloc"] 33 | -------------------------------------------------------------------------------- /pd-patches/README: -------------------------------------------------------------------------------- 1 | Example Pd patches live in here. 2 | unittests/ holds Pd patches we use for unit testing. 3 | -------------------------------------------------------------------------------- /pd-patches/mic_am220.pd: -------------------------------------------------------------------------------- 1 | #N canvas 602 100 450 300 10; 2 | #X obj 165 88 adc~; 3 | #X obj 177 211 dac~; 4 | #X obj 184 156 *~; 5 | #X obj 214 88 osc~ 220; 6 | #X connect 0 0 2 0; 7 | #X connect 0 1 2 0; 8 | #X connect 2 0 1 0; 9 | #X connect 2 0 1 1; 10 | #X connect 3 0 2 1; 11 | -------------------------------------------------------------------------------- /pd-patches/simple_osc.pd: -------------------------------------------------------------------------------- 1 | #N canvas 359 80 450 300 10; 2 | #X obj 150 60 osc~ 440; 3 | #X obj 145 116 dac~; 4 | #X connect 0 0 1 0; 5 | #X connect 0 0 1 1; 6 | -------------------------------------------------------------------------------- /pd-patches/unittests/MessagePrint.pd: -------------------------------------------------------------------------------- 1 | #N canvas 657 346 454 211 10; 2 | #X obj 16 5 loadbang; 3 | #X msg 158 111 walk the dog; 4 | #X msg 82 111 bang; 5 | #X msg 123 111 234; 6 | #X obj 124 155 print x1; 7 | #X obj 47 155 print -n; 8 | #X msg 272 111 3.14; 9 | #X msg 48 111 1; 10 | #X msg 328 111 test; 11 | #X obj 328 155 print; 12 | #X obj 48 49 t b b b b b b; 13 | #X obj 16 26 t b b; 14 | #X connect 0 0 11 0; 15 | #X connect 1 0 4 0; 16 | #X connect 2 0 4 0; 17 | #X connect 3 0 4 0; 18 | #X connect 6 0 4 0; 19 | #X connect 7 0 5 0; 20 | #X connect 8 0 9 0; 21 | #X connect 10 0 7 0; 22 | #X connect 10 1 2 0; 23 | #X connect 10 2 3 0; 24 | #X connect 10 3 1 0; 25 | #X connect 10 4 6 0; 26 | #X connect 10 5 8 0; 27 | #X connect 11 1 10 0; 28 | -------------------------------------------------------------------------------- /pd-patches/unittests/SendReceive.pd: -------------------------------------------------------------------------------- 1 | #N canvas 453 179 442 142 10; 2 | #X obj 16 5 loadbang; 3 | #X obj 16 26 t b b b; 4 | #X obj 62 56 print start; 5 | #X obj 39 84 s distant; 6 | #X obj 16 117 print end; 7 | #X obj 174 12 r distant; 8 | #X obj 326 11 r distant; 9 | #X obj 326 32 print distant2; 10 | #X obj 174 33 t b b; 11 | #X obj 174 76 print distant1-2; 12 | #X obj 206 55 print distant1-1; 13 | #X connect 0 0 1 0; 14 | #X connect 1 0 4 0; 15 | #X connect 1 1 3 0; 16 | #X connect 1 2 2 0; 17 | #X connect 5 0 8 0; 18 | #X connect 6 0 7 0; 19 | #X connect 8 0 9 0; 20 | #X connect 8 1 10 0; 21 | -------------------------------------------------------------------------------- /pd-patches/unittests/audio.one-second.pd: -------------------------------------------------------------------------------- 1 | #N canvas 377 266 450 300 10; 2 | #X obj 15 44 loadbang; 3 | #N canvas 0 0 450 300 (subpatch) 0; 4 | #X array output 4096 float 2; 5 | #X coords 0 1 4095 -1 200 140 1; 6 | #X restore 239 47 graph; 7 | #X obj 15 64 t b b; 8 | #X obj 15 84 \$1; 9 | #X text 12 7 Intended to test audio units \, this patch will write 10 | 1 seconds worth of samples \, and print them.; 11 | #X obj 15 198 print~; 12 | #X obj 46 84 delay 1000; 13 | #X msg 46 105 \; pd quit \;; 14 | #X connect 0 0 2 0; 15 | #X connect 2 0 3 0; 16 | #X connect 2 1 6 0; 17 | #X connect 3 0 5 0; 18 | #X connect 6 0 7 0; 19 | -------------------------------------------------------------------------------- /pd-patches/unittests/golden/MessagePrint.txt: -------------------------------------------------------------------------------- 1 | print: test 2 | x1: 3.14 3 | x1: walk the dog 4 | x1: 234 5 | x1: bang 6 | 1 7 | closing audio... 8 | closing MIDI... 9 | ... done. 10 | -------------------------------------------------------------------------------- /pd-patches/unittests/golden/SendReceive.txt: -------------------------------------------------------------------------------- 1 | start: bang 2 | distant2: bang 3 | distant1-1: bang 4 | distant1-2: bang 5 | end: bang 6 | -------------------------------------------------------------------------------- /pd-patches/unittests/golden/mod_rem.txt: -------------------------------------------------------------------------------- 1 | mod: 1 %: 1 mod: 1 %: 1 mod: 2 %: -1 mod: 2 %: -1 -------------------------------------------------------------------------------- /pd-patches/unittests/mod_rem.pd: -------------------------------------------------------------------------------- 1 | #N canvas 302 22 760 533 10; 2 | #X obj 149 35 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 184 27 loadbang; 5 | #X obj 164 77 t b b b b; 6 | #X obj 392 145 f 10; 7 | #X obj 392 223 % 3; 8 | #X obj 446 224 mod 3; 9 | #X obj 246 309 print mod; 10 | #X obj 183 308 print %; 11 | #X obj 313 222 mod -3; 12 | #X obj 259 221 % -3; 13 | #X obj 259 143 f 10; 14 | #X obj 139 142 f -10; 15 | #X obj 193 221 mod 3; 16 | #X obj 139 220 % 3; 17 | #X obj 35 142 f -10; 18 | #X obj 35 220 % -3; 19 | #X obj 80 221 mod -3; 20 | #X obj 399 184 t f f; 21 | #X obj 272 179 t f f; 22 | #X obj 46 178 t f f; 23 | #X obj 149 180 t f f; 24 | #X text 293 35 This test ensures that modulus and remainder objects 25 | are working properly.; 26 | #X connect 0 0 2 0; 27 | #X connect 1 0 2 0; 28 | #X connect 2 0 14 0; 29 | #X connect 2 1 11 0; 30 | #X connect 2 2 10 0; 31 | #X connect 2 3 3 0; 32 | #X connect 3 0 17 0; 33 | #X connect 4 0 7 0; 34 | #X connect 5 0 6 0; 35 | #X connect 8 0 6 0; 36 | #X connect 9 0 7 0; 37 | #X connect 10 0 18 0; 38 | #X connect 11 0 20 0; 39 | #X connect 12 0 6 0; 40 | #X connect 13 0 7 0; 41 | #X connect 14 0 19 0; 42 | #X connect 15 0 7 0; 43 | #X connect 16 0 6 0; 44 | #X connect 17 0 4 0; 45 | #X connect 17 1 5 0; 46 | #X connect 18 0 9 0; 47 | #X connect 18 1 8 0; 48 | #X connect 19 0 15 0; 49 | #X connect 19 1 16 0; 50 | #X connect 20 0 13 0; 51 | #X connect 20 1 12 0; 52 | -------------------------------------------------------------------------------- /pd-patches/unittests/pack.pd: -------------------------------------------------------------------------------- 1 | #N canvas 245 208 450 300 10; 2 | #X obj 102 16 loadbang; 3 | #X obj 109 117 pack 1 2 s 4; 4 | #X obj 88 70 f 44; 5 | #X obj 139 66 f 45; 6 | #X obj 202 67 symbol cat; 7 | #X obj 323 83 f 66; 8 | #X obj 112 161 print aa; 9 | #X obj 184 11 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 10 | -1; 11 | #X connect 0 0 5 0; 12 | #X connect 0 0 4 0; 13 | #X connect 0 0 3 0; 14 | #X connect 0 0 2 0; 15 | #X connect 1 0 6 0; 16 | #X connect 2 0 1 0; 17 | #X connect 3 0 1 1; 18 | #X connect 4 0 1 2; 19 | #X connect 5 0 1 3; 20 | #X connect 7 0 2 0; 21 | -------------------------------------------------------------------------------- /pd-patches/unittests/unpack.pd: -------------------------------------------------------------------------------- 1 | #N canvas 768 371 450 280 10; 2 | #X obj 98 8 loadbang; 3 | #X obj 32 187 print aa; 4 | #X obj 204 33 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 201 93 1 cat 2 2; 7 | #X obj 109 145 unpack 1 s 2 2; 8 | #X obj 106 208 print bb; 9 | #X obj 204 206 print cc; 10 | #X obj 297 195 print dd; 11 | #X connect 0 0 3 0; 12 | #X connect 2 0 3 0; 13 | #X connect 3 0 4 0; 14 | #X connect 4 0 1 0; 15 | #X connect 4 1 5 0; 16 | #X connect 4 2 6 0; 17 | #X connect 4 3 7 0; 18 | -------------------------------------------------------------------------------- /purezen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoBirth/PureZen/be8c3cc8ae88b6467da1ec86811cad4920683d08/purezen.png -------------------------------------------------------------------------------- /src/DelayReceiver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "DelayReceiver.h" 24 | 25 | DelayReceiver::DelayReceiver(int numMessageInlets, int numDspInlets, int numMessageOutlets, int numDspOutlets, PdGraph *graph) : 26 | DspObject(numMessageInlets, numDspInlets, numMessageOutlets, numDspOutlets, graph) { 27 | name = NULL; 28 | delayline = NULL; 29 | } 30 | 31 | DelayReceiver::~DelayReceiver() { 32 | free(name); 33 | } 34 | 35 | const char *DelayReceiver::get_name() { 36 | return name; 37 | } 38 | 39 | void DelayReceiver::set_delay_line(DspDelayWrite *delayline) { 40 | this->delayline = delayline; 41 | } 42 | -------------------------------------------------------------------------------- /src/DspAdc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2011,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "DspAdc.h" 24 | #include "PdGraph.h" 25 | 26 | message::Object *DspAdc::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new DspAdc(graph); 28 | } 29 | 30 | DspAdc::DspAdc(PdGraph *graph) : DspObject(0, 0, 0, graph->get_num_input_channels(), graph) { 31 | // nothing to do 32 | } 33 | 34 | DspAdc::~DspAdc() { 35 | // nothing to do 36 | } 37 | 38 | float *DspAdc::get_dsp_buffer_at_outlet(int outlet_index) { 39 | return graph->get_global_dsp_buffer_at_inlet(outlet_index); 40 | } 41 | -------------------------------------------------------------------------------- /src/DspBang.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_BANG_H_ 24 | #define _DSP_BANG_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | /** [bang~] */ 29 | class DspBang : public DspObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | DspBang(PdMessage *init_message, PdGraph *graph); 34 | ~DspBang(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | connection::Type get_connection_type(int outlet_index) { return MESSAGE; } 40 | 41 | private: 42 | static void processDsp(DspObject *dspObject, int fromIndex, int toIndex); 43 | }; 44 | 45 | inline std::string DspBang::toString() { 46 | return DspBang::get_object_label(); 47 | } 48 | 49 | inline const char *DspBang::get_object_label() { 50 | return "bang~"; 51 | } 52 | 53 | #endif // _DSP_BANG_H_ 54 | -------------------------------------------------------------------------------- /src/DspClip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_CLIP_H_ 24 | #define _DSP_CLIP_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | /** [clip~ float float] */ 29 | class DspClip : public DspObject { 30 | public: 31 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 32 | DspClip(PdMessage *init_message, PdGraph *graph); 33 | ~DspClip(); 34 | 35 | static const char *get_object_label(); 36 | std::string toString(); 37 | 38 | private: 39 | static void processScalar(DspObject *dspObject, int fromIndex, int toIndex); 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float lowerBound; 43 | float upperBound; 44 | }; 45 | 46 | inline const char *DspClip::get_object_label() { 47 | return "clip~"; 48 | } 49 | 50 | #endif // _DSP_CLIP_H_ 51 | -------------------------------------------------------------------------------- /src/DspDac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_DAC_H_ 24 | #define _DSP_DAC_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | class DspDac : public DspObject { 29 | 30 | public: 31 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 32 | DspDac(PdGraph *graph); 33 | ~DspDac(); 34 | 35 | static const char *get_object_label(); 36 | std::string toString(); 37 | 38 | private: 39 | static void processSignal(DspObject *dspObject, int fromIndex, int toIndex); 40 | }; 41 | 42 | inline std::string DspDac::toString() { 43 | return DspDac::get_object_label(); 44 | } 45 | 46 | inline const char *DspDac::get_object_label() { 47 | return "dac~"; 48 | } 49 | 50 | #endif // _DSP_DAC_H_ 51 | -------------------------------------------------------------------------------- /src/DspFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011,2012 ZenGarden. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_FILTER_H_ 24 | #define _DSP_FILTER_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | /** The superclass of lop~, hip~, bp~, and biquad~ */ 29 | class DspFilter : public DspObject { 30 | 31 | public: 32 | DspFilter(int numMessageInlets, PdGraph *graph); 33 | ~DspFilter(); 34 | 35 | void onInletConnectionUpdate(unsigned int inlet_index); 36 | 37 | protected: 38 | static void processFilter(DspObject *dspObject, int fromIndex, int toIndex); 39 | 40 | float x1, x2, y1, y2; 41 | float b[5]; // filter coefficients 42 | }; 43 | 44 | #endif // _DSP_FILTER_H_ 45 | -------------------------------------------------------------------------------- /src/DspImplicitAdd.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "ArrayArithmetic.h" 24 | #include "DspImplicitAdd.h" 25 | 26 | message::Object *DspImplicitAdd::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new DspImplicitAdd(init_message, graph); 28 | } 29 | 30 | DspImplicitAdd::DspImplicitAdd(pd::Message *init_message, PdGraph *graph) : DspObject(0, 2, 0, 1, graph) { 31 | process_function = &processSignal; 32 | } 33 | 34 | DspImplicitAdd::~DspImplicitAdd() { 35 | // nothing to do 36 | } 37 | 38 | void DspImplicitAdd::processSignal(DspObject *dspObject, int fromIndex, int toIndex) { 39 | DspImplicitAdd *d = reinterpret_cast(dspObject); 40 | ArrayArithmetic::add(d->dspBufferAtInlet[0], d->dspBufferAtInlet[1], d->dspBufferAtOutlet[0], 0, toIndex); 41 | } 42 | -------------------------------------------------------------------------------- /src/DspLetIndex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_INDEX_H_ 24 | #define _DSP_INDEX_H_ 25 | 26 | class DspOutputObject; 27 | 28 | /** 29 | * Defines a simple struct to combine a DspObject and an inlet/outlet index 30 | */ 31 | typedef struct { 32 | DspOutputObject *dspObject; 33 | int letIndex; 34 | } DspLetIndex; 35 | 36 | #endif // _DSP_INDEX_H_ 37 | -------------------------------------------------------------------------------- /src/DspNoise.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "DspNoise.h" 24 | #include "MersenneTwister.h" 25 | 26 | message::Object *DspNoise::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new DspNoise(graph); 28 | } 29 | 30 | DspNoise::DspNoise(PdGraph *graph) : DspObject(1, 0, 0, 1, graph) { 31 | twister = new MTRand(); // use new seed 32 | process_function = &processSignal; 33 | } 34 | 35 | DspNoise::~DspNoise() { 36 | delete twister; 37 | } 38 | 39 | void DspNoise::processSignal(DspObject *dspObject, int fromIndex, int toIndex) { 40 | DspNoise *d = reinterpret_cast(dspObject); 41 | 42 | for (int i = 0; i < toIndex; i++) { 43 | d->dspBufferAtOutlet[0][i] = ((float) d->twister->rand(2.0)) - 1.0f; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/DspNoise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_NOISE_H_ 24 | #define _DSP_NOISE_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | class MTRand; 29 | class PdGraph; 30 | 31 | /** [noise~] */ 32 | class DspNoise : public DspObject { 33 | 34 | public: 35 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 36 | DspNoise(PdGraph *graph); 37 | ~DspNoise(); 38 | 39 | static const char *get_object_label(); 40 | std::string toString(); 41 | 42 | private: 43 | static void processSignal(DspObject *dspObject, int fromIndex, int toIndex); 44 | 45 | MTRand *twister; 46 | }; 47 | 48 | inline std::string DspNoise::toString() { 49 | return DspNoise::get_object_label(); 50 | } 51 | 52 | inline const char *DspNoise::get_object_label() { 53 | return "noise~"; 54 | } 55 | 56 | #endif // _DSP_NOISE_H_ 57 | -------------------------------------------------------------------------------- /src/DspSignal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_SIGNAL_H_ 24 | #define _DSP_SIGNAL_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | /** [sig~] */ 29 | class DspSignal : public DspObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | DspSignal(PdMessage *init_message, PdGraph *graph); 34 | ~DspSignal(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | static void processScalar(DspObject *dspObject, int fromIndex, int toIndex); 41 | void process_message(int inlet_index, PdMessage *message); 42 | 43 | float constant; 44 | }; 45 | 46 | inline const char *DspSignal::get_object_label() { 47 | return "sig~"; 48 | } 49 | 50 | #endif // _DSP_SIGNAL_H_ 51 | -------------------------------------------------------------------------------- /src/DspSqrt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_SQRT_H_ 24 | #define _DSP_SQRT_H_ 25 | 26 | #include "ArrayArithmetic.h" 27 | #include "DspObject.h" 28 | 29 | /** [sqrt~], [q8_sqrt~] */ 30 | class DspSqrt : public DspObject { 31 | 32 | public: 33 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 34 | DspSqrt(PdMessage *init_message, PdGraph *graph); 35 | ~DspSqrt(); 36 | 37 | static const char *get_object_label(); 38 | std::string toString(); 39 | 40 | private: 41 | static void processSignal(DspObject *dspObject, int fromIndex, int toIndex); 42 | }; 43 | 44 | inline const char *DspSqrt::get_object_label() { 45 | return "sqrt~"; 46 | } 47 | 48 | inline std::string DspSqrt::toString() { 49 | return DspSqrt::get_object_label(); 50 | } 51 | 52 | #endif // _DSP_SQRT_H_ 53 | -------------------------------------------------------------------------------- /src/DspWrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2011,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _DSP_WRAP_H_ 24 | #define _DSP_WRAP_H_ 25 | 26 | #include "DspObject.h" 27 | 28 | /** [wrap~] */ 29 | class DspWrap : public DspObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | DspWrap(PdMessage *init_message, PdGraph *graph); 34 | ~DspWrap(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | static void processSignal(DspObject *dspObject, int fromIndex, int toIndex); 41 | }; 42 | 43 | inline std::string DspWrap::toString() { 44 | return DspWrap::get_object_label(); 45 | } 46 | 47 | inline const char *DspWrap::get_object_label() { 48 | return "wrap~"; 49 | } 50 | 51 | #endif // _DSP_WRAP_H_ 52 | -------------------------------------------------------------------------------- /src/MessageAbsoluteValue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageAbsoluteValue.h" 24 | 25 | message::Object *MessageAbsoluteValue::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageAbsoluteValue(init_message, graph); 27 | } 28 | 29 | MessageAbsoluteValue::MessageAbsoluteValue(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageAbsoluteValue::~MessageAbsoluteValue() { 34 | // nothing to do 35 | } 36 | 37 | void MessageAbsoluteValue::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), fabsf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageAdd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_ADD_H_ 24 | #define _MESSAGE_ADD_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [+], [+ float] */ 29 | class MessageAdd : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageAdd(PdMessage *init_message, PdGraph *graph); 34 | ~MessageAdd(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float last; 43 | float constant; 44 | }; 45 | 46 | inline const char *MessageAdd::get_object_label() { 47 | return "+"; 48 | } 49 | 50 | #endif // _MESSAGE_ADD_H_ 51 | -------------------------------------------------------------------------------- /src/MessageArcTangent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageArcTangent.h" 24 | 25 | message::Object *MessageArcTangent::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageArcTangent(init_message, graph); 27 | } 28 | 29 | MessageArcTangent::MessageArcTangent(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageArcTangent::~MessageArcTangent() { 34 | // nothing to do 35 | } 36 | 37 | void MessageArcTangent::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), atanf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageArcTangent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_ARCTANGENT_H_ 24 | #define _MESSAGE_ARCTANGENT_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [atan] */ 29 | class MessageArcTangent : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageArcTangent(PdMessage *init_message, PdGraph *graph); 34 | ~MessageArcTangent(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline std::string MessageArcTangent::toString() { 44 | return MessageArcTangent::get_object_label(); 45 | } 46 | 47 | inline const char *MessageArcTangent::get_object_label() { 48 | return "atan"; 49 | } 50 | 51 | #endif // _MESSAGE_ARCTANGENT_H_ 52 | 53 | -------------------------------------------------------------------------------- /src/MessageBang.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageBang.h" 24 | 25 | message::Object *MessageBang::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageBang(graph); 27 | } 28 | 29 | MessageBang::MessageBang(PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageBang::~MessageBang() { 34 | // nothing to do 35 | } 36 | 37 | void MessageBang::process_message(int inlet_index, pd::Message *message) { 38 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 39 | outgoing_message->from_timestamp_and_bang(message->get_timestamp()); 40 | send_message(0, outgoing_message); 41 | } 42 | -------------------------------------------------------------------------------- /src/MessageBang.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_BANG_H_ 24 | #define _MESSAGE_BANG_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [bang], [bng] */ 29 | class MessageBang : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageBang(PdGraph *graph); 34 | ~MessageBang(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline std::string MessageBang::toString() { 44 | return MessageBang::get_object_label(); 45 | } 46 | 47 | inline const char *MessageBang::get_object_label() { 48 | return "bang"; 49 | } 50 | 51 | #endif // _MESSAGE_BANG_H_ 52 | -------------------------------------------------------------------------------- /src/MessageChange.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_CHANGE_H_ 24 | #define _MESSAGE_CHANGE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [change] */ 29 | class MessageChange : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageChange(PdMessage *init_message, PdGraph *graph); 34 | ~MessageChange(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float prevValue; 43 | }; 44 | 45 | inline const char *MessageChange::get_object_label() { 46 | return "change"; 47 | } 48 | 49 | inline std::string MessageChange::toString() { 50 | return MessageChange::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_CHANGE_H_ 54 | -------------------------------------------------------------------------------- /src/MessageCosine.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageCosine.h" 24 | 25 | message::Object *MessageCosine::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageCosine(init_message, graph); 27 | } 28 | 29 | MessageCosine::MessageCosine(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageCosine::~MessageCosine() { 34 | // nothing to do 35 | } 36 | 37 | void MessageCosine::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), cosf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageCosine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_COSINE_H_ 24 | #define _MESSAGE_COSINE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [cos] */ 29 | class MessageCosine : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageCosine(PdMessage *init_message, PdGraph *graph); 34 | ~MessageCosine(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageCosine::get_object_label() { 44 | return "cos"; 45 | } 46 | 47 | inline std::string MessageCosine::toString() { 48 | return MessageCosine::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_COSINE_H_ 52 | -------------------------------------------------------------------------------- /src/MessageDbToPow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_DBTOPOW_H_ 24 | #define _MESSAGE_DBTOPOW_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [dbtopow] */ 29 | class MessageDbToPow : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageDbToPow(PdGraph *graph); 34 | ~MessageDbToPow(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageDbToPow::get_object_label() { 44 | return "dbtopow"; 45 | } 46 | 47 | inline std::string MessageDbToPow::toString() { 48 | return MessageDbToPow::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_DBTOPOW_H_ 52 | -------------------------------------------------------------------------------- /src/MessageDbToRms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_DBTORMS_H_ 24 | #define _MESSAGE_DBTORMS_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [dbtorms] */ 29 | class MessageDbToRms : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageDbToRms(PdGraph *graph); 34 | ~MessageDbToRms(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageDbToRms::get_object_label() { 44 | return "dbtorms"; 45 | } 46 | 47 | inline std::string MessageDbToRms::toString() { 48 | return MessageDbToRms::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_DBTORMS_H_ 52 | -------------------------------------------------------------------------------- /src/MessageDeclare.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageDeclare.h" 24 | 25 | message::Object *MessageDeclare::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageDeclare(init_message, graph); 27 | } 28 | 29 | MessageDeclare::MessageDeclare(pd::Message *init_message, PdGraph *graph) : message::Object(0, 0, graph) { 30 | target = init_message->is_symbol(0) ? utils::copy_string(init_message->get_symbol(0)) : NULL; 31 | argument = init_message->is_symbol(1) ? utils::copy_string(init_message->get_symbol(1)) : NULL; 32 | } 33 | 34 | MessageDeclare::~MessageDeclare() { 35 | free(target); 36 | free(argument); 37 | } 38 | -------------------------------------------------------------------------------- /src/MessageDiv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_DIV_H_ 24 | #define _MESSAGE_DIV_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [div] */ 29 | class MessageDiv : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageDiv(PdMessage *init_message, PdGraph *graph); 34 | ~MessageDiv(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; // should always be positive 43 | }; 44 | 45 | inline const char *MessageDiv::get_object_label() { 46 | return "div"; 47 | } 48 | 49 | inline std::string MessageDiv::toString() { 50 | return MessageDiv::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_DIVIDE_H_ 54 | -------------------------------------------------------------------------------- /src/MessageDivide.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_DIVIDE_H_ 24 | #define _MESSAGE_DIVIDE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [/], [/ float] */ 29 | class MessageDivide : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageDivide(PdMessage *init_message, PdGraph *graph); 34 | ~MessageDivide(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float last; 44 | }; 45 | 46 | inline const char *MessageDivide::get_object_label() { 47 | return "/"; 48 | } 49 | 50 | #endif // _MESSAGE_DIVIDE_H_ 51 | -------------------------------------------------------------------------------- /src/MessageExp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageExp.h" 24 | 25 | message::Object *MessageExp::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageExp(init_message, graph); 27 | } 28 | 29 | MessageExp::MessageExp(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageExp::~MessageExp() { 34 | // nothing to do 35 | } 36 | 37 | void MessageExp::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), expf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageExp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_EXP_H_ 24 | #define _MESSAGE_EXP_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [exp] */ 29 | class MessageExp : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageExp(PdMessage *init_message, PdGraph *graph); 34 | ~MessageExp(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageExp::get_object_label() { 44 | return "exp"; 45 | } 46 | 47 | inline std::string MessageExp::toString() { 48 | return MessageExp::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_EXP_H_ 52 | -------------------------------------------------------------------------------- /src/MessageLetIndex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_INDEX_H_ 24 | #define _MESSAGE_INDEX_H_ 25 | 26 | class MessageOutputObject; 27 | 28 | /** 29 | * Defines a simple struct to combine a DspObject and an inlet/outlet index 30 | */ 31 | typedef struct { 32 | MessageOutputObject *messageObject; 33 | int letIndex; 34 | } MessageLetIndex; 35 | 36 | #endif // _MESSAGE_INDEX_H_ 37 | -------------------------------------------------------------------------------- /src/MessageLetPair.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LET_PAIR_H_ 24 | #define _MESSAGE_LET_PAIR_H_ 25 | 26 | class PdMessage; 27 | 28 | /** A struct pairing an object and an inlet/outlet index.*/ 29 | typedef struct { 30 | PdMessage *message; 31 | int index; 32 | } MessageConnection; 33 | 34 | #endif // _MESSAGE_LET_PAIR_H_ 35 | -------------------------------------------------------------------------------- /src/MessageListLength.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageListLength.h" 24 | 25 | MessageListLength::MessageListLength(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 26 | // nothing to do 27 | } 28 | 29 | MessageListLength::~MessageListLength() { 30 | // nothing to do 31 | } 32 | 33 | void MessageListLength::process_message(int inlet_index, pd::Message *message) { 34 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 35 | // bangs are not considered to add length to lists 36 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), 37 | message->is_bang(0) ? 0.0f : (float) message->get_num_elements()); 38 | send_message(0, outgoing_message); 39 | } 40 | -------------------------------------------------------------------------------- /src/MessageListLength.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LIST_LENGTH_H_ 24 | #define _MESSAGE_LIST_LENGTH_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [list length] */ 29 | class MessageListLength : public MessageObject { 30 | 31 | public: 32 | MessageListLength(PdMessage *init_message, PdGraph *graph); 33 | ~MessageListLength(); 34 | 35 | static const char *get_object_label(); 36 | std::string toString(); 37 | 38 | private: 39 | void process_message(int inlet_index, PdMessage *message); 40 | }; 41 | 42 | inline const char *MessageListLength::get_object_label() { 43 | return "list length"; 44 | } 45 | 46 | inline std::string MessageListLength::toString() { 47 | return MessageListLength::get_object_label(); 48 | } 49 | 50 | #endif // _MESSAGE_LIST_LENGTH_H_ 51 | -------------------------------------------------------------------------------- /src/MessageListPrepend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LIST_PREPEND_H_ 24 | #define _MESSAGE_LIST_PREPEND_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [list prepend] */ 29 | class MessageListPrepend : public MessageObject { 30 | 31 | public: 32 | MessageListPrepend(PdMessage *init_message, PdGraph *graph); 33 | ~MessageListPrepend(); 34 | 35 | static const char *get_object_label(); 36 | std::string toString(); 37 | 38 | private: 39 | void process_message(int inlet_index, PdMessage *message); 40 | 41 | PdMessage *prependMessage; 42 | }; 43 | 44 | inline const char *MessageListPrepend::get_object_label() { 45 | return "list prepend"; 46 | } 47 | 48 | inline std::string MessageListPrepend::toString() { 49 | return MessageListPrepend::get_object_label(); 50 | } 51 | 52 | #endif // _MESSAGE_LIST_PREPEND_H_ 53 | -------------------------------------------------------------------------------- /src/MessageListSplit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LIST_SPLIT_H_ 24 | #define _MESSAGE_LIST_SPLIT_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [list split] */ 29 | class MessageListSplit : public MessageObject { 30 | 31 | public: 32 | MessageListSplit(PdMessage *init_message, PdGraph *graph); 33 | ~MessageListSplit(); 34 | 35 | static const char *get_object_label(); 36 | std::string toString(); 37 | 38 | private: 39 | void process_message(int inlet_index, PdMessage *message); 40 | 41 | int splitIndex; 42 | }; 43 | 44 | inline const char *MessageListSplit::get_object_label() { 45 | return "list split"; 46 | } 47 | 48 | inline std::string MessageListSplit::toString() { 49 | return MessageListSplit::get_object_label(); 50 | } 51 | 52 | #endif // _MESSAGE_LIST_SPLIT_H_ 53 | -------------------------------------------------------------------------------- /src/MessageListTrim.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageListTrim.h" 24 | 25 | MessageListTrim::MessageListTrim(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 26 | // nothing to do 27 | } 28 | 29 | MessageListTrim::~MessageListTrim() { 30 | // nothing to do 31 | } 32 | 33 | void MessageListTrim::process_message(int inlet_index, pd::Message *message) { 34 | send_message(0, message); 35 | } 36 | -------------------------------------------------------------------------------- /src/MessageLoadbang.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageLoadbang.h" 24 | #include "PdGraph.h" 25 | 26 | message::Object *MessageLoadbang::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new MessageLoadbang(graph); 28 | } 29 | 30 | MessageLoadbang::MessageLoadbang(PdGraph *graph) : message::Object(0, 1, graph) { 31 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 32 | outgoing_message->from_timestamp_and_bang(0.0); 33 | graph->schedule_message(this, 0, outgoing_message); 34 | } 35 | 36 | MessageLoadbang::~MessageLoadbang() { 37 | // nothing to do 38 | } 39 | -------------------------------------------------------------------------------- /src/MessageLoadbang.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LOADBANG_H_ 24 | #define _MESSAGE_LOADBANG_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [loadbang] */ 29 | class MessageLoadbang : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageLoadbang(PdGraph *graph); 34 | ~MessageLoadbang(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | }; 39 | 40 | inline const char *MessageLoadbang::get_object_label() { 41 | return "loadbang"; 42 | } 43 | 44 | inline std::string MessageLoadbang::toString() { 45 | return MessageLoadbang::get_object_label(); 46 | } 47 | 48 | #endif // _MESSAGE_LOADBANG_H_ 49 | -------------------------------------------------------------------------------- /src/MessageLog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageLog.h" 24 | 25 | message::Object *MessageLog::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageLog(init_message, graph); 27 | } 28 | 29 | MessageLog::MessageLog(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageLog::~MessageLog() { 34 | // nothing to do 35 | } 36 | 37 | void MessageLog::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | float value = message->get_float(0); 41 | value = (value <= 0.0f) ? -1000.0f : logf(value); 42 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), value); 43 | send_message(0, outgoing_message); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MessageLog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_LOG_H_ 24 | #define _MESSAGE_LOG_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [log] */ 29 | class MessageLog : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageLog(PdMessage *init_message, PdGraph *graph); 34 | ~MessageLog(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageLog::get_object_label() { 44 | return "log"; 45 | } 46 | 47 | inline std::string MessageLog::toString() { 48 | return MessageLog::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_LOG_H_ 52 | -------------------------------------------------------------------------------- /src/MessageModulus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_MODULUS_H_ 24 | #define _MESSAGE_MODULUS_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [mod], [mod int] */ 29 | class MessageModulus : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageModulus(PdMessage *init_message, PdGraph *graph); 34 | ~MessageModulus(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float lastOutput; 44 | }; 45 | 46 | inline const char *MessageModulus::get_object_label() { 47 | return "mod"; 48 | } 49 | 50 | #endif // _MESSAGE_MODULUS_H_ 51 | -------------------------------------------------------------------------------- /src/MessageMoses.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_MOSES_H_ 24 | #define _MESSAGE_MOSES_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [moses], [moses float] */ 29 | class MessageMoses : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageMoses(PdMessage *init_message, PdGraph *graph); 34 | ~MessageMoses(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | }; 44 | 45 | inline const char *MessageMoses::get_object_label() { 46 | return "moses"; 47 | } 48 | 49 | inline std::string MessageMoses::toString() { 50 | return MessageMoses::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_MOSES_H_ 54 | -------------------------------------------------------------------------------- /src/MessageMultiply.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_MULTIPLY_H_ 24 | #define _MESSAGE_MULTIPLY_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [*], [* float] */ 29 | class MessageMultiply : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageMultiply(PdMessage *init_message, PdGraph *graph); 34 | ~MessageMultiply(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float last; 44 | }; 45 | 46 | inline const char *MessageMultiply::get_object_label() { 47 | return "*"; 48 | } 49 | 50 | #endif // _MESSAGE_MULTIPLY_H_ 51 | -------------------------------------------------------------------------------- /src/MessageNamedDestination.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_NAMED_DESTINATION_H_ 24 | #define _MESSAGE_NAMED_DESTINATION_H_ 25 | 26 | class PdMessage; 27 | 28 | /** A struct containing the destination of a message.*/ 29 | typedef struct { 30 | char *name; 31 | PdMessage *message; 32 | } MessageNamedDestination; 33 | 34 | #endif // _MESSAGE_NAMED_DESTINATION_H_ 35 | -------------------------------------------------------------------------------- /src/MessageNotEquals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_NOTEQUALS_H_ 24 | #define _MESSAGE_NOTEQUALS_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [!=], [!= float] */ 29 | class MessageNotEquals : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageNotEquals(PdMessage *init_message, PdGraph *graph); 34 | ~MessageNotEquals(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float lastOutput; 44 | }; 45 | 46 | inline const char *MessageNotEquals::get_object_label() { 47 | return "!="; 48 | } 49 | 50 | #endif // _MESSAGE_NOTEQUALS_H_ 51 | -------------------------------------------------------------------------------- /src/MessageOpenPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_OPENPANEL_H_ 24 | #define _MESSAGE_OPENPANEL_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [openpanel] */ 29 | class MessageOpenPanel : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageOpenPanel(PdMessage *init_message, PdGraph *graph); 34 | ~MessageOpenPanel(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageOpenPanel::get_object_label() { 44 | return "openpanel"; 45 | } 46 | 47 | inline std::string MessageOpenPanel::toString() { 48 | return MessageOpenPanel::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_OPENPANEL_H_ 52 | -------------------------------------------------------------------------------- /src/MessagePow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_POW_H_ 24 | #define _MESSAGE_POW_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [pow], [pow float] */ 29 | class MessagePow : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessagePow(PdMessage *init_message, PdGraph *graph); 34 | ~MessagePow(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float last; 44 | }; 45 | 46 | inline const char *MessagePow::get_object_label() { 47 | return "pow"; 48 | } 49 | 50 | #endif // _MESSAGE_POW_H_ 51 | -------------------------------------------------------------------------------- /src/MessagePowToDb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_POWTODB_H_ 24 | #define _MESSAGE_POWTODB_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [powtodb] */ 29 | class MessagePowToDb : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessagePowToDb(PdMessage *init_message, PdGraph *graph); 34 | ~MessagePowToDb(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessagePowToDb::get_object_label() { 44 | return "powtodb"; 45 | } 46 | 47 | inline std::string MessagePowToDb::toString() { 48 | return MessagePowToDb::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_POWTODB_H_ 52 | -------------------------------------------------------------------------------- /src/MessageReceive.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2012 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageReceive.h" 24 | 25 | message::Object *MessageReceive::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageReceive(init_message, graph); 27 | } 28 | 29 | MessageReceive::MessageReceive(pd::Message *init_message, PdGraph *graph) : 30 | RemoteMessageReceiver(0, 1, graph) { 31 | // a receive object can be instantiated with no name. It receives a default. 32 | name = utils::copy_string(init_message->is_symbol(0) 33 | ? init_message->get_symbol(0) : "zg_default_sendreceive_name"); 34 | } 35 | 36 | MessageReceive::~MessageReceive() { 37 | free(name); 38 | } 39 | 40 | void MessageReceive::receive_message(int inlet_index, pd::Message *message) { 41 | send_message(0, message); // send all received messages to the outlet 42 | } 43 | -------------------------------------------------------------------------------- /src/MessageRemainder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_REMIANDER_H_ 24 | #define _MESSAGE_REMIANDER_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [%], [% int] */ 29 | class MessageRemainder : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageRemainder(PdMessage *init_message, PdGraph *graph); 34 | MessageRemainder(float constant, PdGraph *graph); 35 | ~MessageRemainder(); 36 | 37 | static const char *get_object_label(); 38 | std::string toString(); 39 | 40 | private: 41 | void init(float constant); 42 | void process_message(int inlet_index, PdMessage *message); 43 | 44 | int constant; 45 | }; 46 | 47 | inline const char *MessageRemainder::get_object_label() { 48 | return "%"; 49 | } 50 | 51 | #endif // _MESSAGE_REMAINDER_H_ 52 | -------------------------------------------------------------------------------- /src/MessageRmsToDb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_RMSTODB_H_ 24 | #define _MESSAGE_RMSTODB_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [rmstodb] */ 29 | class MessageRmsToDb : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageRmsToDb(PdMessage *init_message, PdGraph *graph); 34 | ~MessageRmsToDb(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageRmsToDb::get_object_label() { 44 | return "rmstodb"; 45 | } 46 | 47 | inline std::string MessageRmsToDb::toString() { 48 | return MessageRmsToDb::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_RMSTODB_H_ 52 | -------------------------------------------------------------------------------- /src/MessageRoute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_ROUTE_H_ 24 | #define _MESSAGE_ROUTE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [route] */ 29 | class MessageRoute : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageRoute(PdMessage *init_message, PdGraph *graph); 34 | ~MessageRoute(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | PdMessage *routeMessage; 43 | }; 44 | 45 | inline const char *MessageRoute::get_object_label() { 46 | return "route"; 47 | } 48 | 49 | inline std::string MessageRoute::toString() { 50 | return MessageRoute::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_ROUTE_H_ 54 | -------------------------------------------------------------------------------- /src/MessageSamplerate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageSamplerate.h" 24 | #include "PdGraph.h" 25 | 26 | message::Object *MessageSamplerate::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new MessageSamplerate(init_message, graph); 28 | } 29 | 30 | MessageSamplerate::MessageSamplerate(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 31 | // nothing to do 32 | } 33 | 34 | MessageSamplerate::~MessageSamplerate() { 35 | // nothing to do 36 | } 37 | 38 | void MessageSamplerate::MessageSamplerate::process_message(int inlet_index, pd::Message *message) { 39 | if (message->is_bang(0)) { 40 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 41 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), graph->get_sample_rate()); 42 | send_message(0, outgoing_message); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MessageSine.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageSine.h" 24 | 25 | message::Object *MessageSine::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageSine(init_message, graph); 27 | } 28 | 29 | MessageSine::MessageSine(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageSine::~MessageSine() { 34 | // nothing to do 35 | } 36 | 37 | void MessageSine::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), sinf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageSine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_SINE_H_ 24 | #define _MESSAGE_SINE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [sin] */ 29 | class MessageSine : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageSine(PdMessage *init_message, PdGraph *graph); 34 | ~MessageSine(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageSine::get_object_label() { 44 | return "sin"; 45 | } 46 | 47 | inline std::string MessageSine::toString() { 48 | return MessageSine::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_SINE_H_ 52 | -------------------------------------------------------------------------------- /src/MessageSqrt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageSqrt.h" 24 | 25 | message::Object *MessageSqrt::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageSqrt(init_message, graph); 27 | } 28 | 29 | MessageSqrt::MessageSqrt(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageSqrt::~MessageSqrt() { 34 | // nothing to do 35 | } 36 | 37 | void MessageSqrt::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | float value = message->get_float(0); 41 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), (value < 0.0f) ? 0.0f : sqrtf(value)); 42 | send_message(0, outgoing_message); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MessageSqrt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_SQRT_H_ 24 | #define _MESSAGE_SQRT_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [sqrt] */ 29 | class MessageSqrt : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageSqrt(PdMessage *init_message, PdGraph *graph); 34 | ~MessageSqrt(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageSqrt::get_object_label() { 44 | return "sqrt"; 45 | } 46 | 47 | inline std::string MessageSqrt::toString() { 48 | return MessageSqrt::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_SQRT_H_ 52 | -------------------------------------------------------------------------------- /src/MessageSubtract.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_SUBTRACT_H_ 24 | #define _MESSAGE_SUBTRACT_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [-], [- float] */ 29 | class MessageSubtract : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageSubtract(PdMessage *init_message, PdGraph *graph); 34 | ~MessageSubtract(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float constant; 43 | float last; 44 | }; 45 | 46 | inline const char *MessageSubtract::get_object_label() { 47 | return "-"; 48 | } 49 | 50 | #endif // _MESSAGE_SUBTRACT_H_ 51 | -------------------------------------------------------------------------------- /src/MessageSwap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_SWAP_H_ 24 | #define _MESSAGE_SWAP_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [swap], [swap float] */ 29 | class MessageSwap : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageSwap(PdMessage *init_message, PdGraph *graph); 34 | ~MessageSwap(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float left; 43 | float right; 44 | }; 45 | 46 | inline const char *MessageSwap::get_object_label() { 47 | return "swap"; 48 | } 49 | 50 | inline std::string MessageSwap::toString() { 51 | return MessageSwap::get_object_label(); 52 | } 53 | 54 | #endif // _MESSAGE_SWAP_H_ 55 | -------------------------------------------------------------------------------- /src/MessageSwitch.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageSwitch.h" 24 | #include "PdGraph.h" 25 | 26 | message::Object *MessageSwitch::new_object(pd::Message *init_message, PdGraph *graph) { 27 | return new MessageSwitch(init_message, graph); 28 | } 29 | 30 | MessageSwitch::MessageSwitch(pd::Message *init_message, PdGraph *graph) : message::Object(1, 0, graph) { 31 | // TODO(mhroth): parse object arguments 32 | } 33 | 34 | MessageSwitch::~MessageSwitch() { 35 | // nothing to do 36 | } 37 | 38 | void MessageSwitch::process_message(int inlet_index, pd::Message *message) { 39 | if (message->is_float(0)) { 40 | graph->setSwitch(message->get_float(0) != 0.0f); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MessageTangent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageTangent.h" 24 | 25 | message::Object *MessageTangent::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageTangent(init_message, graph); 27 | } 28 | 29 | MessageTangent::MessageTangent(pd::Message *init_message, PdGraph *graph) : message::Object(1, 1, graph) { 30 | // nothing to do 31 | } 32 | 33 | MessageTangent::~MessageTangent() { 34 | // nothing to do 35 | } 36 | 37 | void MessageTangent::process_message(int inlet_index, pd::Message *message) { 38 | if (message->is_float(0)) { 39 | pd::Message *outgoing_message = PD_MESSAGE_ON_STACK(1); 40 | outgoing_message->from_timestamp_and_float(message->get_timestamp(), tanf(message->get_float(0))); 41 | send_message(0, outgoing_message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MessageTangent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_TANGENT_H_ 24 | #define _MESSAGE_TANGENT_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [tan] */ 29 | class MessageTangent : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageTangent(PdMessage *init_message, PdGraph *graph); 34 | ~MessageTangent(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | }; 42 | 43 | inline const char *MessageTangent::get_object_label() { 44 | return "tan"; 45 | } 46 | 47 | inline std::string MessageTangent::toString() { 48 | return MessageTangent::get_object_label(); 49 | } 50 | 51 | #endif // _MESSAGE_TANGENT_H_ 52 | -------------------------------------------------------------------------------- /src/MessageText.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "MessageText.h" 24 | 25 | message::Object *MessageText::new_object(pd::Message *init_message, PdGraph *graph) { 26 | return new MessageText(init_message, graph); 27 | } 28 | 29 | MessageText::MessageText(pd::Message *init_message, PdGraph *graph) : message::Object(0, 0, graph) { 30 | comment = init_message->is_symbol(0) ? utils::copy_string(init_message->get_symbol(0)) : NULL; 31 | } 32 | 33 | MessageText::~MessageText() { 34 | free(comment); 35 | } 36 | -------------------------------------------------------------------------------- /src/MessageTimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_TIMER_H_ 24 | #define _MESSAGE_TIMER_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [timer] */ 29 | class MessageTimer : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageTimer(PdMessage *init_message, PdGraph *graph); 34 | ~MessageTimer(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | double timestampStart; 43 | }; 44 | 45 | inline const char *MessageTimer::get_object_label() { 46 | return "timer"; 47 | } 48 | 49 | inline std::string MessageTimer::toString() { 50 | return MessageTimer::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_TIMER_H_ 54 | -------------------------------------------------------------------------------- /src/MessageToggle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_TOGGLE_H_ 24 | #define _MESSAGE_TOGGLE_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [toggle], [tgl] */ 29 | class MessageToggle : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageToggle(PdMessage *initString, PdGraph *graph); 34 | ~MessageToggle(); 35 | 36 | static const char *get_object_label(); 37 | 38 | private: 39 | void process_message(int inlet_index, PdMessage *message); 40 | 41 | bool isOn; 42 | float onOutput; 43 | }; 44 | 45 | #endif // _MESSAGE_TOGGLE_H_ 46 | -------------------------------------------------------------------------------- /src/MessageUnpack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_UNPACK_H_ 24 | #define _MESSAGE_UNPACK_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [unpack] */ 29 | class MessageUnpack : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageUnpack(PdMessage *init_message, PdGraph *graph); 34 | ~MessageUnpack(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | PdMessage *templateMessage; 43 | }; 44 | 45 | inline const char *MessageUnpack::get_object_label() { 46 | return "unpack"; 47 | } 48 | 49 | 50 | #endif // _MESSAGE_UNPACK_H_ 51 | -------------------------------------------------------------------------------- /src/MessageWrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009,2010,2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _MESSAGE_WRAP_H_ 24 | #define _MESSAGE_WRAP_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** [wrap] */ 29 | class MessageWrap : public MessageObject { 30 | 31 | public: 32 | static MessageObject *new_object(PdMessage *init_message, PdGraph *graph); 33 | MessageWrap(PdMessage *init_message, PdGraph *graph); 34 | ~MessageWrap(); 35 | 36 | static const char *get_object_label(); 37 | std::string toString(); 38 | 39 | private: 40 | void process_message(int inlet_index, PdMessage *message); 41 | 42 | float lower,upper,range,value; 43 | }; 44 | 45 | inline const char *MessageWrap::get_object_label() { 46 | return "wrap"; 47 | } 48 | 49 | inline std::string MessageWrap::toString() { 50 | return MessageWrap::get_object_label(); 51 | } 52 | 53 | #endif // _MESSAGE_WRAP_H_ 54 | -------------------------------------------------------------------------------- /src/ObjectFactoryMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _OBJECT_FACTORY_MAP_H_ 24 | #define _OBJECT_FACTORY_MAP_H_ 25 | 26 | #include 27 | #include 28 | using namespace std; 29 | 30 | class MessageObject; 31 | class PdGraph; 32 | class PdMessage; 33 | 34 | class ObjectFactoryMap { 35 | public: 36 | ObjectFactoryMap(); 37 | ~ObjectFactoryMap(); 38 | 39 | void register_external_object(const char *object_label, MessageObject *(*new_object)(PdMessage *, PdGraph *)); 40 | void unregister_external_object(const char *object_label); 41 | 42 | MessageObject *new_object(const char *objectLable, PdMessage *init_message, PdGraph *graph); 43 | 44 | private: 45 | map object_factory_map; 46 | }; 47 | 48 | #endif // _OBJECT_FACTORY_MAP_H_ 49 | -------------------------------------------------------------------------------- /src/RemoteMessageReceiver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #include "RemoteMessageReceiver.h" 24 | 25 | RemoteMessageReceiver::RemoteMessageReceiver(int numMessageInlets, int numMessageOutlets, PdGraph *graph) : 26 | message::Object(numMessageInlets, numMessageOutlets, graph) { 27 | name = NULL; 28 | } 29 | 30 | RemoteMessageReceiver::~RemoteMessageReceiver() { 31 | // nothing to do. Subclass is responsible for freeing name. 32 | } 33 | 34 | char *RemoteMessageReceiver::get_name() { 35 | return name; 36 | } 37 | -------------------------------------------------------------------------------- /src/RemoteMessageReceiver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _REMOTE_MESSAGE_RECEIVER_H_ 24 | #define _REMOTE_MESSAGE_RECEIVER_H_ 25 | 26 | #include "MessageObject.h" 27 | 28 | /** 29 | * This is a superclass of all MessageObjects which receive messages 30 | * remotely. This includes objects such as MessageReceive and MessageNotein. 31 | */ 32 | class RemoteMessageReceiver : public MessageObject { 33 | 34 | public: 35 | RemoteMessageReceiver(int numMessageInlets, int numMessageOutlets, PdGraph *graph); 36 | virtual ~RemoteMessageReceiver(); 37 | 38 | char *get_name(); 39 | 40 | protected: 41 | // This class provides the name variable, but subclasses are responsible for managing it. 42 | char *name; 43 | }; 44 | 45 | #endif // _REMOTE_MESSAGE_RECEIVER_H_ 46 | -------------------------------------------------------------------------------- /src/TableReceiverInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Reality Jockey, Ltd. 3 | * info@rjdj.me 4 | * http://rjdj.me/ 5 | * 6 | * This file is part of ZenGarden. 7 | * 8 | * ZenGarden is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * ZenGarden is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with ZenGarden. If not, see . 20 | * 21 | */ 22 | 23 | #ifndef _TABLE_RECEIVER_INTERFACE_H_ 24 | #define _TABLE_RECEIVER_INTERFACE_H_ 25 | 26 | #include "MessageTable.h" 27 | 28 | /** 29 | * This class has a similar function to DelayReceiver in that it is an interface 30 | * for all objects which interact with MessageTables. This includes DspTableRead, DspTablePlay, 31 | * DspTableRead4, MessageTableRead, and MessageTableWrite. 32 | */ 33 | class TableReceiverInterface { 34 | public: 35 | virtual ~TableReceiverInterface() { /* nothing to do */ } 36 | 37 | virtual char *get_name() = 0; 38 | 39 | virtual void set_table(MessageTable *table) = 0; 40 | }; 41 | 42 | #endif // _TABLE_RECEIVER_INTERFACE_H_ 43 | -------------------------------------------------------------------------------- /src/message/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2019 NeoBirth Developers 3 | // 4 | // This file is part of PureZen (a fork of ZenGarden) 5 | // 6 | // PureZen is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // PureZen is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with PureZen. If not, see . 18 | // 19 | 20 | //! Message types 21 | 22 | pub mod element; 23 | pub mod object; 24 | mod queue; 25 | pub mod send; 26 | mod symbol; 27 | mod timestamp; 28 | 29 | pub use self::{ 30 | element::Element, object::Object, queue::OrderedQueue, send::Send, symbol::Symbol, 31 | timestamp::Timestamp, 32 | }; 33 | -------------------------------------------------------------------------------- /src/message/object/coordinates.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2019 NeoBirth Developers 3 | // 4 | // This file is part of PureZen (a fork of ZenGarden) 5 | // 6 | // PureZen is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // PureZen is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with PureZen. If not, see . 18 | // 19 | 20 | /// Position of an object on a graphical canvas. 21 | /// 22 | /// Coordinates may be positive or negative. 23 | #[derive(Copy, Clone, Debug, Default, PartialEq)] 24 | pub struct Coordinates { 25 | /// x-coordinate 26 | pub x: f32, 27 | 28 | /// y-coordinate 29 | pub y: f32, 30 | } 31 | -------------------------------------------------------------------------------- /src/message/timestamp.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2019 NeoBirth Developers 3 | // 4 | // This file is part of PureZen (a fork of ZenGarden) 5 | // 6 | // PureZen is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // PureZen is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with PureZen. If not, see . 18 | // 19 | 20 | use core::{ops::Add, time::Duration}; 21 | 22 | /// Message timestamps 23 | #[derive(Copy, Clone, Debug, Default, PartialEq, PartialOrd)] 24 | pub struct Timestamp(pub(crate) f64); 25 | 26 | impl Add for Timestamp { 27 | type Output = Timestamp; 28 | 29 | fn add(self, other: Duration) -> Timestamp { 30 | Timestamp(self.0 + (other.as_secs() as f64 * 1000.0) + f64::from(other.subsec_millis())) 31 | } 32 | } 33 | 34 | impl From for Timestamp { 35 | fn from(ts: f64) -> Timestamp { 36 | Timestamp(ts) 37 | } 38 | } 39 | 40 | impl From for f64 { 41 | fn from(ts: Timestamp) -> f64 { 42 | ts.0 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/prelude.rs: -------------------------------------------------------------------------------- 1 | //! Use preludes for heap-backed data structures from either `alloc` or `std` 2 | 3 | #[cfg(all(feature = "alloc", not(feature = "std")))] 4 | pub use alloc::prelude::*; 5 | 6 | #[cfg(feature = "std")] 7 | pub use std::prelude::v1::*; 8 | -------------------------------------------------------------------------------- /test/MessageAbsoluteValue.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 2 2 | [@ 0.000ms] print: 14.3 3 | [@ 0.000ms] print: 3.7 4 | -------------------------------------------------------------------------------- /test/MessageAbsoluteValue.pd: -------------------------------------------------------------------------------- 1 | #N canvas 630 159 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 240 99 abc; 7 | #X obj 104 55 t b b b b b; 8 | #X msg 278 99 -2 3 5; 9 | #X msg 139 99 -14.3; 10 | #X msg 104 99 3.7; 11 | #X obj 190 100 bang; 12 | #X obj 104 148 abs; 13 | #X connect 0 0 4 0; 14 | #X connect 2 0 4 0; 15 | #X connect 3 0 9 0; 16 | #X connect 4 0 7 0; 17 | #X connect 4 1 6 0; 18 | #X connect 4 2 8 0; 19 | #X connect 4 3 3 0; 20 | #X connect 4 4 5 0; 21 | #X connect 5 0 9 0; 22 | #X connect 6 0 9 0; 23 | #X connect 7 0 9 0; 24 | #X connect 8 0 9 0; 25 | #X connect 9 0 1 0; 26 | -------------------------------------------------------------------------------- /test/MessageAdd.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 10 2 | [@ 0.000ms] print: 5 3 | [@ 0.000ms] print: 8 4 | [@ 0.000ms] print: 16 5 | [@ 0.000ms] print: 7 6 | [@ 0.000ms] print: 12 7 | -------------------------------------------------------------------------------- /test/MessageAdd.pd: -------------------------------------------------------------------------------- 1 | #N canvas 761 150 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 140 71 13; 4 | #X obj 21 174 print; 5 | #X msg 111 71 x; 6 | #X msg 80 71 3; 7 | #X msg 51 71 4; 8 | #X msg 21 71 5 7; 9 | #X msg 170 71 x; 10 | #X msg 200 71 5; 11 | #X obj 21 40 t b b b b b b b b b; 12 | #X msg 233 71 2 3 4; 13 | #X msg 280 71 5; 14 | #X obj 21 153 + 5; 15 | #X connect 0 0 9 0; 16 | #X connect 1 0 12 0; 17 | #X connect 3 0 12 0; 18 | #X connect 4 0 12 1; 19 | #X connect 5 0 12 0; 20 | #X connect 6 0 12 0; 21 | #X connect 7 0 12 1; 22 | #X connect 8 0 12 0; 23 | #X connect 9 0 6 0; 24 | #X connect 9 1 5 0; 25 | #X connect 9 2 4 0; 26 | #X connect 9 3 3 0; 27 | #X connect 9 4 1 0; 28 | #X connect 9 5 7 0; 29 | #X connect 9 6 8 0; 30 | #X connect 9 7 10 0; 31 | #X connect 9 8 11 0; 32 | #X connect 10 0 12 0; 33 | #X connect 11 0 12 0; 34 | #X connect 12 0 2 0; 35 | -------------------------------------------------------------------------------- /test/MessageArcTangent.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -1.10715 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: -1.50098 4 | [@ 0.000ms] print: 1.30683 5 | -------------------------------------------------------------------------------- /test/MessageArcTangent.pd: -------------------------------------------------------------------------------- 1 | #N canvas 643 219 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 235 99 -2 3 5; 7 | #X msg 139 99 -14.3; 8 | #X msg 104 99 3.7; 9 | #X msg 197 99 0; 10 | #X obj 104 54 t b b b b; 11 | #X obj 104 148 atan; 12 | #X connect 0 0 7 0; 13 | #X connect 2 0 7 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 8 0; 18 | #X connect 7 0 5 0; 19 | #X connect 7 1 4 0; 20 | #X connect 7 2 6 0; 21 | #X connect 7 3 3 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageArcTangent2.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -0.927295 2 | [@ 0.000ms] print: 3.14159 3 | [@ 0.000ms] print: -0.0454233 4 | [@ 0.000ms] print: 0.253189 5 | -------------------------------------------------------------------------------- /test/MessageArcTangent2.pd: -------------------------------------------------------------------------------- 1 | #N canvas 695 89 450 300 10; 2 | #X obj 32 17 loadbang; 3 | #X obj 32 194 print; 4 | #X obj 101 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 32 99 3.7; 7 | #X obj 32 159 atan2; 8 | #X msg 199 99 0; 9 | #X obj 32 54 t b b b b b b b b; 10 | #X msg 156 99 44; 11 | #X msg 117 99 -2; 12 | #X msg 237 99 -2; 13 | #X msg 280 99 -4 3; 14 | #X msg 324 99 -5.5; 15 | #X msg 68 99 14.3; 16 | #X connect 0 0 6 0; 17 | #X connect 2 0 6 0; 18 | #X connect 3 0 4 0; 19 | #X connect 4 0 1 0; 20 | #X connect 5 0 4 0; 21 | #X connect 6 0 3 0; 22 | #X connect 6 1 12 0; 23 | #X connect 6 2 8 0; 24 | #X connect 6 3 7 0; 25 | #X connect 6 4 5 0; 26 | #X connect 6 5 9 0; 27 | #X connect 6 6 10 0; 28 | #X connect 6 7 11 0; 29 | #X connect 7 0 4 1; 30 | #X connect 8 0 4 0; 31 | #X connect 9 0 4 1; 32 | #X connect 10 0 4 0; 33 | #X connect 11 0 4 1; 34 | #X connect 12 0 4 1; 35 | -------------------------------------------------------------------------------- /test/MessageBang.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: bang 2 | [@ 0.000ms] print: bang 3 | [@ 0.000ms] print: bang 4 | [@ 0.000ms] print: bang 5 | -------------------------------------------------------------------------------- /test/MessageBang.pd: -------------------------------------------------------------------------------- 1 | #N canvas 231 214 450 300 10; 2 | #X obj 46 34 loadbang; 3 | #X obj 47 159 bang; 4 | #X obj 47 206 print; 5 | #X msg 46 109 22 3 1; 6 | #X obj 112 109 f 1.45; 7 | #X obj 169 109 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 8 | -1 -1; 9 | #X obj 169 109 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 10 | -1 -1; 11 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 12 | -1; 13 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 14 | -1; 15 | #X msg 207 110 hello; 16 | #X obj 46 69 t b b b b; 17 | #X connect 0 0 10 0; 18 | #X connect 1 0 2 0; 19 | #X connect 3 0 1 0; 20 | #X connect 4 0 1 0; 21 | #X connect 5 0 1 0; 22 | #X connect 7 0 10 0; 23 | #X connect 9 0 1 0; 24 | #X connect 10 0 3 0; 25 | #X connect 10 1 4 0; 26 | #X connect 10 2 5 0; 27 | #X connect 10 3 9 0; 28 | -------------------------------------------------------------------------------- /test/MessageChange.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 32 2 | [@ 0.000ms] print: 55 3 | [@ 0.000ms] print: 8.5 4 | -------------------------------------------------------------------------------- /test/MessageChange.pd: -------------------------------------------------------------------------------- 1 | #N canvas 665 246 450 300 10; 2 | #X obj 22 20 loadbang; 3 | #X obj 22 50 t b b b b; 4 | #X obj 92 178 change 32; 5 | #X msg 120 133 set \$1; 6 | #X msg 120 91 55; 7 | #X msg 22 116 8.5; 8 | #X obj 92 217 print; 9 | #X obj 95 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 10 | -1; 11 | #X connect 0 0 1 0; 12 | #X connect 1 0 5 0; 13 | #X connect 1 1 2 0; 14 | #X connect 1 2 4 0; 15 | #X connect 1 3 2 0; 16 | #X connect 2 0 6 0; 17 | #X connect 3 0 2 0; 18 | #X connect 4 0 3 0; 19 | #X connect 5 0 2 0; 20 | #X connect 7 0 1 0; 21 | -------------------------------------------------------------------------------- /test/MessageClip.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 23 2 | [@ 0.000ms] print: 55 3 | [@ 0.000ms] print: 60 4 | [@ 0.000ms] print: 55 5 | [@ 0.000ms] print: 66 6 | -------------------------------------------------------------------------------- /test/MessageClip.pd: -------------------------------------------------------------------------------- 1 | #N canvas 221 283 450 300 10; 2 | #X obj 38 223 clip; 3 | #X obj 38 10 loadbang; 4 | #X obj 106 10 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 347 122 87; 7 | #X obj 38 268 print; 8 | #X msg 306 122 23; 9 | #X msg 265 122 11; 10 | #X msg 164 122 60; 11 | #X msg 200 122 44 55 66; 12 | #X obj 38 46 t b b b b b b b; 13 | #X msg 102 122 77 66 55; 14 | #X obj 38 122 44 66 55; 15 | #X connect 0 0 4 0; 16 | #X connect 1 0 9 0; 17 | #X connect 2 0 9 0; 18 | #X connect 3 0 0 2; 19 | #X connect 5 0 0 1; 20 | #X connect 6 0 0 0; 21 | #X connect 7 0 0 0; 22 | #X connect 8 0 0 0; 23 | #X connect 9 0 11 0; 24 | #X connect 9 1 10 0; 25 | #X connect 9 2 7 0; 26 | #X connect 9 3 8 0; 27 | #X connect 9 4 6 0; 28 | #X connect 9 5 5 0; 29 | #X connect 9 6 3 0; 30 | #X connect 10 0 0 0; 31 | #X connect 11 0 0 0; 32 | -------------------------------------------------------------------------------- /test/MessageCosine.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -0.416147 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: -0.162115 4 | [@ 0.000ms] print: -0.8481 5 | -------------------------------------------------------------------------------- /test/MessageCosine.pd: -------------------------------------------------------------------------------- 1 | #N canvas 633 240 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 235 99 -2 3 5; 7 | #X msg 139 99 -14.3; 8 | #X msg 104 99 3.7; 9 | #X msg 197 99 0; 10 | #X obj 104 54 t b b b b; 11 | #X obj 104 148 cos; 12 | #X connect 0 0 7 0; 13 | #X connect 2 0 7 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 8 0; 18 | #X connect 7 0 5 0; 19 | #X connect 7 1 4 0; 20 | #X connect 7 2 6 0; 21 | #X connect 7 3 3 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageDbToPow.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 2.51189e-08 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 2.34423e-10 5 | -------------------------------------------------------------------------------- /test/MessageDbToPow.pd: -------------------------------------------------------------------------------- 1 | #N canvas 635 294 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 197 99 0; 9 | #X obj 104 54 t b b b b; 10 | #X msg 235 99 24 35 48; 11 | #X obj 104 148 dbtopow; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 3 7 0; 21 | #X connect 7 0 8 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageDbToRms.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0.000158489 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 1.53109e-05 5 | -------------------------------------------------------------------------------- /test/MessageDbToRms.pd: -------------------------------------------------------------------------------- 1 | #N canvas 635 294 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 197 99 0; 9 | #X obj 104 54 t b b b b; 10 | #X msg 235 99 24 35 48; 11 | #X obj 104 148 dbtorms; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 3 7 0; 21 | #X connect 7 0 8 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageDelay.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: hello 2 | [@ 2000.000ms] print: hello -------------------------------------------------------------------------------- /test/MessageDelay.pd: -------------------------------------------------------------------------------- 1 | #N canvas 754 307 450 300 10; 2 | #X obj 135 12 loadbang; 3 | #X obj 108 13 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 166 117 delay 1000; 6 | #X obj 147 191 print; 7 | #X msg 147 156 hello; 8 | #X obj 108 43 t b b b; 9 | #X msg 223 87 2000; 10 | #X connect 0 0 5 0; 11 | #X connect 1 0 5 0; 12 | #X connect 2 0 4 0; 13 | #X connect 4 0 3 0; 14 | #X connect 5 0 2 0; 15 | #X connect 5 1 6 0; 16 | #X connect 5 2 2 0; 17 | #X connect 5 2 4 0; 18 | #X connect 6 0 2 1; 19 | -------------------------------------------------------------------------------- /test/MessageDiv.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: -1 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: -1 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: -1 -------------------------------------------------------------------------------- /test/MessageDiv.pd: -------------------------------------------------------------------------------- 1 | #N canvas 564 200 450 425 10; 2 | #X obj 131 81 loadbang; 3 | #X obj 203 81 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 200 242 print; 6 | #X obj 200 219 div 1; 7 | #X msg 331 157 1; 8 | #X msg 298 157 -1; 9 | #X msg 264 157 2; 10 | #X msg 231 157 1; 11 | #X msg 197 157 -1; 12 | #X obj 148 124 t b b b b b b b b; 13 | #X msg 128 157 1; 14 | #X msg 90 157 -1; 15 | #X msg 161 157 -2; 16 | #X connect 0 0 9 0; 17 | #X connect 1 0 9 0; 18 | #X connect 3 0 2 0; 19 | #X connect 4 0 3 0; 20 | #X connect 5 0 3 0; 21 | #X connect 6 0 3 1; 22 | #X connect 7 0 3 0; 23 | #X connect 8 0 3 0; 24 | #X connect 9 0 11 0; 25 | #X connect 9 1 10 0; 26 | #X connect 9 2 12 0; 27 | #X connect 9 3 8 0; 28 | #X connect 9 4 7 0; 29 | #X connect 9 5 6 0; 30 | #X connect 9 6 5 0; 31 | #X connect 9 7 4 0; 32 | #X connect 10 0 3 0; 33 | #X connect 11 0 3 0; 34 | #X connect 12 0 3 1; 35 | -------------------------------------------------------------------------------- /test/MessageDivide.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 0.666667 3 | [@ 0.000ms] print: 1.66667 4 | [@ 0.000ms] print: 4.33333 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: 0.714286 7 | -------------------------------------------------------------------------------- /test/MessageDivide.pd: -------------------------------------------------------------------------------- 1 | #N canvas 764 231 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 140 71 13; 4 | #X obj 21 174 print; 5 | #X msg 111 71 x; 6 | #X msg 51 71 4; 7 | #X msg 21 71 5 7; 8 | #X msg 170 71 x; 9 | #X msg 200 71 5; 10 | #X obj 21 40 t b b b b b b b b b; 11 | #X msg 233 71 2 3 4; 12 | #X obj 21 151 / 5; 13 | #X msg 280 71 5; 14 | #X msg 80 71 0; 15 | #X connect 0 0 8 0; 16 | #X connect 1 0 10 0; 17 | #X connect 3 0 10 0; 18 | #X connect 4 0 10 0; 19 | #X connect 5 0 10 0; 20 | #X connect 6 0 10 1; 21 | #X connect 7 0 10 0; 22 | #X connect 8 0 5 0; 23 | #X connect 8 1 4 0; 24 | #X connect 8 2 12 0; 25 | #X connect 8 3 3 0; 26 | #X connect 8 4 1 0; 27 | #X connect 8 5 6 0; 28 | #X connect 8 6 7 0; 29 | #X connect 8 7 9 0; 30 | #X connect 8 8 11 0; 31 | #X connect 9 0 10 0; 32 | #X connect 10 0 2 0; 33 | #X connect 11 0 10 0; 34 | #X connect 12 0 10 1; 35 | -------------------------------------------------------------------------------- /test/MessageEqualsEquals.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 1 6 | [@ 0.000ms] print: 1 -------------------------------------------------------------------------------- /test/MessageEqualsEquals.pd: -------------------------------------------------------------------------------- 1 | #N canvas 538 240 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 260 print; 9 | #X msg 163 181 0; 10 | #X msg 203 181 1; 11 | #X obj 64 80 t b b b b; 12 | #X obj 80 226 == 0; 13 | #X connect 0 0 8 0; 14 | #X connect 1 0 8 0; 15 | #X connect 2 0 9 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 9 0; 19 | #X connect 4 0 9 0; 20 | #X connect 6 0 9 1; 21 | #X connect 7 0 9 1; 22 | #X connect 8 0 2 0; 23 | #X connect 8 1 6 0; 24 | #X connect 8 2 2 0; 25 | #X connect 8 3 7 0; 26 | #X connect 9 0 5 0; 27 | -------------------------------------------------------------------------------- /test/MessageExp.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0.135335 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 6.16012e-07 4 | [@ 0.000ms] print: 40.4473 5 | -------------------------------------------------------------------------------- /test/MessageExp.pd: -------------------------------------------------------------------------------- 1 | #N canvas 632 213 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 235 99 -2 3 5; 7 | #X msg 139 99 -14.3; 8 | #X msg 104 99 3.7; 9 | #X msg 197 99 0; 10 | #X obj 104 54 t b b b b; 11 | #X obj 104 148 exp; 12 | #X connect 0 0 7 0; 13 | #X connect 2 0 7 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 8 0; 18 | #X connect 7 0 5 0; 19 | #X connect 7 1 4 0; 20 | #X connect 7 2 6 0; 21 | #X connect 7 3 3 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageFloat.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -6.5 2 | [@ 0.000ms] print: 10.5 3 | -------------------------------------------------------------------------------- /test/MessageFloat.pd: -------------------------------------------------------------------------------- 1 | #N canvas 575 259 450 300 10; 2 | #X obj 110 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 138 18 loadbang; 5 | #X obj 110 187 print; 6 | #X obj 110 78 t b b b; 7 | #X obj 157 110 f 10.5; 8 | #X obj 110 148 f -6.5; 9 | #X connect 0 0 3 0; 10 | #X connect 1 0 3 0; 11 | #X connect 3 0 5 0; 12 | #X connect 3 1 4 0; 13 | #X connect 3 2 5 0; 14 | #X connect 4 0 5 1; 15 | #X connect 5 0 2 0; 16 | -------------------------------------------------------------------------------- /test/MessageFrequencyToMidi.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 17.1369 2 | [@ 0.000ms] print: -1500 3 | [@ 0.000ms] print: -1500 4 | [@ 0.000ms] print: -13.726 5 | -------------------------------------------------------------------------------- /test/MessageFrequencyToMidi.pd: -------------------------------------------------------------------------------- 1 | #N canvas 718 167 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 237 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 191 99 0; 8 | #X obj 104 54 t b b b b b b; 9 | #X obj 104 202 ftom; 10 | #X msg 231 99 22 3 5; 11 | #X msg 104 99 3.7; 12 | #X connect 0 0 5 0; 13 | #X connect 2 0 5 0; 14 | #X connect 3 0 6 0; 15 | #X connect 4 0 6 0; 16 | #X connect 5 0 8 0; 17 | #X connect 5 1 3 0; 18 | #X connect 5 2 4 0; 19 | #X connect 5 4 7 0; 20 | #X connect 6 0 1 0; 21 | #X connect 7 0 6 0; 22 | #X connect 8 0 6 0; 23 | -------------------------------------------------------------------------------- /test/MessageGreaterThan.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 1 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: 0 7 | -------------------------------------------------------------------------------- /test/MessageGreaterThan.pd: -------------------------------------------------------------------------------- 1 | #N canvas 72 107 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 260 print; 9 | #X msg 163 181 0; 10 | #X msg 203 181 1; 11 | #X obj 64 80 t b b b b; 12 | #X obj 80 226 > 0; 13 | #X connect 0 0 8 0; 14 | #X connect 1 0 8 0; 15 | #X connect 2 0 9 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 9 0; 19 | #X connect 4 0 9 0; 20 | #X connect 6 0 9 1; 21 | #X connect 7 0 9 1; 22 | #X connect 8 0 2 0; 23 | #X connect 8 1 6 0; 24 | #X connect 8 2 2 0; 25 | #X connect 8 3 7 0; 26 | #X connect 9 0 5 0; 27 | -------------------------------------------------------------------------------- /test/MessageGreaterThanOrEqualTo.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 1 5 | [@ 0.000ms] print: 1 6 | [@ 0.000ms] print: 1 7 | -------------------------------------------------------------------------------- /test/MessageGreaterThanOrEqualTo.pd: -------------------------------------------------------------------------------- 1 | #N canvas 73 134 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 260 print; 9 | #X msg 163 181 0; 10 | #X msg 203 181 1; 11 | #X obj 64 80 t b b b b; 12 | #X obj 80 226 >= 0; 13 | #X connect 0 0 8 0; 14 | #X connect 1 0 8 0; 15 | #X connect 2 0 9 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 9 0; 19 | #X connect 4 0 9 0; 20 | #X connect 6 0 9 1; 21 | #X connect 7 0 9 1; 22 | #X connect 8 0 2 0; 23 | #X connect 8 1 6 0; 24 | #X connect 8 2 2 0; 25 | #X connect 8 3 7 0; 26 | #X connect 9 0 5 0; 27 | -------------------------------------------------------------------------------- /test/MessageInletOutlet.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 2 -------------------------------------------------------------------------------- /test/MessageInletOutlet.pd: -------------------------------------------------------------------------------- 1 | #N canvas 581 102 450 300 10; 2 | #X obj 116 47 loadbang; 3 | #X obj 191 47 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 130 100 t b b; 6 | #N canvas 0 22 450 300 (subpatch) 0; 7 | #X obj 155 38 inlet; 8 | #X obj 155 83 + 1; 9 | #X obj 154 127 outlet; 10 | #X connect 0 0 1 0; 11 | #X connect 1 0 2 0; 12 | #X restore 166 176 pd; 13 | #X obj 140 209 print; 14 | #X obj 172 135 f 0; 15 | #N canvas 0 22 651 329 (subpatch) 1; 16 | #X obj 243 108 inlet; 17 | #X obj 170 108 inlet; 18 | #X obj 169 149 + 2; 19 | #X obj 169 216 outlet; 20 | #X text 143 24 The left inlet was created after the right inlet.; 21 | #X text 145 46 This test should validate that Pd inlets are evaluated 22 | according to the x-order on the canvas \, not their creation order. 23 | ; 24 | #X connect 0 0 3 0; 25 | #X connect 1 0 2 0; 26 | #X connect 2 0 3 0; 27 | #X restore 114 173 pd; 28 | #X obj 121 136 f 0; 29 | #X connect 0 0 2 0; 30 | #X connect 1 0 2 0; 31 | #X connect 2 0 7 0; 32 | #X connect 2 1 5 0; 33 | #X connect 3 0 4 0; 34 | #X connect 5 0 3 0; 35 | #X connect 6 0 4 0; 36 | #X connect 7 0 6 0; 37 | -------------------------------------------------------------------------------- /test/MessageInteger.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -6 2 | [@ 0.000ms] print: 10 3 | -------------------------------------------------------------------------------- /test/MessageInteger.pd: -------------------------------------------------------------------------------- 1 | #N canvas 123 308 450 300 10; 2 | #X obj 110 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 138 18 loadbang; 5 | #X obj 110 187 print; 6 | #X obj 110 78 t b b b; 7 | #X obj 110 148 i -6.5; 8 | #X obj 157 110 i 10.5; 9 | #X connect 0 0 3 0; 10 | #X connect 1 0 3 0; 11 | #X connect 3 0 4 0; 12 | #X connect 3 1 5 0; 13 | #X connect 3 2 4 0; 14 | #X connect 4 0 2 0; 15 | #X connect 5 0 4 1; 16 | -------------------------------------------------------------------------------- /test/MessageLessThan.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 1 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: 0 7 | -------------------------------------------------------------------------------- /test/MessageLessThan.pd: -------------------------------------------------------------------------------- 1 | #N canvas 234 146 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 260 print; 9 | #X msg 163 181 0; 10 | #X msg 203 181 1; 11 | #X obj 64 80 t b b b b; 12 | #X obj 80 226 < 0; 13 | #X connect 0 0 8 0; 14 | #X connect 1 0 8 0; 15 | #X connect 2 0 9 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 9 0; 19 | #X connect 4 0 9 0; 20 | #X connect 6 0 9 1; 21 | #X connect 7 0 9 1; 22 | #X connect 8 0 2 0; 23 | #X connect 8 1 6 0; 24 | #X connect 8 2 2 0; 25 | #X connect 8 3 7 0; 26 | #X connect 9 0 5 0; 27 | -------------------------------------------------------------------------------- /test/MessageLessThanOrEqualTo.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 1 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 1 6 | [@ 0.000ms] print: 1 7 | -------------------------------------------------------------------------------- /test/MessageLessThanOrEqualTo.pd: -------------------------------------------------------------------------------- 1 | #N canvas 235 173 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 260 print; 9 | #X msg 163 181 0; 10 | #X msg 203 181 1; 11 | #X obj 64 80 t b b b b; 12 | #X obj 80 226 <= 0; 13 | #X connect 0 0 8 0; 14 | #X connect 1 0 8 0; 15 | #X connect 2 0 9 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 9 0; 19 | #X connect 4 0 9 0; 20 | #X connect 6 0 9 1; 21 | #X connect 7 0 9 1; 22 | #X connect 8 0 2 0; 23 | #X connect 8 1 6 0; 24 | #X connect 8 2 2 0; 25 | #X connect 8 3 7 0; 26 | #X connect 9 0 5 0; 27 | -------------------------------------------------------------------------------- /test/MessageLine.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 0 3 | [@ 100.000ms] print: 0.1 4 | [@ 200.000ms] print: 0.2 5 | [@ 300.000ms] print: 0.3 6 | [@ 400.000ms] print: 0.4 7 | [@ 500.000ms] print: 0.5 8 | [@ 600.000ms] print: 0.6 9 | [@ 700.000ms] print: 0.7 10 | [@ 800.000ms] print: 0.8 11 | [@ 900.000ms] print: 0.9 12 | [@ 950.000ms] print: 0.95 13 | [@ 1050.000ms] print: 0.855 14 | [@ 1150.000ms] print: 0.76 15 | [@ 1250.000ms] print: 0.665 16 | [@ 1350.000ms] print: 0.57 17 | [@ 1450.000ms] print: 0.475 18 | [@ 1550.000ms] print: 0.38 19 | [@ 1650.000ms] print: 0.285 20 | [@ 1750.000ms] print: 0.19 21 | [@ 1850.000ms] print: 0.095 22 | [@ 1950.000ms] print: 0 23 | [@ 2000.000ms] print: 1 24 | [@ 2000.000ms] print: 1 25 | [@ 2100.000ms] print: 0.9 26 | [@ 2200.000ms] print: 0.8 27 | [@ 2300.000ms] print: 0.7 28 | [@ 2400.000ms] print: 0.6 29 | -------------------------------------------------------------------------------- /test/MessageLine.pd: -------------------------------------------------------------------------------- 1 | #N canvas 677 54 548 463 10; 2 | #X msg 319 179 0 1000; 3 | #X msg 411 145 1 1000; 4 | #X obj 229 319 line 0 100; 5 | #X obj 64 12 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 6 | -1; 7 | #X obj 101 17 loadbang; 8 | #X obj 229 350 print; 9 | #X msg 473 144 0; 10 | #X msg 235 177 1; 11 | #X obj 78 50 t b b b b b b; 12 | #X obj 147 147 delay 2000; 13 | #X msg 147 177 0 1000; 14 | #X msg 60 176 stop; 15 | #X obj 60 146 delay 2500; 16 | #X obj 235 147 delay 2000; 17 | #X obj 319 147 delay 950; 18 | #X connect 0 0 2 0; 19 | #X connect 1 0 2 0; 20 | #X connect 2 0 5 0; 21 | #X connect 3 0 8 0; 22 | #X connect 4 0 8 0; 23 | #X connect 6 0 2 0; 24 | #X connect 7 0 2 0; 25 | #X connect 8 0 12 0; 26 | #X connect 8 1 9 0; 27 | #X connect 8 2 13 0; 28 | #X connect 8 3 14 0; 29 | #X connect 8 4 1 0; 30 | #X connect 8 5 6 0; 31 | #X connect 9 0 10 0; 32 | #X connect 10 0 2 0; 33 | #X connect 11 0 2 0; 34 | #X connect 12 0 11 0; 35 | #X connect 13 0 7 0; 36 | #X connect 14 0 0 0; 37 | -------------------------------------------------------------------------------- /test/MessageListAppend.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] append: 1 2 2 | [@ 0.000ms] append: walk the dog 1 2 3 | [@ 0.000ms] append: 1 2 3 1 2 4 | [@ 0.000ms] append: bang 5 | [@ 0.000ms] append: walk the dog 6 | [@ 0.000ms] append: 1 2 3 7 | [@ 0.000ms] append: go dog go 8 | [@ 0.000ms] append: walk the dog go dog go 9 | [@ 0.000ms] append: 1 2 3 go dog go -------------------------------------------------------------------------------- /test/MessageListAppend.pd: -------------------------------------------------------------------------------- 1 | #N canvas 678 22 450 300 10; 2 | #X obj 158 231 list append 1 2; 3 | #X obj 158 268 print append; 4 | #X msg 58 149 1 2 3; 5 | #X obj 114 21 loadbang; 6 | #X obj 194 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 7 | -1; 8 | #X msg 115 149 walk the dog; 9 | #X msg 258 148 go dog go; 10 | #X obj 338 149 b; 11 | #X obj 217 149 b; 12 | #X obj 83 115 t b b b; 13 | #X obj 205 60 t b b b b b; 14 | #X connect 0 0 1 0; 15 | #X connect 2 0 0 0; 16 | #X connect 3 0 10 0; 17 | #X connect 4 0 10 0; 18 | #X connect 5 0 0 0; 19 | #X connect 6 0 0 1; 20 | #X connect 7 0 0 1; 21 | #X connect 8 0 0 0; 22 | #X connect 9 0 2 0; 23 | #X connect 9 1 5 0; 24 | #X connect 9 2 8 0; 25 | #X connect 10 0 9 0; 26 | #X connect 10 1 6 0; 27 | #X connect 10 2 9 0; 28 | #X connect 10 3 7 0; 29 | #X connect 10 4 9 0; 30 | -------------------------------------------------------------------------------- /test/MessageListLength.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] length: 3 2 | [@ 0.000ms] length: 3 3 | [@ 0.000ms] length: 0 4 | [@ 0.000ms] length: 3 5 | [@ 0.000ms] length: 1 6 | [@ 0.000ms] length: 3 -------------------------------------------------------------------------------- /test/MessageListLength.pd: -------------------------------------------------------------------------------- 1 | #N canvas 578 89 405 361 10; 2 | #X msg 160 137 1 2 3; 3 | #X msg 19 137 walk the dog; 4 | #X msg 260 137 1 x y; 5 | #X msg 312 134 x 1 y; 6 | #X msg 122 136 55; 7 | #X obj 146 219 list length; 8 | #X obj 146 249 print length; 9 | #X obj 117 40 loadbang; 10 | #X obj 196 40 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 11 | -1; 12 | #X obj 124 74 t b b b b b b; 13 | #X obj 214 138 b; 14 | #X connect 0 0 5 0; 15 | #X connect 1 0 5 0; 16 | #X connect 2 0 5 0; 17 | #X connect 3 0 5 0; 18 | #X connect 4 0 5 0; 19 | #X connect 5 0 6 0; 20 | #X connect 7 0 9 0; 21 | #X connect 8 0 9 0; 22 | #X connect 9 0 1 0; 23 | #X connect 9 1 4 0; 24 | #X connect 9 2 0 0; 25 | #X connect 9 3 10 0; 26 | #X connect 9 4 2 0; 27 | #X connect 9 5 3 0; 28 | #X connect 10 0 5 0; 29 | -------------------------------------------------------------------------------- /test/MessageLoadbang.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: bang 2 | [@ 0.000ms] print: 34 3 | [@ 0.000ms] print: hello 4 | [@ 0.000ms] print: 12 4 87 5 | -------------------------------------------------------------------------------- /test/MessageLoadbang.pd: -------------------------------------------------------------------------------- 1 | #N canvas 214 189 450 300 10; 2 | #X obj 44 17 loadbang; 3 | #X obj 44 117 print; 4 | #X msg 72 66 34; 5 | #X msg 114 66 hello; 6 | #X msg 169 65 12 4 87; 7 | #X connect 0 0 1 0; 8 | #X connect 0 0 2 0; 9 | #X connect 0 0 3 0; 10 | #X connect 0 0 4 0; 11 | #X connect 2 0 1 0; 12 | #X connect 3 0 1 0; 13 | #X connect 4 0 1 0; 14 | -------------------------------------------------------------------------------- /test/MessageLog.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -1000 2 | [@ 0.000ms] print: -1000 3 | [@ 0.000ms] print: 1.30833 4 | -------------------------------------------------------------------------------- /test/MessageLog.pd: -------------------------------------------------------------------------------- 1 | #N canvas 675 197 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 180 99 -2 3 5; 7 | #X msg 104 99 3.7; 8 | #X obj 104 148 log; 9 | #X msg 139 99 0; 10 | #X obj 104 55 t b b b; 11 | #X connect 0 0 7 0; 12 | #X connect 2 0 7 0; 13 | #X connect 3 0 5 0; 14 | #X connect 4 0 5 0; 15 | #X connect 5 0 1 0; 16 | #X connect 6 0 5 0; 17 | #X connect 7 0 4 0; 18 | #X connect 7 1 6 0; 19 | #X connect 7 2 3 0; 20 | -------------------------------------------------------------------------------- /test/MessageLogicalAnd.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 0 -------------------------------------------------------------------------------- /test/MessageLogicalAnd.pd: -------------------------------------------------------------------------------- 1 | #N canvas 958 175 450 300 10; 2 | #X obj 157 46 loadbang; 3 | #X obj 232 47 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X msg 222 126 11; 6 | #X msg 257 127 3; 7 | #X msg 187 126 0; 8 | #X obj 209 236 print; 9 | #X msg 120 128 -10; 10 | #X msg 88 128 0; 11 | #X msg 153 127 10; 12 | #X obj 157 76 t b b b b b b b b; 13 | #X msg 328 126 0; 14 | #X msg 294 127 0; 15 | #X obj 209 201 &&; 16 | #X connect 0 0 9 0; 17 | #X connect 1 0 9 0; 18 | #X connect 2 0 12 0; 19 | #X connect 3 0 12 1; 20 | #X connect 4 0 12 1; 21 | #X connect 6 0 12 1; 22 | #X connect 7 0 12 0; 23 | #X connect 8 0 12 0; 24 | #X connect 9 0 7 0; 25 | #X connect 9 1 6 0; 26 | #X connect 9 2 8 0; 27 | #X connect 9 3 4 0; 28 | #X connect 9 4 2 0; 29 | #X connect 9 5 3 0; 30 | #X connect 9 6 11 0; 31 | #X connect 9 7 10 0; 32 | #X connect 10 0 12 1; 33 | #X connect 11 0 12 0; 34 | #X connect 12 0 5 0; 35 | -------------------------------------------------------------------------------- /test/MessageLogicalOr.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 1 4 | [@ 0.000ms] print: 1 -------------------------------------------------------------------------------- /test/MessageLogicalOr.pd: -------------------------------------------------------------------------------- 1 | #N canvas 958 175 450 300 10; 2 | #X obj 157 46 loadbang; 3 | #X obj 232 47 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X msg 222 126 11; 6 | #X msg 257 127 3; 7 | #X msg 187 126 0; 8 | #X obj 209 236 print; 9 | #X msg 120 128 -10; 10 | #X msg 88 128 0; 11 | #X msg 153 127 10; 12 | #X obj 209 201 ||; 13 | #X obj 157 76 t b b b b b b b b; 14 | #X msg 328 126 0; 15 | #X msg 294 127 0; 16 | #X connect 0 0 10 0; 17 | #X connect 1 0 10 0; 18 | #X connect 2 0 9 0; 19 | #X connect 3 0 9 1; 20 | #X connect 4 0 9 1; 21 | #X connect 6 0 9 1; 22 | #X connect 7 0 9 0; 23 | #X connect 8 0 9 0; 24 | #X connect 9 0 5 0; 25 | #X connect 10 0 7 0; 26 | #X connect 10 1 6 0; 27 | #X connect 10 2 8 0; 28 | #X connect 10 3 4 0; 29 | #X connect 10 4 2 0; 30 | #X connect 10 5 3 0; 31 | #X connect 10 6 12 0; 32 | #X connect 10 7 11 0; 33 | #X connect 11 0 9 1; 34 | #X connect 12 0 9 0; 35 | -------------------------------------------------------------------------------- /test/MessageMakefilename.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: dog0.aif 2 | [@ 0.000ms] print: dogmeat.aif 3 | [@ 0.000ms] print: dog0.aif -------------------------------------------------------------------------------- /test/MessageMakefilename.pd: -------------------------------------------------------------------------------- 1 | #N canvas 353 201 637 373 10; 2 | #X obj 450 139 print; 3 | #X obj 450 119 makefilename dog%d.aif; 4 | #X obj 106 21 loadbang; 5 | #X obj 176 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 6 | -1; 7 | #X msg 450 99 0; 8 | #X obj 246 145 print; 9 | #X obj 246 123 makefilename dog%s.aif; 10 | #X obj 43 236 print; 11 | #X obj 42 134 makefilename dog%%d.%s; 12 | #X msg 42 158 set \$1; 13 | #X obj 42 212 makefilename not-set-yet; 14 | #X obj 246 98 symbol meat; 15 | #X obj 42 105 symbol aif; 16 | #X obj 106 54 t b b b b; 17 | #X msg 74 182 0; 18 | #X connect 1 0 0 0; 19 | #X connect 2 0 13 0; 20 | #X connect 3 0 13 0; 21 | #X connect 4 0 1 0; 22 | #X connect 6 0 5 0; 23 | #X connect 8 0 9 0; 24 | #X connect 9 0 10 0; 25 | #X connect 10 0 7 0; 26 | #X connect 11 0 6 0; 27 | #X connect 12 0 8 0; 28 | #X connect 13 0 14 0; 29 | #X connect 13 1 12 0; 30 | #X connect 13 2 11 0; 31 | #X connect 13 3 4 0; 32 | #X connect 14 0 10 0; 33 | -------------------------------------------------------------------------------- /test/MessageMaximum.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 23 3 | [@ 0.000ms] print: 54 4 | [@ 0.000ms] print: 54 5 | -------------------------------------------------------------------------------- /test/MessageMaximum.pd: -------------------------------------------------------------------------------- 1 | #N canvas 802 231 450 300 10; 2 | #X obj 46 34 loadbang; 3 | #X obj 46 217 print; 4 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 7 | -1; 8 | #X obj 46 179 max; 9 | #X msg 150 123 23; 10 | #X msg 114 123 54; 11 | #X msg 78 123 17; 12 | #X obj 46 69 t b b b b b; 13 | #X connect 0 0 8 0; 14 | #X connect 2 0 8 0; 15 | #X connect 4 0 1 0; 16 | #X connect 5 0 4 0; 17 | #X connect 6 0 4 1; 18 | #X connect 7 0 4 0; 19 | #X connect 8 0 4 0; 20 | #X connect 8 1 7 0; 21 | #X connect 8 2 6 0; 22 | #X connect 8 3 5 0; 23 | #X connect 8 4 4 0; 24 | -------------------------------------------------------------------------------- /test/MessageMessageBox.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] direct: 0-haha 2 | [@ 0.000ms] direct: 2 3 | [@ 0.000ms] direct: 0 4 | [@ 0.000ms] remote: 3 -------------------------------------------------------------------------------- /test/MessageMessageBox.pd: -------------------------------------------------------------------------------- 1 | #N canvas 561 22 450 300 10; 2 | #X obj 128 42 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 172 38 loadbang; 5 | #X obj 150 99 f \$0; 6 | #X obj 261 204 r \$0-test; 7 | #X obj 150 248 print direct; 8 | #X obj 261 247 print remote; 9 | #X msg 150 140 \$1-haha \, 2 \, \$1 \; \$1-test 3 \;; 10 | #X connect 0 0 2 0; 11 | #X connect 1 0 2 0; 12 | #X connect 2 0 6 0; 13 | #X connect 3 0 5 0; 14 | #X connect 6 0 4 0; 15 | -------------------------------------------------------------------------------- /test/MessageMetro.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 500.000ms] print: 1 3 | [@ 1000.000ms] print: 2 4 | [@ 1500.000ms] print: 3 5 | [@ 2000.000ms] print: 4 6 | [@ 2500.000ms] print: 5 7 | [@ 9000.000ms] print: 6 8 | [@ 10000.000ms] print: 7 9 | [@ 11000.000ms] print: 8 10 | -------------------------------------------------------------------------------- /test/MessageMetro.pd: -------------------------------------------------------------------------------- 1 | #N canvas 894 221 263 455 10; 2 | #X obj 21 19 loadbang; 3 | #X obj 83 347 print; 4 | #X obj 83 287 metro 500; 5 | #X obj 83 318 int; 6 | #X obj 119 317 + 1; 7 | #X msg 68 211 stop; 8 | #X obj 87 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 9 | -1; 10 | #X obj 68 79 delay 3000; 11 | #X msg 36 234 17; 12 | #X msg 21 256 0; 13 | #X obj 21 50 t b b b b b; 14 | #X obj 135 242 1000; 15 | #X obj 52 109 delay 6000; 16 | #X obj 36 143 delay 9000; 17 | #X obj 21 173 delay 12000; 18 | #X connect 0 0 10 0; 19 | #X connect 2 0 3 0; 20 | #X connect 3 0 1 0; 21 | #X connect 3 0 4 0; 22 | #X connect 4 0 3 1; 23 | #X connect 5 0 2 0; 24 | #X connect 6 0 10 0; 25 | #X connect 7 0 5 0; 26 | #X connect 8 0 2 0; 27 | #X connect 9 0 2 0; 28 | #X connect 10 0 14 0; 29 | #X connect 10 1 13 0; 30 | #X connect 10 2 12 0; 31 | #X connect 10 3 7 0; 32 | #X connect 10 4 2 0; 33 | #X connect 11 0 2 1; 34 | #X connect 12 0 11 0; 35 | #X connect 13 0 8 0; 36 | #X connect 14 0 9 0; 37 | -------------------------------------------------------------------------------- /test/MessageMidiToFrequency.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 9.17702 2 | [@ 0.000ms] print: 8.1758 3 | [@ 0.000ms] print: 3.57934 4 | [@ 0.000ms] print: 10.1239 5 | -------------------------------------------------------------------------------- /test/MessageMidiToFrequency.pd: -------------------------------------------------------------------------------- 1 | #N canvas 718 167 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 237 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 191 99 0; 9 | #X obj 104 54 t b b b b b b; 10 | #X obj 104 202 mtof; 11 | #X msg 232 99 2 3 5; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 7 0; 15 | #X connect 4 0 7 0; 16 | #X connect 5 0 7 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 4 8 0; 21 | #X connect 7 0 1 0; 22 | #X connect 8 0 7 0; 23 | -------------------------------------------------------------------------------- /test/MessageMinimum.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 5 4 | [@ 0.000ms] print: 5 5 | -------------------------------------------------------------------------------- /test/MessageMinimum.pd: -------------------------------------------------------------------------------- 1 | #N canvas 805 312 450 300 10; 2 | #X obj 46 34 loadbang; 3 | #X obj 46 217 print; 4 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X obj 117 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 7 | -1; 8 | #X msg 150 123 23; 9 | #X obj 46 69 t b b b b b; 10 | #X obj 46 179 min; 11 | #X msg 114 123 11; 12 | #X msg 78 123 5; 13 | #X connect 0 0 5 0; 14 | #X connect 2 0 5 0; 15 | #X connect 4 0 6 0; 16 | #X connect 5 0 6 0; 17 | #X connect 5 1 8 0; 18 | #X connect 5 2 7 0; 19 | #X connect 5 3 4 0; 20 | #X connect 5 4 6 0; 21 | #X connect 6 0 1 0; 22 | #X connect 7 0 6 1; 23 | #X connect 8 0 6 0; 24 | -------------------------------------------------------------------------------- /test/MessageModulus.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 2 2 | [@ 0.000ms] print: 2 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 35 5 | [@ 0.000ms] print: 7 6 | -------------------------------------------------------------------------------- /test/MessageModulus.pd: -------------------------------------------------------------------------------- 1 | #N canvas 786 205 217 358 10; 2 | #X obj 69 12 loadbang; 3 | #X obj 28 13 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 112 325 print; 6 | #X obj 112 288 mod; 7 | #X msg 69 165 -47; 8 | #X msg 41 217 61; 9 | #X msg 28 241 7; 10 | #X msg 55 191 -12; 11 | #X msg 97 114 2; 12 | #X msg 83 138 0; 13 | #X obj 28 44 t b b b b b b b b b; 14 | #X msg 139 68 3; 15 | #X msg 125 88 11; 16 | #X connect 0 0 10 0; 17 | #X connect 1 0 10 0; 18 | #X connect 3 0 2 0; 19 | #X connect 4 0 3 1; 20 | #X connect 5 0 3 1; 21 | #X connect 6 0 3 0; 22 | #X connect 7 0 3 0; 23 | #X connect 8 0 3 1; 24 | #X connect 9 0 3 0; 25 | #X connect 10 0 6 0; 26 | #X connect 10 1 5 0; 27 | #X connect 10 2 7 0; 28 | #X connect 10 3 4 0; 29 | #X connect 10 4 9 0; 30 | #X connect 10 5 8 0; 31 | #X connect 10 6 3 0; 32 | #X connect 10 7 12 0; 33 | #X connect 10 8 11 0; 34 | #X connect 11 0 3 1; 35 | #X connect 12 0 3 0; 36 | -------------------------------------------------------------------------------- /test/MessageMoses.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] right: 30 2 | [@ 0.000ms] left: 30 3 | [@ 0.000ms] left: -10 -------------------------------------------------------------------------------- /test/MessageMoses.pd: -------------------------------------------------------------------------------- 1 | #N canvas 611 170 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X obj 21 184 print left; 4 | #X obj 99 184 print right; 5 | #X obj 82 18 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 6 | -1; 7 | #X obj 21 65 t b b b b b; 8 | #X obj 21 147 moses 10; 9 | #X msg 59 103 40; 10 | #X msg 21 103 30; 11 | #X msg 137 103 -10; 12 | #X msg 98 103 -1; 13 | #X connect 0 0 4 0; 14 | #X connect 3 0 4 0; 15 | #X connect 4 0 8 0; 16 | #X connect 4 1 9 0; 17 | #X connect 4 2 7 0; 18 | #X connect 4 3 6 0; 19 | #X connect 4 4 7 0; 20 | #X connect 5 0 1 0; 21 | #X connect 5 1 2 0; 22 | #X connect 6 0 5 1; 23 | #X connect 7 0 5 0; 24 | #X connect 8 0 5 0; 25 | #X connect 9 0 5 1; 26 | -------------------------------------------------------------------------------- /test/MessageMultiply.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 25 2 | [@ 0.000ms] print: 6 3 | [@ 0.000ms] print: 15 4 | [@ 0.000ms] print: 39 5 | [@ 0.000ms] print: 12 6 | [@ 0.000ms] print: 35 7 | -------------------------------------------------------------------------------- /test/MessageMultiply.pd: -------------------------------------------------------------------------------- 1 | #N canvas 761 150 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 140 71 13; 4 | #X obj 21 174 print; 5 | #X msg 111 71 x; 6 | #X msg 80 71 3; 7 | #X msg 51 71 4; 8 | #X msg 21 71 5 7; 9 | #X msg 170 71 x; 10 | #X msg 200 71 5; 11 | #X obj 21 40 t b b b b b b b b b; 12 | #X msg 233 71 2 3 4; 13 | #X msg 280 71 5; 14 | #X obj 21 153 * 5; 15 | #X connect 0 0 9 0; 16 | #X connect 1 0 12 0; 17 | #X connect 3 0 12 0; 18 | #X connect 4 0 12 1; 19 | #X connect 5 0 12 0; 20 | #X connect 6 0 12 0; 21 | #X connect 7 0 12 1; 22 | #X connect 8 0 12 0; 23 | #X connect 9 0 6 0; 24 | #X connect 9 1 5 0; 25 | #X connect 9 2 4 0; 26 | #X connect 9 3 3 0; 27 | #X connect 9 4 1 0; 28 | #X connect 9 5 7 0; 29 | #X connect 9 6 8 0; 30 | #X connect 9 7 10 0; 31 | #X connect 9 8 11 0; 32 | #X connect 10 0 12 0; 33 | #X connect 11 0 12 0; 34 | #X connect 12 0 2 0; 35 | -------------------------------------------------------------------------------- /test/MessageNotEquals.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 1 4 | [@ 0.000ms] print: 1 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: 0 -------------------------------------------------------------------------------- /test/MessageNotEquals.pd: -------------------------------------------------------------------------------- 1 | #N canvas 538 240 299 337 10; 2 | #X obj 74 21 loadbang; 3 | #X obj 42 21 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 62 134 t b b b; 6 | #X msg 85 180 0; 7 | #X obj 124 180 1; 8 | #X obj 80 226 != 0; 9 | #X obj 80 260 print; 10 | #X msg 163 181 0; 11 | #X msg 203 181 1; 12 | #X obj 64 80 t b b b b; 13 | #X connect 0 0 9 0; 14 | #X connect 1 0 9 0; 15 | #X connect 2 0 5 0; 16 | #X connect 2 1 3 0; 17 | #X connect 2 2 4 0; 18 | #X connect 3 0 5 0; 19 | #X connect 4 0 5 0; 20 | #X connect 5 0 6 0; 21 | #X connect 7 0 5 1; 22 | #X connect 8 0 5 1; 23 | #X connect 9 0 2 0; 24 | #X connect 9 1 7 0; 25 | #X connect 9 2 2 0; 26 | #X connect 9 3 8 0; 27 | -------------------------------------------------------------------------------- /test/MessagePack.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 3 2 | [@ 0.000ms] print: 1 2 3 -------------------------------------------------------------------------------- /test/MessagePack.pd: -------------------------------------------------------------------------------- 1 | #N canvas 166 207 450 300 10; 2 | #X obj 156 41 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 202 41 loadbang; 5 | #X obj 187 178 pack f f f; 6 | #X obj 187 219 print; 7 | #X obj 263 134 f 3; 8 | #X obj 223 135 f 2; 9 | #X obj 190 136 f 1; 10 | #X obj 167 96 t b b b b; 11 | #X connect 0 0 7 0; 12 | #X connect 1 0 7 0; 13 | #X connect 2 0 3 0; 14 | #X connect 4 0 2 2; 15 | #X connect 5 0 2 1; 16 | #X connect 6 0 2 0; 17 | #X connect 7 0 2 0; 18 | #X connect 7 1 6 0; 19 | #X connect 7 2 5 0; 20 | #X connect 7 3 4 0; 21 | -------------------------------------------------------------------------------- /test/MessagePipe.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] piped: hello 2 | [@ 0.000ms] flushed: water 3 | [@ 0.000ms] flushed: water 4 | [@ 1000.000ms] piped: hello 5 | [@ 2000.000ms] piped: hello -------------------------------------------------------------------------------- /test/MessagePipe.pd: -------------------------------------------------------------------------------- 1 | #N canvas 414 303 576 325 10; 2 | #X obj 255 12 loadbang; 3 | #X obj 228 13 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X msg 431 216 hello; 6 | #X msg 507 147 2000; 7 | #X obj 449 178 pipe 1000; 8 | #X obj 431 261 print piped; 9 | #X obj 392 93 t b b b; 10 | #X obj 316 93 t b b b; 11 | #X obj 208 93 t b b b; 12 | #X obj 342 150 pipe 4000; 13 | #X obj 343 261 print flushed; 14 | #X msg 343 208 water; 15 | #X obj 234 150 pipe 4000; 16 | #X obj 235 261 print cleared; 17 | #X msg 235 208 fire; 18 | #X msg 289 125 flush; 19 | #X msg 181 125 clear; 20 | #X connect 0 0 6 0; 21 | #X connect 0 0 7 0; 22 | #X connect 0 0 8 0; 23 | #X connect 1 0 6 0; 24 | #X connect 1 0 7 0; 25 | #X connect 1 0 8 0; 26 | #X connect 2 0 5 0; 27 | #X connect 3 0 4 1; 28 | #X connect 4 0 2 0; 29 | #X connect 6 0 4 0; 30 | #X connect 6 1 3 0; 31 | #X connect 6 2 2 0; 32 | #X connect 6 2 4 0; 33 | #X connect 7 0 15 0; 34 | #X connect 7 1 9 0; 35 | #X connect 7 2 9 0; 36 | #X connect 8 0 16 0; 37 | #X connect 8 1 12 0; 38 | #X connect 8 2 12 0; 39 | #X connect 9 0 11 0; 40 | #X connect 11 0 10 0; 41 | #X connect 12 0 14 0; 42 | #X connect 14 0 13 0; 43 | #X connect 15 0 9 0; 44 | #X connect 16 0 12 0; 45 | -------------------------------------------------------------------------------- /test/MessagePow.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1.18059e+21 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 0.073046 5 | -------------------------------------------------------------------------------- /test/MessagePow.pd: -------------------------------------------------------------------------------- 1 | #N canvas 718 249 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 237 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 191 99 0; 9 | #X obj 104 202 pow; 10 | #X msg 229 99 -2; 11 | #X obj 104 54 t b b b b b b; 12 | #X msg 266 99 32; 13 | #X msg 304 99 14; 14 | #X connect 0 0 8 0; 15 | #X connect 2 0 8 0; 16 | #X connect 3 0 6 0; 17 | #X connect 4 0 6 0; 18 | #X connect 5 0 6 0; 19 | #X connect 6 0 1 0; 20 | #X connect 7 0 6 1; 21 | #X connect 8 0 4 0; 22 | #X connect 8 1 3 0; 23 | #X connect 8 2 5 0; 24 | #X connect 8 3 7 0; 25 | #X connect 8 4 9 0; 26 | #X connect 8 5 10 0; 27 | #X connect 9 0 6 0; 28 | #X connect 10 0 6 1; 29 | -------------------------------------------------------------------------------- /test/MessagePowToDb.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 113.802 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 105.682 -------------------------------------------------------------------------------- /test/MessagePowToDb.pd: -------------------------------------------------------------------------------- 1 | #N canvas 696 193 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 197 99 0; 9 | #X obj 104 54 t b b b b; 10 | #X msg 235 99 24 35 48; 11 | #X obj 104 148 powtodb; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 3 7 0; 21 | #X connect 7 0 8 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessagePrint.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: test 2 | [@ 0.000ms] x1: 3.14 3 | [@ 0.000ms] x1: walk the dog 4 | [@ 0.000ms] x1: 234 5 | [@ 0.000ms] x1: bang 6 | [@ 0.000ms] 1 7 | -------------------------------------------------------------------------------- /test/MessagePrint.pd: -------------------------------------------------------------------------------- 1 | #N canvas 657 346 454 211 10; 2 | #X obj 16 5 loadbang; 3 | #X msg 158 111 walk the dog; 4 | #X msg 82 111 bang; 5 | #X msg 123 111 234; 6 | #X obj 124 155 print x1; 7 | #X obj 47 155 print -n; 8 | #X msg 272 111 3.14; 9 | #X msg 48 111 1; 10 | #X msg 328 111 test; 11 | #X obj 328 155 print; 12 | #X obj 48 49 t b b b b b b; 13 | #X obj 16 26 t b b; 14 | #X connect 0 0 11 0; 15 | #X connect 1 0 4 0; 16 | #X connect 2 0 4 0; 17 | #X connect 3 0 4 0; 18 | #X connect 6 0 4 0; 19 | #X connect 7 0 5 0; 20 | #X connect 8 0 9 0; 21 | #X connect 10 0 7 0; 22 | #X connect 10 1 2 0; 23 | #X connect 10 2 3 0; 24 | #X connect 10 3 1 0; 25 | #X connect 10 4 6 0; 26 | #X connect 10 5 8 0; 27 | #X connect 11 1 10 0; 28 | -------------------------------------------------------------------------------- /test/MessageRandom.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 3 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 2 6 | [@ 0.000ms] print: 4 7 | [@ 0.000ms] print: 2 8 | [@ 0.000ms] print: 2 9 | [@ 0.000ms] print: 2 10 | [@ 0.000ms] print: 2 11 | [@ 0.000ms] print: 17 12 | [@ 0.000ms] print: 16 13 | [@ 0.000ms] print: 15 14 | [@ 0.000ms] print: 4 15 | [@ 0.000ms] print: 11 16 | [@ 0.000ms] print: 16 17 | [@ 0.000ms] print: 9 18 | [@ 0.000ms] print: 2 19 | [@ 0.000ms] print: 12 20 | [@ 0.000ms] print: 4 21 | -------------------------------------------------------------------------------- /test/MessageRandom.pd: -------------------------------------------------------------------------------- 1 | #N canvas 814 394 450 300 10; 2 | #X obj 94 226 random 5; 3 | #X obj 94 262 print; 4 | #X obj 136 154 until; 5 | #X msg 129 130 10; 6 | #X obj 84 24 loadbang; 7 | #X msg 227 150 20; 8 | #X obj 82 85 t b b b b; 9 | #X obj 161 30 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 10 | -1; 11 | #X msg 64 160 seed 100; 12 | #X connect 0 0 1 0; 13 | #X connect 2 0 0 0; 14 | #X connect 3 0 2 0; 15 | #X connect 4 0 6 0; 16 | #X connect 5 0 0 1; 17 | #X connect 6 0 3 0; 18 | #X connect 6 1 5 0; 19 | #X connect 6 2 3 0; 20 | #X connect 6 3 8 0; 21 | #X connect 7 0 6 0; 22 | #X connect 8 0 0 0; 23 | -------------------------------------------------------------------------------- /test/MessageReceive.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] printed: hello 2 | [@ 0.000ms] print: 37 -------------------------------------------------------------------------------- /test/MessageReceive.pd: -------------------------------------------------------------------------------- 1 | #N canvas 554 371 450 300 10; 2 | #X obj 27 -67 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 66 -69 loadbang; 5 | #X obj 175 -64 receive; 6 | #X obj 175 -30 print; 7 | #X obj 27 -34 t b b; 8 | #X obj 174 36 print printed apple; 9 | #X msg 70 7 hello; 10 | #X obj 27 42 send; 11 | #X msg 27 7 37; 12 | #X obj 70 40 s apple; 13 | #X obj 174 2 r apple; 14 | #X connect 0 0 4 0; 15 | #X connect 1 0 4 0; 16 | #X connect 2 0 3 0; 17 | #X connect 4 0 8 0; 18 | #X connect 4 1 6 0; 19 | #X connect 6 0 9 0; 20 | #X connect 8 0 7 0; 21 | #X connect 10 0 5 0; 22 | -------------------------------------------------------------------------------- /test/MessageRemainder.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 2 3 | [@ 0.000ms] print: 2 4 | [@ 0.000ms] print: 1 5 | [@ 0.000ms] print: 0 6 | [@ 0.000ms] print: 5 7 | -------------------------------------------------------------------------------- /test/MessageRemainder.pd: -------------------------------------------------------------------------------- 1 | #N canvas 770 128 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 140 78 13; 4 | #X obj 21 181 print; 5 | #X msg 111 78 x; 6 | #X msg 51 78 4; 7 | #X msg 21 78 5 7; 8 | #X msg 170 78 x; 9 | #X msg 200 78 5; 10 | #X obj 21 47 t b b b b b b b b b; 11 | #X msg 233 78 2 3 4; 12 | #X msg 280 78 5; 13 | #X msg 80 78 0; 14 | #X obj 82 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 15 | -1; 16 | #X obj 21 158 % 5; 17 | #X connect 0 0 8 0; 18 | #X connect 1 0 13 0; 19 | #X connect 3 0 13 0; 20 | #X connect 4 0 13 0; 21 | #X connect 5 0 13 0; 22 | #X connect 6 0 13 1; 23 | #X connect 7 0 13 0; 24 | #X connect 8 0 5 0; 25 | #X connect 8 1 4 0; 26 | #X connect 8 2 11 0; 27 | #X connect 8 3 3 0; 28 | #X connect 8 4 1 0; 29 | #X connect 8 5 6 0; 30 | #X connect 8 6 7 0; 31 | #X connect 8 7 9 0; 32 | #X connect 8 8 10 0; 33 | #X connect 9 0 13 0; 34 | #X connect 10 0 13 0; 35 | #X connect 11 0 13 1; 36 | #X connect 12 0 8 0; 37 | #X connect 13 0 2 0; 38 | -------------------------------------------------------------------------------- /test/MessageRmsToDb.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 127.604 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 111.364 5 | -------------------------------------------------------------------------------- /test/MessageRmsToDb.pd: -------------------------------------------------------------------------------- 1 | #N canvas 696 193 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 197 99 0; 9 | #X obj 104 54 t b b b b; 10 | #X msg 235 99 24 35 48; 11 | #X obj 104 148 rmstodb; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 3 7 0; 21 | #X connect 7 0 8 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageRoute.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] y1: apple pie 2 | [@ 0.000ms] y2: pie 3 | [@ 0.000ms] y3: impeach ringo starr 4 | [@ 0.000ms] y3: 1 2 3 5 | [@ 0.000ms] x4: walk the dog 6 | [@ 0.000ms] x3: foo bar 7 | [@ 0.000ms] x2: 43 8 | [@ 0.000ms] x1: 34 45 9 | [@ 0.000ms] x4: 234 345 456 -------------------------------------------------------------------------------- /test/MessageRoute.pd: -------------------------------------------------------------------------------- 1 | #N canvas 183 229 1083 455 10; 2 | #X obj 70 174 print x1; 3 | #X obj 148 174 print x2; 4 | #X obj 226 174 print x3; 5 | #X obj 309 174 print x4; 6 | #X obj 70 146 route 23 54 1; 7 | #X msg 70 116 234 345 456; 8 | #X msg 195 116 23 34 45; 9 | #X msg 301 116 54 43; 10 | #X msg 372 116 1 foo bar; 11 | #X msg 465 116 walk the dog; 12 | #X obj 492 18 loadbang; 13 | #X obj 471 18 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 14 | -1; 15 | #X msg 641 114 impeach ringo starr; 16 | #X obj 578 142 route big apple; 17 | #X msg 822 115 apple pie; 18 | #X msg 578 114 1 2 3; 19 | #X msg 910 115 big apple pie; 20 | #X obj 578 172 print y1; 21 | #X obj 656 172 print y2; 22 | #X obj 734 172 print y3; 23 | #X obj 492 50 t b b b b b b b b b; 24 | #X text 564 18 these examples are taken directly from the Pd documentation 25 | ; 26 | #X connect 4 0 0 0; 27 | #X connect 4 1 1 0; 28 | #X connect 4 2 2 0; 29 | #X connect 4 3 3 0; 30 | #X connect 5 0 4 0; 31 | #X connect 6 0 4 0; 32 | #X connect 7 0 4 0; 33 | #X connect 8 0 4 0; 34 | #X connect 9 0 4 0; 35 | #X connect 10 0 20 0; 36 | #X connect 11 0 20 0; 37 | #X connect 12 0 13 0; 38 | #X connect 13 0 17 0; 39 | #X connect 13 1 18 0; 40 | #X connect 13 2 19 0; 41 | #X connect 14 0 13 0; 42 | #X connect 15 0 13 0; 43 | #X connect 16 0 13 0; 44 | #X connect 20 0 5 0; 45 | #X connect 20 1 6 0; 46 | #X connect 20 2 7 0; 47 | #X connect 20 3 8 0; 48 | #X connect 20 4 9 0; 49 | #X connect 20 5 15 0; 50 | #X connect 20 6 12 0; 51 | #X connect 20 7 14 0; 52 | #X connect 20 8 16 0; 53 | -------------------------------------------------------------------------------- /test/MessageSelect.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] third: bang 2 | [@ 0.000ms] first: bang 3 | [@ 0.000ms] second: bang -------------------------------------------------------------------------------- /test/MessageSelect.pd: -------------------------------------------------------------------------------- 1 | #N canvas 1070 406 450 300 10; 2 | #X obj 94 -67 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 133 -69 loadbang; 5 | #X msg 144 9 64; 6 | #X msg 94 10 -32.2; 7 | #X obj 94 -33 t b b b; 8 | #X obj 289 107 print nomatch; 9 | #X obj 124 108 print second; 10 | #X obj 45 108 print first; 11 | #X obj 210 107 print third; 12 | #X obj 93 67 select 64 -32.2 0; 13 | #X msg 180 10 0; 14 | #X connect 0 0 4 0; 15 | #X connect 1 0 4 0; 16 | #X connect 2 0 9 0; 17 | #X connect 3 0 9 0; 18 | #X connect 4 0 3 0; 19 | #X connect 4 1 2 0; 20 | #X connect 4 2 10 0; 21 | #X connect 9 0 7 0; 22 | #X connect 9 1 6 0; 23 | #X connect 9 2 8 0; 24 | #X connect 9 3 5 0; 25 | #X connect 10 0 9 0; 26 | -------------------------------------------------------------------------------- /test/MessageSend.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] printed: hello 2 | [@ 0.000ms] print: 37 -------------------------------------------------------------------------------- /test/MessageSend.pd: -------------------------------------------------------------------------------- 1 | #N canvas 542 205 450 300 10; 2 | #X obj 27 -67 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 66 -69 loadbang; 5 | #X obj 175 -64 receive; 6 | #X obj 175 -30 print; 7 | #X obj 27 -34 t b b; 8 | #X obj 174 36 print printed apple; 9 | #X msg 70 7 hello; 10 | #X obj 27 42 send; 11 | #X msg 27 7 37; 12 | #X obj 70 40 s apple; 13 | #X obj 174 2 r apple; 14 | #X connect 0 0 4 0; 15 | #X connect 1 0 4 0; 16 | #X connect 2 0 3 0; 17 | #X connect 4 0 8 0; 18 | #X connect 4 1 6 0; 19 | #X connect 6 0 9 0; 20 | #X connect 8 0 7 0; 21 | #X connect 10 0 5 0; 22 | -------------------------------------------------------------------------------- /test/MessageSend_variable.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] received: 3 2 | [@ 0.000ms] received: 2 3 | [@ 0.000ms] received: 1 -------------------------------------------------------------------------------- /test/MessageSend_variable.pd: -------------------------------------------------------------------------------- 1 | #N canvas 333 115 441 428 10; 2 | #X obj 95 63 loadbang; 3 | #X obj 95 93 metro 1000; 4 | #X obj 176 316 r send-test; 5 | #X obj 95 203 s send-test; 6 | #X obj 176 339 print received; 7 | #X msg 95 173 1; 8 | #X msg 171 204 \; send-test \$1 \;; 9 | #X msg 171 173 2; 10 | #X obj 274 252 s; 11 | #X obj 301 227 symbol; 12 | #X obj 274 173 t b f; 13 | #X msg 301 199 send-test; 14 | #X msg 274 215 3; 15 | #X obj 95 123 t b b b; 16 | #X connect 0 0 1 0; 17 | #X connect 1 0 13 0; 18 | #X connect 2 0 4 0; 19 | #X connect 5 0 3 0; 20 | #X connect 7 0 6 0; 21 | #X connect 9 0 8 1; 22 | #X connect 10 0 12 0; 23 | #X connect 10 1 11 0; 24 | #X connect 11 0 9 0; 25 | #X connect 12 0 8 0; 26 | #X connect 13 0 5 0; 27 | #X connect 13 1 7 0; 28 | #X connect 13 2 10 0; 29 | -------------------------------------------------------------------------------- /test/MessageSine.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: -0.909297 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: -0.986772 4 | [@ 0.000ms] print: -0.529836 5 | -------------------------------------------------------------------------------- /test/MessageSine.pd: -------------------------------------------------------------------------------- 1 | #N canvas 633 240 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 235 99 -2 3 5; 7 | #X msg 139 99 -14.3; 8 | #X msg 104 99 3.7; 9 | #X msg 197 99 0; 10 | #X obj 104 54 t b b b b; 11 | #X obj 104 148 sin; 12 | #X connect 0 0 7 0; 13 | #X connect 2 0 7 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 8 0; 18 | #X connect 7 0 5 0; 19 | #X connect 7 1 4 0; 20 | #X connect 7 2 6 0; 21 | #X connect 7 3 3 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageSpigot.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: hello 2 | [@ 0.000ms] print: 0 -------------------------------------------------------------------------------- /test/MessageSpigot.pd: -------------------------------------------------------------------------------- 1 | #N canvas 1095 634 450 300 10; 2 | #X obj 107 168 spigot; 3 | #X obj 107 5 loadbang; 4 | #X obj 176 6 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X obj 107 214 print; 7 | #X msg 164 132 0; 8 | #X msg 195 132 1; 9 | #X msg 228 132 9923; 10 | #X obj 107 43 t b b b b b b b; 11 | #X msg 97 92 hello; 12 | #X msg 54 92 bang; 13 | #X msg 14 93 0; 14 | #X msg 147 91 -4.2218; 15 | #X connect 0 0 3 0; 16 | #X connect 1 0 7 0; 17 | #X connect 2 0 7 0; 18 | #X connect 4 0 0 1; 19 | #X connect 5 0 0 1; 20 | #X connect 6 0 0 1; 21 | #X connect 7 0 10 0; 22 | #X connect 7 1 6 0; 23 | #X connect 7 2 9 0; 24 | #X connect 7 3 4 0; 25 | #X connect 7 4 8 0; 26 | #X connect 7 5 5 0; 27 | #X connect 7 6 11 0; 28 | #X connect 8 0 0 0; 29 | #X connect 9 0 0 0; 30 | #X connect 10 0 0 0; 31 | #X connect 11 0 0 0; 32 | -------------------------------------------------------------------------------- /test/MessageSqrt.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 1.92354 5 | -------------------------------------------------------------------------------- /test/MessageSqrt.pd: -------------------------------------------------------------------------------- 1 | #N canvas 775 238 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 139 99 -14.3; 7 | #X msg 104 99 3.7; 8 | #X msg 197 99 0; 9 | #X obj 104 54 t b b b b; 10 | #X obj 104 148 sqrt; 11 | #X msg 235 99 -2 3 5; 12 | #X connect 0 0 6 0; 13 | #X connect 2 0 6 0; 14 | #X connect 3 0 7 0; 15 | #X connect 4 0 7 0; 16 | #X connect 5 0 7 0; 17 | #X connect 6 0 4 0; 18 | #X connect 6 1 3 0; 19 | #X connect 6 2 5 0; 20 | #X connect 6 3 8 0; 21 | #X connect 7 0 1 0; 22 | #X connect 8 0 7 0; 23 | -------------------------------------------------------------------------------- /test/MessageSubtract.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: -1 3 | [@ 0.000ms] print: 2 4 | [@ 0.000ms] print: 10 5 | [@ 0.000ms] print: 1 6 | [@ 0.000ms] print: -2 7 | -------------------------------------------------------------------------------- /test/MessageSubtract.pd: -------------------------------------------------------------------------------- 1 | #N canvas 762 177 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 140 71 13; 4 | #X obj 21 174 print; 5 | #X msg 111 71 x; 6 | #X msg 80 71 3; 7 | #X msg 51 71 4; 8 | #X msg 21 71 5 7; 9 | #X msg 170 71 x; 10 | #X msg 200 71 5; 11 | #X obj 21 40 t b b b b b b b b b; 12 | #X msg 233 71 2 3 4; 13 | #X msg 280 71 5; 14 | #X obj 21 153 - 5; 15 | #X connect 0 0 9 0; 16 | #X connect 1 0 12 0; 17 | #X connect 3 0 12 0; 18 | #X connect 4 0 12 1; 19 | #X connect 5 0 12 0; 20 | #X connect 6 0 12 0; 21 | #X connect 7 0 12 1; 22 | #X connect 8 0 12 0; 23 | #X connect 9 0 6 0; 24 | #X connect 9 1 5 0; 25 | #X connect 9 2 4 0; 26 | #X connect 9 3 3 0; 27 | #X connect 9 4 1 0; 28 | #X connect 9 5 7 0; 29 | #X connect 9 6 8 0; 30 | #X connect 9 7 10 0; 31 | #X connect 9 8 11 0; 32 | #X connect 10 0 12 0; 33 | #X connect 11 0 12 0; 34 | #X connect 12 0 2 0; 35 | -------------------------------------------------------------------------------- /test/MessageSwap.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] right: 42 2 | [@ 0.000ms] left: 7 3 | [@ 0.000ms] right: 42 4 | [@ 0.000ms] left: 7 5 | [@ 0.000ms] right: 77 6 | [@ 0.000ms] left: 66 7 | [@ 0.000ms] right: 77 8 | [@ 0.000ms] left: 66 9 | [@ 0.000ms] nothing: 0 10 | [@ 0.000ms] twelve: 12 -------------------------------------------------------------------------------- /test/MessageSwap.pd: -------------------------------------------------------------------------------- 1 | #N canvas 569 334 450 300 10; 2 | #X obj 218 30 loadbang; 3 | #X obj 289 30 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 218 176 swap; 6 | #X obj 218 68 t b b b b b; 7 | #X msg 361 118 42 7; 8 | #X msg 300 119 42 7 3 4; 9 | #X msg 265 120 66; 10 | #X msg 233 121 77; 11 | #X obj 218 216 print left; 12 | #X obj 294 215 print right; 13 | #X obj 82 129 swap 12; 14 | #X obj 82 207 print twelve; 15 | #X obj 121 181 print nothing; 16 | #X connect 0 0 3 0; 17 | #X connect 0 0 10 0; 18 | #X connect 1 0 3 0; 19 | #X connect 1 0 10 0; 20 | #X connect 2 0 8 0; 21 | #X connect 2 1 9 0; 22 | #X connect 3 0 2 0; 23 | #X connect 3 1 7 0; 24 | #X connect 3 2 6 0; 25 | #X connect 3 3 5 0; 26 | #X connect 3 4 4 0; 27 | #X connect 4 0 2 0; 28 | #X connect 5 0 2 0; 29 | #X connect 6 0 2 1; 30 | #X connect 7 0 2 0; 31 | #X connect 10 0 11 0; 32 | #X connect 10 1 12 0; 33 | -------------------------------------------------------------------------------- /test/MessageSymbol.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: dog 2 | [@ 0.000ms] print: dog 3 | [@ 0.000ms] print: cat -------------------------------------------------------------------------------- /test/MessageSymbol.pd: -------------------------------------------------------------------------------- 1 | #N canvas 607 190 450 300 10; 2 | #X obj 146 171 symbol; 3 | #X obj 146 44 loadbang; 4 | #X obj 208 45 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X obj 146 76 t b b b b; 7 | #X obj 146 213 print; 8 | #X msg 233 127 symbol cat; 9 | #X msg 180 128 dog; 10 | #X connect 0 0 4 0; 11 | #X connect 1 0 3 0; 12 | #X connect 2 0 3 0; 13 | #X connect 3 0 0 0; 14 | #X connect 3 1 5 0; 15 | #X connect 3 2 0 0; 16 | #X connect 3 3 6 0; 17 | #X connect 5 0 0 1; 18 | #X connect 6 0 0 0; 19 | -------------------------------------------------------------------------------- /test/MessageTable.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 6 2 | [@ 0.000ms] print: 12 3 | [@ 0.000ms] print: 5 4 | [@ 0.000ms] print: 10 5 | [@ 0.000ms] print: 15 -------------------------------------------------------------------------------- /test/MessageTable.pd: -------------------------------------------------------------------------------- 1 | #N canvas 387 158 460 377 10; 2 | #X obj 53 18 loadbang; 3 | #X obj 122 20 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 167 183 tabwrite array_one; 6 | #X msg 269 112 1; 7 | #X msg 173 129 5; 8 | #X msg 235 112 2; 9 | #X msg 140 129 10; 10 | #X msg 68 102 set array_two; 11 | #X msg 204 112 3; 12 | #X msg 109 129 15; 13 | #X msg 55 129 6; 14 | #X msg 15 121 12; 15 | #X obj 313 165 table array_one; 16 | #X obj 312 201 table array_two; 17 | #X obj 53 47 t b b b b b b b b b b b b; 18 | #X obj 128 291 tabread array_two; 19 | #X obj 53 195 t b b b b b b; 20 | #X msg 153 256 1; 21 | #X msg 123 256 2; 22 | #X obj 128 328 print; 23 | #X msg 82 223 set array_one; 24 | #X msg 62 256 3; 25 | #X connect 0 0 14 0; 26 | #X connect 1 0 14 0; 27 | #X connect 3 0 2 1; 28 | #X connect 4 0 2 0; 29 | #X connect 5 0 2 1; 30 | #X connect 6 0 2 0; 31 | #X connect 7 0 2 0; 32 | #X connect 8 0 2 1; 33 | #X connect 9 0 2 0; 34 | #X connect 10 0 2 0; 35 | #X connect 11 0 2 0; 36 | #X connect 14 0 16 0; 37 | #X connect 14 1 11 0; 38 | #X connect 14 2 5 0; 39 | #X connect 14 3 10 0; 40 | #X connect 14 4 3 0; 41 | #X connect 14 5 7 0; 42 | #X connect 14 6 9 0; 43 | #X connect 14 7 8 0; 44 | #X connect 14 8 6 0; 45 | #X connect 14 9 5 0; 46 | #X connect 14 10 4 0; 47 | #X connect 14 11 3 0; 48 | #X connect 15 0 19 0; 49 | #X connect 16 0 21 0; 50 | #X connect 16 1 18 0; 51 | #X connect 16 2 17 0; 52 | #X connect 16 3 20 0; 53 | #X connect 16 4 18 0; 54 | #X connect 16 5 17 0; 55 | #X connect 17 0 15 0; 56 | #X connect 18 0 15 0; 57 | #X connect 20 0 15 0; 58 | #X connect 21 0 15 0; 59 | -------------------------------------------------------------------------------- /test/MessageTangent.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 2.18504 2 | [@ 0.000ms] print: 0 3 | [@ 0.000ms] print: 6.08688 4 | [@ 0.000ms] print: 0.624733 -------------------------------------------------------------------------------- /test/MessageTangent.pd: -------------------------------------------------------------------------------- 1 | #N canvas 633 240 450 300 10; 2 | #X obj 104 17 loadbang; 3 | #X obj 104 183 print; 4 | #X obj 173 17 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 235 99 -2 3 5; 7 | #X msg 139 99 -14.3; 8 | #X msg 104 99 3.7; 9 | #X msg 197 99 0; 10 | #X obj 104 54 t b b b b; 11 | #X obj 104 148 tan; 12 | #X connect 0 0 7 0; 13 | #X connect 2 0 7 0; 14 | #X connect 3 0 8 0; 15 | #X connect 4 0 8 0; 16 | #X connect 5 0 8 0; 17 | #X connect 6 0 8 0; 18 | #X connect 7 0 5 0; 19 | #X connect 7 1 4 0; 20 | #X connect 7 2 6 0; 21 | #X connect 7 3 3 0; 22 | #X connect 8 0 1 0; 23 | -------------------------------------------------------------------------------- /test/MessageTimer.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 1247.000ms] print: 1247 -------------------------------------------------------------------------------- /test/MessageTimer.pd: -------------------------------------------------------------------------------- 1 | #N canvas 920 321 450 300 10; 2 | #X obj 100 137 timer; 3 | #X obj 100 24 loadbang; 4 | #X obj 169 25 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X obj 169 81 delay 1247; 7 | #X obj 100 180 print; 8 | #X connect 0 0 4 0; 9 | #X connect 1 0 3 0; 10 | #X connect 1 0 0 0; 11 | #X connect 2 0 3 0; 12 | #X connect 2 0 0 0; 13 | #X connect 3 0 0 1; 14 | -------------------------------------------------------------------------------- /test/MessageToggle.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 1 2 | [@ 0.000ms] print: 33 3 | [@ 0.000ms] print: 0 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 33 6 | [@ 0.000ms] print: -12.9 7 | [@ 0.000ms] print: 0 8 | [@ 0.000ms] print: 0 9 | [@ 0.000ms] print: 1 -------------------------------------------------------------------------------- /test/MessageToggle.pd: -------------------------------------------------------------------------------- 1 | #N canvas 364 200 450 300 10; 2 | #X obj 63 19 loadbang; 3 | #X obj 133 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 98 150 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 6 | 1; 7 | #X msg 204 105 33; 8 | #X msg 168 105 0; 9 | #X obj 98 179 print; 10 | #X msg 120 105 -12.9; 11 | #X msg 75 105 set 1; 12 | #X msg 32 105 set 0; 13 | #X obj 62 55 t b b b b b b b b b b b; 14 | #X connect 0 0 9 0; 15 | #X connect 1 0 9 0; 16 | #X connect 2 0 5 0; 17 | #X connect 3 0 2 0; 18 | #X connect 4 0 2 0; 19 | #X connect 6 0 2 0; 20 | #X connect 7 0 2 0; 21 | #X connect 8 0 2 0; 22 | #X connect 9 0 2 0; 23 | #X connect 9 1 8 0; 24 | #X connect 9 2 2 0; 25 | #X connect 9 3 7 0; 26 | #X connect 9 4 2 0; 27 | #X connect 9 5 6 0; 28 | #X connect 9 6 2 0; 29 | #X connect 9 7 4 0; 30 | #X connect 9 8 2 0; 31 | #X connect 9 9 3 0; 32 | #X connect 9 10 2 0; 33 | -------------------------------------------------------------------------------- /test/MessageTrigger.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 23 2 | [@ 0.000ms] print: float 3 | [@ 0.000ms] print: bang 4 | [@ 0.000ms] print: 23 5 | [@ 0.000ms] print: cat 6 | [@ 0.000ms] print: bang 7 | [@ 0.000ms] print: bang 8 | [@ 0.000ms] print: symbol 9 | [@ 0.000ms] print: bang 10 | [@ 0.000ms] print: 0 -------------------------------------------------------------------------------- /test/MessageTrigger.pd: -------------------------------------------------------------------------------- 1 | #N canvas 1080 456 450 300 10; 2 | #X obj 43 30 loadbang; 3 | #X obj 107 31 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 43 207 print; 6 | #X msg 97 113 23; 7 | #X obj 43 153 t f b s a; 8 | #X obj 43 57 t b b b; 9 | #X msg 58 110 cat; 10 | #X connect 0 0 5 0; 11 | #X connect 1 0 5 0; 12 | #X connect 3 0 4 0; 13 | #X connect 4 0 2 0; 14 | #X connect 4 1 2 0; 15 | #X connect 4 2 2 0; 16 | #X connect 4 3 2 0; 17 | #X connect 5 0 4 0; 18 | #X connect 5 1 6 0; 19 | #X connect 5 2 3 0; 20 | #X connect 6 0 4 0; 21 | -------------------------------------------------------------------------------- /test/MessageUnpack.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] z: 1 2 | [@ 0.000ms] z: 2 3 | [@ 0.000ms] c: 42 4 | [@ 0.000ms] d: 11 5 | [@ 0.000ms] e: one 6 | [@ 0.000ms] a: 4 7 | [@ 0.000ms] b: 3 8 | [@ 0.000ms] c: 2 9 | [@ 0.000ms] d: 1 10 | [@ 0.000ms] e: a 11 | [@ 0.000ms] e: hello 12 | -------------------------------------------------------------------------------- /test/MessageUnpack.pd: -------------------------------------------------------------------------------- 1 | #N canvas 332 142 450 300 10; 2 | #X obj 21 19 loadbang; 3 | #X msg 21 113 hello; 4 | #X msg 254 113 one 11 42; 5 | #X msg 174 113 11 one two; 6 | #X msg 101 113 a 1 2 3 4; 7 | #X msg 64 113 13; 8 | #X obj 21 143 unpack s f 0 wookie f; 9 | #X obj 258 170 print a; 10 | #X obj 198 170 print b; 11 | #X obj 138 170 print c; 12 | #X obj 78 170 print d; 13 | #X obj 21 170 print e; 14 | #X obj 79 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 15 | -1; 16 | #X obj 342 135 unpack; 17 | #X obj 21 40 t b b b b b b; 18 | #X msg 342 112 2 1; 19 | #X obj 342 170 print z; 20 | #X connect 0 0 14 0; 21 | #X connect 1 0 6 0; 22 | #X connect 2 0 6 0; 23 | #X connect 3 0 6 0; 24 | #X connect 4 0 6 0; 25 | #X connect 5 0 6 0; 26 | #X connect 6 0 11 0; 27 | #X connect 6 1 10 0; 28 | #X connect 6 2 9 0; 29 | #X connect 6 3 8 0; 30 | #X connect 6 4 7 0; 31 | #X connect 12 0 14 0; 32 | #X connect 13 0 16 0; 33 | #X connect 13 1 16 0; 34 | #X connect 14 0 1 0; 35 | #X connect 14 1 5 0; 36 | #X connect 14 2 4 0; 37 | #X connect 14 3 3 0; 38 | #X connect 14 4 2 0; 39 | #X connect 14 5 15 0; 40 | #X connect 15 0 13 0; 41 | -------------------------------------------------------------------------------- /test/MessageUntil.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] eight: bang 2 | [@ 0.000ms] eight: bang 3 | [@ 0.000ms] eight: bang 4 | [@ 0.000ms] eight: bang 5 | [@ 0.000ms] eight: bang 6 | [@ 0.000ms] eight: bang 7 | [@ 0.000ms] eight: bang 8 | [@ 0.000ms] eight: bang 9 | [@ 0.000ms] three: bang 10 | [@ 0.000ms] three: bang 11 | [@ 0.000ms] three: bang 12 | [@ 0.000ms] print: 0 13 | [@ 0.000ms] print: 1 14 | [@ 0.000ms] print: 2 15 | [@ 0.000ms] print: 3 16 | [@ 0.000ms] print: 4 17 | [@ 0.000ms] print: 5 18 | [@ 0.000ms] print: 6 19 | [@ 0.000ms] print: 7 20 | [@ 0.000ms] print: 8 21 | [@ 0.000ms] print: 9 -------------------------------------------------------------------------------- /test/MessageUntil.pd: -------------------------------------------------------------------------------- 1 | #N canvas 0 22 450 300 10; 2 | #X obj 52 34 loadbang; 3 | #X obj 121 35 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 52 74 t b b b; 6 | #X msg 141 138 3; 7 | #X msg 172 139 8; 8 | #X obj 183 207 print eight; 9 | #X obj 141 234 print three; 10 | #X obj 183 180 until; 11 | #X obj 141 195 until; 12 | #X obj 25 153 until; 13 | #X obj 25 175 f; 14 | #X obj 54 175 + 1; 15 | #X obj 100 177 sel 0; 16 | #X obj 25 219 print; 17 | #X obj 54 197 mod 10; 18 | #X connect 0 0 2 0; 19 | #X connect 1 0 2 0; 20 | #X connect 2 0 9 0; 21 | #X connect 2 1 3 0; 22 | #X connect 2 2 4 0; 23 | #X connect 3 0 8 0; 24 | #X connect 4 0 7 0; 25 | #X connect 7 0 5 0; 26 | #X connect 8 0 6 0; 27 | #X connect 9 0 10 0; 28 | #X connect 10 0 11 0; 29 | #X connect 10 0 13 0; 30 | #X connect 11 0 14 0; 31 | #X connect 12 0 9 1; 32 | #X connect 14 0 10 1; 33 | #X connect 14 0 12 0; 34 | -------------------------------------------------------------------------------- /test/MessageValue.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0 2 | [@ 0.000ms] print: 1 3 | [@ 0.000ms] print: 1 4 | [@ 0.000ms] print: 0 5 | [@ 0.000ms] print: 2 6 | [@ 0.000ms] print: 3 -------------------------------------------------------------------------------- /test/MessageValue.pd: -------------------------------------------------------------------------------- 1 | #N canvas 72 48 671 378 10; 2 | #X obj 133 73 loadbang; 3 | #X obj 213 74 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 148 202 value hello; 6 | #X obj 261 201 value hello; 7 | #X obj 367 201 v world; 8 | #X obj 193 155 f 1; 9 | #X obj 159 109 t b b b b b b b b b; 10 | #X obj 194 274 print; 11 | #X msg 356 151 2; 12 | #X obj 422 157 f 3; 13 | #X connect 0 0 6 0; 14 | #X connect 1 0 6 0; 15 | #X connect 2 0 7 0; 16 | #X connect 3 0 7 0; 17 | #X connect 4 0 7 0; 18 | #X connect 5 0 2 0; 19 | #X connect 6 0 4 0; 20 | #X connect 6 1 9 0; 21 | #X connect 6 2 2 0; 22 | #X connect 6 3 8 0; 23 | #X connect 6 4 4 0; 24 | #X connect 6 5 3 0; 25 | #X connect 6 6 2 0; 26 | #X connect 6 7 5 0; 27 | #X connect 6 8 2 0; 28 | #X connect 8 0 3 0; 29 | #X connect 9 0 4 0; 30 | -------------------------------------------------------------------------------- /test/MessageWrap.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] print: 0.31 2 | [@ 0.000ms] print: 2.54 3 | [@ 0.000ms] print: 3.76 4 | [@ 0.000ms] print: 4.44 5 | [@ 0.000ms] print: 9 6 | [@ 0.000ms] print: 8 7 | [@ 0.000ms] print: 8 8 | [@ 0.000ms] print: 5.04 9 | [@ 0.000ms] print: 4.6 10 | [@ 0.000ms] print: 4.2 11 | [@ 0.000ms] print: 6.2 12 | [@ 0.000ms] print: 5.04 13 | [@ 0.000ms] print: 4.6 14 | [@ 0.000ms] print: 4.2 15 | [@ 0.000ms] print: 6.2 16 | [@ 0.000ms] print: -5.66 17 | [@ 0.000ms] print: -5 18 | [@ 0.000ms] print: -4.7 19 | [@ 0.000ms] print: -1.6 20 | [@ 0.000ms] print: -5.7 -------------------------------------------------------------------------------- /test/MessageWrap.pd: -------------------------------------------------------------------------------- 1 | #N canvas 588 22 450 300 10; 2 | #X obj 45 27 loadbang; 3 | #X obj 114 28 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 4 | -1; 5 | #X obj 377 219 wrap; 6 | #X obj 342 283 print; 7 | #X obj 313 219 wrap 4.24; 8 | #X msg 336 168 2.54; 9 | #X msg 173 168 -13; 10 | #X msg 204 168 1; 11 | #X msg 85 168 6.2 3; 12 | #X obj 45 68 t b b b b b b b b b b b b b b b b b b b b b b b; 13 | #X msg 16 169 0; 14 | #X msg 377 167 13.31; 15 | #X msg 261 168 11.44; 16 | #X msg 47 169 -5.7; 17 | #X msg 129 168 3 6.2; 18 | #X msg 304 168 8; 19 | #X obj 202 223 wrap 3 10; 20 | #X msg 233 168 -5; 21 | #X connect 0 0 9 0; 22 | #X connect 1 0 9 0; 23 | #X connect 2 0 3 0; 24 | #X connect 4 0 3 0; 25 | #X connect 5 0 4 0; 26 | #X connect 6 0 16 0; 27 | #X connect 7 0 16 0; 28 | #X connect 8 0 16 1; 29 | #X connect 9 0 10 0; 30 | #X connect 9 1 6 0; 31 | #X connect 9 2 7 0; 32 | #X connect 9 3 17 0; 33 | #X connect 9 4 12 0; 34 | #X connect 9 5 13 0; 35 | #X connect 9 6 6 0; 36 | #X connect 9 7 7 0; 37 | #X connect 9 8 17 0; 38 | #X connect 9 9 12 0; 39 | #X connect 9 10 8 0; 40 | #X connect 9 11 6 0; 41 | #X connect 9 12 7 0; 42 | #X connect 9 13 17 0; 43 | #X connect 9 14 12 0; 44 | #X connect 9 15 14 0; 45 | #X connect 9 16 6 0; 46 | #X connect 9 17 7 0; 47 | #X connect 9 18 17 0; 48 | #X connect 9 19 12 0; 49 | #X connect 9 20 15 0; 50 | #X connect 9 21 5 0; 51 | #X connect 9 22 11 0; 52 | #X connect 10 0 16 0; 53 | #X connect 11 0 2 0; 54 | #X connect 12 0 16 0; 55 | #X connect 13 0 16 1; 56 | #X connect 14 0 16 1; 57 | #X connect 15 0 4 0; 58 | #X connect 16 0 3 0; 59 | #X connect 17 0 16 0; 60 | -------------------------------------------------------------------------------- /test/RegisterReceiver.pd: -------------------------------------------------------------------------------- 1 | #N canvas 557 294 324 179 10; 2 | #X obj 104 50 r #TEST_TO_PATCH; 3 | #X obj 104 91 s #PATCH_TO_TEST; 4 | #X connect 0 0 1 0; 5 | -------------------------------------------------------------------------------- /test/dsp/DspCos.golden.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoBirth/PureZen/be8c3cc8ae88b6467da1ec86811cad4920683d08/test/dsp/DspCos.golden.wav -------------------------------------------------------------------------------- /test/dsp/DspCos.pd: -------------------------------------------------------------------------------- 1 | #N canvas 650 293 450 300 10; 2 | #X obj 115 53 loadbang; 3 | #X obj 93 148 line~; 4 | #X obj 93 203 dac~; 5 | #X obj 115 81 t b b; 6 | #X msg 147 114 -2; 7 | #X msg 93 114 2 1000; 8 | #X obj 93 176 cos~; 9 | #X connect 0 0 3 0; 10 | #X connect 1 0 6 0; 11 | #X connect 3 0 5 0; 12 | #X connect 3 1 4 0; 13 | #X connect 4 0 1 0; 14 | #X connect 5 0 1 0; 15 | #X connect 6 0 2 0; 16 | -------------------------------------------------------------------------------- /test/dsp/DspInletOutlet.pd: -------------------------------------------------------------------------------- 1 | #N canvas 510 294 450 300 10; 2 | #X obj 145 64 osc~ 440; 3 | #X obj 145 156 dac~; 4 | #N canvas 0 22 450 300 inlet/outlet 1; 5 | #X obj 170 105 inlet~; 6 | #X obj 170 155 outlet~; 7 | #X connect 0 0 1 0; 8 | #X restore 145 114 pd inlet/outlet; 9 | #X connect 0 0 2 0; 10 | #X connect 2 0 1 0; 11 | -------------------------------------------------------------------------------- /test/dsp/DspLine.pd: -------------------------------------------------------------------------------- 1 | #N canvas 326 108 402 286 10; 2 | #X obj 121 21 loadbang; 3 | #X obj 156 175 line~; 4 | #X obj 156 210 dac~; 5 | #X msg 337 89 -1; 6 | #X msg 283 89 1 1000; 7 | #X msg 219 116 1 250; 8 | #X obj 219 90 del 250; 9 | #X obj 156 91 del 500; 10 | #X msg 156 117 -0.5; 11 | #X obj 94 91 del 600; 12 | #X msg 94 118 0.2; 13 | #X obj 34 91 del 700; 14 | #X obj 121 49 t b b b b b b; 15 | #X msg 34 118 0.9 200; 16 | #X connect 0 0 12 0; 17 | #X connect 1 0 2 0; 18 | #X connect 3 0 1 0; 19 | #X connect 4 0 1 0; 20 | #X connect 5 0 1 0; 21 | #X connect 6 0 5 0; 22 | #X connect 7 0 8 0; 23 | #X connect 8 0 1 0; 24 | #X connect 9 0 10 0; 25 | #X connect 10 0 1 0; 26 | #X connect 11 0 13 0; 27 | #X connect 12 0 11 0; 28 | #X connect 12 1 9 0; 29 | #X connect 12 2 7 0; 30 | #X connect 12 3 6 0; 31 | #X connect 12 4 4 0; 32 | #X connect 12 5 3 0; 33 | #X connect 13 0 1 0; 34 | -------------------------------------------------------------------------------- /test/dsp/DspOsc.golden.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoBirth/PureZen/be8c3cc8ae88b6467da1ec86811cad4920683d08/test/dsp/DspOsc.golden.wav -------------------------------------------------------------------------------- /test/dsp/DspOsc.pd: -------------------------------------------------------------------------------- 1 | #N canvas 479 155 450 300 10; 2 | #X obj 181 212 dac~; 3 | #X obj 180 155 osc~ 440; 4 | #X obj 134 14 loadbang; 5 | #X obj 235 11 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 6 | -1; 7 | #X obj 134 54 t b b b b b; 8 | #X obj 316 112 del 800; 9 | #X obj 313 204 del 400; 10 | #X obj 317 159 del 600; 11 | #X obj 153 89 del 200; 12 | #X obj 92 103 f 220; 13 | #X obj 191 131 f 440; 14 | #X connect 1 0 0 0; 15 | #X connect 2 0 4 0; 16 | #X connect 3 0 4 0; 17 | #X connect 4 0 9 0; 18 | #X connect 4 1 8 0; 19 | #X connect 4 2 6 0; 20 | #X connect 4 3 7 0; 21 | #X connect 4 4 5 0; 22 | #X connect 8 0 10 0; 23 | #X connect 9 0 1 0; 24 | #X connect 10 0 1 0; 25 | -------------------------------------------------------------------------------- /test/dsp/DspPhasorSignal.golden.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoBirth/PureZen/be8c3cc8ae88b6467da1ec86811cad4920683d08/test/dsp/DspPhasorSignal.golden.wav -------------------------------------------------------------------------------- /test/dsp/DspPhasorSignal.pd: -------------------------------------------------------------------------------- 1 | #N canvas 406 249 247 281 10; 2 | #X obj 84 209 dac~; 3 | #X obj 84 155 line~; 4 | #X obj 84 181 phasor~; 5 | #X obj 60 62 t b b b; 6 | #X msg 147 115 110; 7 | #X msg 84 115 880 500; 8 | #X obj 42 92 del 750; 9 | #X obj 60 30 loadbang; 10 | #X obj 140 29 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 11 | -1; 12 | #X msg 42 115 1100; 13 | #X connect 1 0 2 0; 14 | #X connect 2 0 0 0; 15 | #X connect 3 0 6 0; 16 | #X connect 3 1 5 0; 17 | #X connect 3 2 4 0; 18 | #X connect 4 0 1 0; 19 | #X connect 5 0 1 0; 20 | #X connect 6 0 9 0; 21 | #X connect 7 0 3 0; 22 | #X connect 8 0 3 0; 23 | #X connect 9 0 1 0; 24 | -------------------------------------------------------------------------------- /test/dsp/DspSendReceive.pd: -------------------------------------------------------------------------------- 1 | #N canvas 480 168 481 261 10; 2 | #X obj 28 49 s~ hello; 3 | #X obj 28 76 r~ hello; 4 | #X obj 65 105 dac~; 5 | #X obj 28 19 osc~ 440; 6 | #X obj 102 76 receive~ world; 7 | #X text 101 58 r~ world should not produce any output; 8 | #X connect 1 0 2 0; 9 | #X connect 3 0 0 0; 10 | #X connect 4 0 2 0; 11 | -------------------------------------------------------------------------------- /test/dsp/DspThrowCatch.pd: -------------------------------------------------------------------------------- 1 | #N canvas 321 288 411 187 10; 2 | #X obj 123 33 osc~ 220; 3 | #X obj 123 84 throw~ osc1; 4 | #X obj 121 115 catch~ osc1; 5 | #X obj 121 148 dac~; 6 | #X obj 208 115 catch~ osc2; 7 | #X obj 217 33 osc~ 440; 8 | #X obj 308 33 osc~ 440; 9 | #X obj 34 115 catch~ osc0; 10 | #X obj 217 58 *~ 0.33; 11 | #X obj 308 58 *~ 0.33; 12 | #X obj 123 58 *~ 0.34; 13 | #X obj 217 84 throw~ osc2; 14 | #X obj 308 84 throw~ osc2; 15 | #X connect 0 0 10 0; 16 | #X connect 2 0 3 0; 17 | #X connect 4 0 3 0; 18 | #X connect 5 0 8 0; 19 | #X connect 6 0 9 0; 20 | #X connect 7 0 3 0; 21 | #X connect 8 0 11 0; 22 | #X connect 9 0 12 0; 23 | #X connect 10 0 1 0; 24 | -------------------------------------------------------------------------------- /test/dsp/DspWrap.golden.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoBirth/PureZen/be8c3cc8ae88b6467da1ec86811cad4920683d08/test/dsp/DspWrap.golden.wav -------------------------------------------------------------------------------- /test/dsp/DspWrap.pd: -------------------------------------------------------------------------------- 1 | #N canvas 650 293 450 300 10; 2 | #X obj 115 53 loadbang; 3 | #X obj 93 148 line~; 4 | #X obj 93 178 wrap~; 5 | #X obj 93 208 dac~; 6 | #X obj 115 81 t b b; 7 | #X msg 147 114 -2; 8 | #X msg 93 114 2 1000; 9 | #X connect 0 0 4 0; 10 | #X connect 1 0 2 0; 11 | #X connect 2 0 3 0; 12 | #X connect 4 0 6 0; 13 | #X connect 4 1 5 0; 14 | #X connect 5 0 1 0; 15 | #X connect 6 0 1 0; 16 | -------------------------------------------------------------------------------- /test/multiple-receiver-test.golden.txt: -------------------------------------------------------------------------------- 1 | [@ 0.000ms] test1: bang 2 | [@ 0.000ms] test2: bang -------------------------------------------------------------------------------- /test/multiple-receiver-test.pd: -------------------------------------------------------------------------------- 1 | #N canvas 391 203 413 149 10; 2 | #X obj 20 12 loadbang; 3 | #X obj 20 38 s test; 4 | #X obj 20 87 r test; 5 | #X obj 20 119 print test1; 6 | #X obj 105 87 r test; 7 | #X obj 105 119 print test2; 8 | #X connect 0 0 1 0; 9 | #X connect 2 0 3 0; 10 | #X connect 4 0 5 0; 11 | --------------------------------------------------------------------------------