xy: Abstraction to get mouse click and drag coordinates (vanilla)
This is a quick and fairly lightweight abstraction to get the mouse coordinates on click and drag motion. Three different modes determine the behavior for when the mouse leaves the click area. It works in Pure Data vanilla without any external.
Download: xy.zip
Usage:
Type [xy 500 300 1] to create a 500 x 300 pixel area in mode 1. See help file for details.
How it works:
A rectangle scalar of the size of the click area, a one pixel scalar and two graphical arrays are placed on top of each other. The second array has an inverted y-range. Both arrays are set to zero. On click both arrays jump to the respective y-value at x-position. When the rectangle scalar receives the click, it reads the x and y values from the first array. If y is zero, it takes the x value from the second array. Now we have x and y for the click.
The arrays are immediately reset to zero and the pixel scalar is placed to where the mouse is, so that it gets the grab. From there on x and y positions are read from the pixel scalar when its struct sends a change event. That's it.
Some more tricks where necessary to create everything dynamically and make it nice.
Have fun!
Update 2022-01-17: Finally fixed the bug that broke the patch when dragging near the bottom left corner. Everything should work now!
[Sel x] - Order of operations
Hello there,
Could maybe someone explain the order of operations of my [sel] objects on both left and right. 1473000944963-1-working-2-not-working.pd Eventually, I want them to do the same thing, but 3 examples work very differently. (1) Works perfectly (2.1) and (2.2.) do not work in the same way as (1) does, although I am only omitting a few things, and without them I think it should still work in the same way.
I am new to PD, so I really want to understand everything that's going on, and I think that if I don't it will harm my future patching.
gui externals tutorial ?
@Pierre-Guillot
"make install" does not seem to install anything so I added object files manualy
It compiles but the linker cant seem to find pd stuffs although it is linked with pd...
cc -I"D:/WORK/DSP/pd-0.46-7/src" -Wno-unused-parameter -DPD -DVERSION='"0.0"' -O6 -funroll-loops -fomit-frame-pointer -Wall -W -g -o "src/adsr.o" -c "src/adsr.c"
cc -rdynamic -shared -L"D:/WORK/DSP/pd-0.46-7/src" -L"D:/WORK/DSP/pd-0.46-7/bin" -o "src/adsr.dll" "src/adsr.o" libCicmWrapper_la-ebox.o libCicmWrapper_la-egraphics.o libCicmWrapper_la-eclass.o libCicmWrapper_la-eobj.o libCicmWrapper_la-ecommon.o libCicmWrapper_la-epopup.o -lpd
libCicmWrapper_la-ebox.o: In function `ebox_dosave':
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/ebox.c:819: undefined reference to `s__X'
libCicmWrapper_la-ebox.o: In function `ebox_properties':
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/ebox.c:1098: undefined reference to `s_symbol'
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/ebox.c:1113: undefined reference to `s_symbol'
libCicmWrapper_la-eclass.o: In function `eclass_attr_getter':
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:639: undefined reference to `s_float'
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:653: undefined reference to `s_symbol'
libCicmWrapper_la-eclass.o: In function `eclass_attr_setter':
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:753: undefined reference to `s_float'
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:775: undefined reference to `s_symbol'
libCicmWrapper_la-eclass.o: In function `eclass_addmethod':
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:240: undefined reference to `s_float'
/cygdrive/d/WORK/DSP/CicmWrapper/Sources/eclass.c:252: undefined reference to `s_symbol'
gui externals tutorial ?
so I think the linker should be set to -lCicmWrapper but I got conflicts and undefined
can you help me out ?
cc -rdynamic -shared -L"D:/WORK/DSP/pd-0.46-7/src" -L"D:/WORK/DSP/pd-0.46-7/bin" -o "src/adsr.dll" "src/adsr.o" -L"D:/WORK\DSP/PD/CicmWrapper-camo-dev/Sources/.libs" -lCicmWrapper -lc -lpd
D:/WORK/DSP/pd-0.46-7/bin/pd.lib(pd.dll):(.text+0x0): multiple definition of `error'
/usr/lib/libc.a(t-d000927.o):fake:(.text+0x0): first defined here
D:/WORK\DSP/PD/CicmWrapper-camo-dev/Sources/.libs/libCicmWrapper.a(libCicmWrapper_la-ecommon.o): In function `epd_add_folder':
/cygdrive/d/WORK/DSP/PD/CicmWrapper-camo-dev/Sources/ecommon.c:578: undefined reference to `sys_searchpath'
/cygdrive/d/WORK/DSP/PD/CicmWrapper-camo-dev/Sources/ecommon.c:603: undefined reference to `sys_staticpath'
/cygdrive/d/WORK/DSP/PD/CicmWrapper-camo-dev/Sources/ecommon.c:603: undefined reference to `namelist_append_files'
/cygdrive/d/WORK/DSP/PD/CicmWrapper-camo-dev/Sources/ecommon.c:609: undefined reference to `sys_staticpath'
/cygdrive/d/WORK/DSP/PD/CicmWrapper-camo-dev/Sources/ecommon.c:609: undefined reference to `namelist_append_files'```
Need help to slightly modify a PD project (Rythmboy)
I'm pretty serious about getting this patch up and running. Until now, while discovering the patch and finding out how it works, I always discovered new problems that made me want to quit and go on without a step seqeuncer, but I think that now I have found all the "bugs" I need to get rid of to make this thing work with Traktor. And the idea of using my QuNeo, which would else be rather unused, in my actual setup is very tempting.
But, to be honest, I'm not that much into programming (I only know about pd for one week), and I think I could not program my own sequencer from scratch, at least in an acceptable amount of time and work. Plus, the Rhythmboy already has already 90% of the work I need done, and I'm a lazy person, in the techy meaning of lazy, which means not to do any work that is already done. For example, the story of this guy made me smile.
So yes, I'd love to fix the Rhythmboy, and put some work and learning into it, but I don't think I'd build a new step sequencer from scratch. Yet, I know that your help here already gave me a lot of ideas to work with, and I'm not one of those guys who expect someone else to solve the whole problem for me. I love to find my own solutions if someone points me into the right directions, which you already did, and my main goal is not a perfect program, but something that at least works as it should.
Now for the technicals: Yes, the Rhythmboy isn't polyphonic, but neither are the remix decks in Traktor. The remix decks in Traktor are multiple cells in multiple slots, that can be triggered by a MIDI command, and can be a loop or a one shot. So in other words, it's a very simple sampler.
pd open
Hi David, I am also David.
m0oonlib doesn't come with Pd-vanilla, but I am willing to get Pd-extended working (I'm actually prototyping for a patch that will run on a raspberry pi.) I definitely want to share these patches when I'm done, so I am using relative paths because I want it to run on different environments, with different file structures, with everything relative to the main patch.
If I declare /synths
wouldn't that be an absolute location (at the root of my filesystem?)
open
messages require 2 params, the second of which is the path. If you leave it off you will get this error:
Bad arguments for message 'open' to object 'pd'
I have tried it several ways, and all do not work:
(I get the Bad Argument
error)
With all of these I get Device not configured
:
These work, but are not ideal:
I'd prefer not hardcoding an absolute path.
moonlib/absolutepath
doesn't seem to work with a directory name, only a file. That means this works:
But not this (the format I actually need for path):
This works, but really I'd just prefer a solution that works in Pd-vanilla:
How to install externals, libraries, gui plug-ins, etc.
Edit: This post was originally written with Pd-extended 0.43 in mind. These days there is a nice little plugin called Deken that you can use to easily download and install most of the popular libraries in Pd. It comes bundled with recent versions of Pd-vanilla. You can still use namespaces to load up the objects for most libraries, but for some libraries like zexy that have all the objects bundled into a single file, you will still need to use [declare] to load it up.
Installing libraries and plug-ins isn't so obvious. This guide will hopefully clear up the process, and may even explain more than you need to know.
Recent changes
This first section is mainly for those upgrading to Pd-0.43 from previous versions. If you're new to Pd and are starting on 0.43, you can just skip this section and get on with loading libraries.
It use to be that installing a library was done by putting it wherever you wanted on your system and adding its path to the preferences. While this wasn't particularly difficult, it did have some problems. Recent efforts have been made to standardize this a bit so those problems can be avoided.
In Pd-extended 0.43, you can't add paths from within Pd any more like you used to. You can open the preferences and add a path, but it won't save it. This means that non-default libraries won't load on start-up any more; you have to load them from within the patch. While this sounds like a hassle, it does have the advantage that patches are much easier to share. You don't have to worry about others having different start-up settings than you. It also forces the patch to document what libraries are being used, so if an object isn't loading, you don't have to go on some crazy hunt to find out where it came from or what it's supposed to do.
Putting them in the right folder
To make sure Pd can easily find the library, you need to put them in the right folder. This is OS dependent. The following folders are your options (taken from here). I personally recommend putting them in the user-specific folders since they are likely easier to migrate when updating your OS.
Linux:
User-specific:
~/pd-externals
Global:
/usr/local/lib/pd-externals
Mac OSX
User-specific:
~/Library/Pd
Global:
/Library/Pd
Windows
User-specific:
%AppData%/Pd
Global:
%CommonProgramFiles%/Pd
Linux and OSX are pretty straight-forward. "~" means your home folder.
Windows is a bit trickier. %AppData% and %CommonProgramFiles% are environment variables that contain specific directories. What the exact directory is depends on which version of Windows you are on. You can find out what it is by opening up the command line and typing this:
echo %AppData%
You might end up with something like C:\Users\username\AppData\Roaming or C:\Documentes and Settings\username\Application Data. Also, to see it in the file browser, you might need to show hidden files. At any rate, once you find the directory, create a Pd folder if there isn't one, and put your library, objects, or plug-ins there.
Loading whole libraries
To load a library you have a few options. The one that works on both vanilla and extended is to use [declare -stdpath libraryname]. The libraryname is the name of the folder that all the objects/abstractions are in.
[declare] doesn't always work as expected in abstractions, though. In Pd-extended, you can also use [import], which works well in abstractions. I have found that sometimes it doesn't work with libraries of abstractions that don't have a meta file, though. But that can be fixed by just making one. Simply create an empty Pd patch and save it as libraryname-meta.pd in the library's folder. That's all the meta patch is.
A third option (also Pd-extended only) is to use [path]. This is new to Pd-extended 0.43 and works similarly to [declare]. I haven't needed it, yet. But it's there.
Once the library is loaded, you should be able to load an object or abstraction just by creating it by name.
Loading objects or abstractions using namespaces
While this method means a little more typing, it is also the safest, and it makes it easier to find out what objects are from which library. The way you do it is add the library name (i.e. the namespace) to the beginning of the object when you call it, like this:
[zexy/multiplex~] <-- load the [multiplex~] object from zexy
[cyclone/comb~] <-- load [comb~] from cyclone
You don't have to load the library with [import] or [declare] for this to work. You just call the object that way.
Why is this safest? Because it's possible for different libraries to have objects with the same name. For example, both cyclone and zexy have an object called [mean]. But they don't work exactly the same. zexy's takes a list, while cyclone's takes in a continuous stream. If you have both libraries loaded (and in Pd-extended, these two libraries happen to be loaded by default), you can't be sure which one you're getting if you just type [mean]. However, if you type [cyclone/mean], you know exactly which one you are getting.
Pix\_mix help example doesn't work
So, I built a project which uses pix_mix, and I couldn't help but notice that the help example doesn't work. Specifically, pix_mix only updates when the left image is updated (unless it works differently on different platforms). So it works fine for movies, but if you have static images and you adjust the mixer input, it doesn't change anything. In the help example, this is exactly what happens. You load two images and then play with the slider and then nothing happens.
In most objects, you could deal with this by just banging the hot input, but banging pix_mix's input just results in an error message that it doesn't know what to do with a bang. In my patch, I've worked around this by storing the left image in a pix_buf and banging the pix_buf, but it doesn't quite seem ideal.
DJ/VJ scratching system
First my story: (you can skip down to END OF STORY if you want)
Ever since I saw Mike Relm go to town with a DVDJ, I've wanted a system where I could scratch and cue video. However, I haven't wanted to spend the $2500 for a DVDJ. As I was researching, I found a number of different systems. I am not a DJ by trade, so to get a system like Traktor or Serrato with their video modules plus turntables plus hardware plus a DJ mixer, soon everything gets really expensive. But in looking around, I found the Ms.Pinky system and after a little bit, I found a USB turntable on Woot for $60. So I bought it. It was marketed as a DJ turntable, but I knew that it wasn't really serious since it had a belt drive, but it came with a slip-pad and the USB connection meant that I wouldn't need a preamp. And so I spend the $100 on the Ms.Pinky vinyl plus software license (now only $80). This worked decently, but I had a lot of trouble really getting it totally on point. The relative mode worked well, but sometimes would skip if I scratched too vigorously. The absolute mode I couldn't get to work at all. After reading a little more, I came to the conclusion that my signal from vinyl to computer just wasn't strong enough, so I would need maybe a new needle or maybe a different turntable and I didn't really want to spend the money experimenting. I think that the Ms. Pinky system is probably a very good system with the right equipment, but I don't do this professionally, so I don't want to spend the loot on a system.
Earlier, before I bought Ms.Pinky (about two years ago), I had also looked around for a cheap MIDI USB DJ controller and not found one. Well, about a month ago, I saw the ION Discover DJ controller was on sale at Bed, Bath & Beyond for $50. They sold out before I could get one, but Vann's was selling it for $70, so I decided that that was good enough and bought one. I had planned to try to use it with Ms. Pinky since you can hook up MIDI controllers to it. But it turns out that you can hook up MIDI controllers to every control except the turntable, so that was a no go. If I had Max/MSP/Jitter, I could have changed that, but that's also way expensive. So, how should I scratch? My controller came with DJ'ing software and there's also some freeware, like Mixxx, but none of this has video support. So I look around and find Pure Data and GEM.
And I see lots of questions about scratching, how to do it. And there are even some tutorials and small patches out there, but as I look at them, none of them are quite what I'm looking for. The YouTube tutorial is really problematic because it's no good at all for scratching a song. It can create a scratching sound for a small sample, but it's taking the turntable's speed and using that as the position in the sample. If you did that with a longer song, it wouldn't even sound like a scratch. And then there are some which do work right, but none of them keep track of where you are in the playback. So, whenever you start scratching, you're starting from the beginning of the song or the middle.
So, I looked at all this and I said, "Hey, I can do this. I've got my spring break coming up. Looking at how easy PD looks and how much other good (if imperfect) work other people have done, I bet that I could build a good system for audio and video scratching within a week." And, I have.
END OF STORY
So that's what I'm presenting to you, my free audio and video scratching system in Pure Data (Pd-extended, really). I use the name DJ Lease Def, so it's the Lease Def DJ system. It's not quite perfect because it loads its samples into tables using soundfiler which means that it has a huge delay when you load a new file during which the whole thing goes silent. I am unhappy about this, but unsure how to fix it. Otherwise, it's pretty nifty. Anyway, rather than be one big patch, it relies on a system of patches which work with each other. Each of the different parts will come in several versions and you can choose which one you want to use and load up the different parts and they should work together correctly. Right now, for most of the parts there's only one version, but I'll be adding others later.
There's a more detailed instruction manual in the .zip file, but the summary is that you load:
the engine (only one version right now): loads the files, does the actual signal processing and playback
one control patch (three versions to choose from currently, two GUI versions and a MIDI version specific to the Ion Discover DJ): is used to do most of the controlling of the engine other than loading files such as scratching, fading, adjusting volume, etc.
zero or one cueing patch (one version, optional): manages the controls for jumping around to different points in songs
zero or one net patch (one version: video playback): does some sort of add-on. Will probably most commonly be used for video. The net patches have to run in a separate instance of Pd-extended and they listen for signals from the engine via local UDP packets. This is set-up this way because when the audio and video tried to run in the same instance, I would get periodic little pops, clicks, and other unsmoothnesses. The audio part renders 1000 times per second for maximum fidelity, but the video part only renders like 30 or 60 times per second. Pure Data is not quite smooth enough to handle this in a clever real-time multithreading manner to ensure that they both always get their time slices. But you put them in separate processes, it all works fine.
So, anyway, it's real scratching beginning exactly where you were in playing the song and when you stop scratching it picks up just where you left off, you can set and jump to cue points, and it does video which will follow right along with both the scratching and cuing. So I'm pretty proud of it. The downsides are that you have to separate the audio and video files, that the audio has to be uncompressed aiff or wav (and that loading a new file pauses everything for like 10 seconds), that for really smooth video when you're scratching or playing backwards you have to encode it with a codec with no inter-frame encoding such as MJPEG, which results in bigger video files (but the playback scratches perfectly as a result).
So anyway, check it out, let me know what you think. If you have any questions or feedback please share. If anyone wants to build control patches for other MIDI hardware, please do and share them with me. I'd be glad to include them in the download. The different patches communicate using send and receive with a standard set of symbols. I've included documentation about what the expected symbols and values are. Also, if anyone wants me to write patches for some piece of hardware that you have, if you can give me one, I'll be glad to do it.
Keith Irwin (DJ Lease Def)
Make art - call for projects "in-between design" - deadline 31st July
_
_ _ ____ _ _ ||
| | | | ||_ | | || | |
| || | | || | | ||| | |_____
| | || | | | ____ | | | | |
| | | | | | | | | | || | |_
|| || || || || || ||
|| ____ _______ _________
|| || | | | | _
| || | | ||| | | || ||
from | __ | | _ | | |
4 to 7 | | | | | | ||__ ||
NOVEMBER 2010 || || || |_| ||
*CALL FOR PROJECTS*
The sixth edition of make art – in-between design: rediscovering
collaboration in digital art – will take place in Poitiers (FR), from
the 4th to the 7th of November 2010.
make art is an international festival dedicated to the integration
of Free/Libre/Open Source Software (FLOSS) in digital art.
make art offers performances, presentations, workshops and an
exhibition, focusing on the encounter between digital art and free
software.
*in-between design: rediscovering collaboration in digital art*
Today's market production accelerates the spread of non-critical and
standardized aesthetics, by means of locked top-down distribution
mechanisms and a series of tools that enforce it. At the same time
new forms of methodologies inspired or powered by free software,
participatory practices and peer-to-peer networks are fueling many
Internet subcultures. Some of these emerging practices will lead to
competitive social productions, while other will remain as pure
artistic experiments.
By adopting production and distribution methods based on free software
and open standards and by sharing the sources of one's work with
others, the collective knowledge base and aesthetic sensibilities can
freely interact to explore uncharted, hybrid directions which no
longer reflect the supremacy of a single idea.
- Does the sharing of artworks "recipes" and tools help debunk
the myth of the isolated design genius? - By leaving the possibility of ongoing development and refinement,
is it possible to ever produce a "final" design? - Can these methods and technologies inspire new forms of creation or
tools, beyond self-referential productions? - Is it wishful thinking to approach collaborative graphical design
in the same way as an open source software project? - Is Free and Open Source licensing a catalyst for creation or does
it add an extra level of complexity? - Can the limitation of one license trigger new forms of constrained
creativity?
We're currently seeking new, innovative media art and design works and
projects focusing on the above theme and questions:
- graphical artworks and installations
- lectures
- project presentations
- software and hardware demos
We're also seeking audiovisual performances that will take place
during the festival evenings.
The submitted projects must fit this focus and be made in a free/libre
and open source environment, this includes both its optional
dependencies or production tools and the operating system. We are
asking you to publish the sources of your project under a free culture
license of your choice or release it into the public domain.
Projects that do not meet these criteria will not be considered.
*How to apply*
Submission form and a list of additional requirements are available at:
http://makeart.goto10.org/call/
Deadline: *Saturday 31 July 2010*
Incomplete or late applications will not be processed.
*Timeline*
31st of July 2010 – Deadline call for proposals
Beginning of September – Selected projects notifications
4th-7th of November 10 – make art 2010 - Poitiers (FR)
For examples of previous editions, please visit the archives :
http://makeart.goto10.org/
make art is powered by GOTO10