Wishlist - Homemade MIDI turntable for PD
> What protocol should be used to communicate with PC??
> MIDI isn't slow?
MIDI is not just a protocol, it is an entire communication system from the physical layer right up to the data layer including baud rate and connector specs. MIDI as a protocol could be run much faster over USB2 or ethernet, but a sensible modern extension to MIDI would encapsulate it inside OSC or something like that and send it over a session aware layer. MIDI has had 20 years and now it's probably best to just bypass it and go straight for OSC over ethernet. That would also bypass all those "driver" issues for Windows users too.
> I plain to use Linux!!
An excellent choice if I may say so sir! Perhaps it's time to look at Linux SBCs with built in network and USB. You can get tiny ones that are no bigger than a matchbox and single chip FPGAs that you can write your software into. Check out http://linuxdevices.com/
> I am having problems in getting an turntable to electrify with this
> electronics hardware
You will not drive a turntable motor from USB. The current demands will kill the source. You need an external PSU. 12v at about 1 amp is probably plenty.
> Should this project be commercial?? I would pay to someone that made for myself
> the turntable in wood, plastic or metal. Where can I find such shop?
In your garage. There's no reason not to start a small commercial enterprise making these things but you need to do a bit of defining exactly what the function is, who will buy it and in what parts of the world. My honest advice at this stage is that you don't yet have a saleable product. Needs more development. It's a great project and demonstrates ingenuity in using the optical sensor, but you need to very clearly define the exact function and software it is designed to work with and why. In a funny way you have to think in reverse. Start with the constraints. The target customer is the overall most important consideration. Choose the biggest group like Reaktor users and build it for them. The housing is probably the single most important design factor. Guess how many units you might sell and design around that. A thousand is a reasonable prospect from a website shop, over a year or two. You need to work out the labor costs for manufacture, how long will it take you to build each one? Maybe you can do a deal with a manufacturer to buy and retrofit existing turntables for a first low volume project. Or change the design to be a turntable accessory because many people already have an old turntable in their junk room.
Before getting anything manufactured you need a serious prototype, something you can show to an engineer who can give advice on large scale production. Product design is a lot of odd things you never thought of before, but many are common sense. Heat dissipation, EMI shielding, where to locate certain components for accessibility, physical strength, vibration. If you want to sell a product in most countries it needs to pass some basic safety requirements. Having external power supplies will solve 90% of these in one go. The most expensive ways are injection molded plastic. The best ways in the modern culture are good old fashioned wood and metal, renewable and recycleable materials. Do some cost calculations for folded steel box sections, extruded aluminium and plastic housings. Think about assembly all the time. Contact local engineering companies and get quotes, they are always happy to send single samples for free if you are serious. Use standard components wherever possible. Be creative in reusing things that are already mass produced and adapt them to the design. Think about weight because of shipping costs. Look at your competition all the time too. Think about why people would buy your turntable in preference to one of those DJCD boxes. How will you market it, what are the key features? The good news is that because of the economy in the US there will be a renaissance in small manufacture over the next decade. People have got used to the idea that we just design stuff in the West and let the Indians or Chinese build things. That economic pendulum will swing back and we find there's a shortage of skills in manufacturing. Getting a good base in product design now could pay rewards further down the road. Most first business projects are unsuccessful, don't let it knock you back. The second or third project is the one that pays.
Problem compiling external on Windows
Hey,
thanks to everyone who responded to my posts both here and in the mailing list. Since then, I've figured out how to compile externals written in C using Microsoft Visual C++ 2005. There's more to document, however, such as how to compile externals using some of the other Windows compilers (Borland, djgpp, etc.), and also how to compile externals written in C++ in Windows. But one thing at a time.
one little thing to note... steps 4 and 7 may seem a little roundabout, but they account for the fact that MSVC sometimes has trouble with spaces in directory names (eg. C://Program Files/). If anyone knows how to override this behavior, post a reply, and I'll try to simplify the steps accordingly.
Updated June 29, 2007:
use [b]C://Progra~1/[/b] instead of [b]C://Program Files/[/b],
use [b]C://Docume~1/[/b] instead of [b]C://Documents and Settings/[/b], etc.
So, without further ado...
How to compile a pd external written in C using Microsoft Visual C++ 2005:
Compared to Windows, linux offers a much more user-friendly environment for compiling pd externals. However, with a little patience, a usable environment can be set up in Windows, and the good news is that everything you need is available for free. There are several reputable Windows-compatible C/C++ compilers out there, but here I'll discuss compiling externals with Microsoft Visual C++ 2005 (MSVC for short).
1. Download and Install Microsoft Visual C++ 2005 Express Edition.
a. Click the link above, then click Go! in the Visual C++ box.
b. Run vcsetup.exe to install the program
(the setup wizard should guide you through the process).
2. Download [url=http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/VS80sp1-KB9267
]Visual C++ 2005 Express Service Pack 1.
a. Click the link above to download the Service Pack.
b. Run VS80sp1-KB926748-X86-INTL.exe to install the program.
3. Create a new project:
a. Open Visual C++.
b. Open the New Project window (Ctrl+Shift+N).
c. In the Project Types pane, select Visual C++.
d. In the Templates pane, select emptyproj.
e. Enter object name (helloworld).
f. Leave Create directory for solution unchecked, and click OK.
4. Import the pd header file:
a. Get m_pd.h here, or, using pd-vanilla (not pd-extended):
1. Open Windows Explorer or My Computer.
2. Navigate to the pd/src/ directory on your system.
3. Open m_pd.h in a text editor (file type is: C/C++ header).
b. Select all (Ctrl+A).
c. Copy selection to the clipboard (Ctrl+C).
d. Back in Visual C++, open the New File window (Ctrl+N).
e. In the Categories pane, select General.
f. In the Templates pane, select Text File, and click Open.
g. Copy the contents of m_pd.h into the editor window (Ctrl+V).
h. Open the Save File As Window (Ctrl+S).
i. Save as m_pd.h.
j. From the File Menu, select Move m_pd.h into; select helloworld.
5. Write the source code for the external in C.
a. Open the New File window (Ctrl+N).
b. In the Categories pane, select General.
c. In the Templates pane, select Text File, and click Open.
d. Write your source code in the editor window.
The following example is taken from the tutorial by Johannes M. Zmoelnig.
#include "m_pd.h"
static t_class *helloworld_class;
typedef struct _helloworld {
t_object x_obj;
} t_helloworld;
void helloworld_bang(t_helloworld *x)
{
post("Hello world !!");
}
void *helloworld_new(void)
{
t_helloworld *x = (t_helloworld *)pd_new(helloworld_class);
return (void *)x;
}
void helloworld_setup(void) {
helloworld_class = class_new(gensym("helloworld"),
(t_newmethod)helloworld_new,
0, sizeof(t_helloworld),
CLASS_DEFAULT, 0);
class_addbang(helloworld_class, helloworld_bang);
}
6. Save and import the source code into the project:
a. Open the Save File As Window (Ctrl+S).
b. Save as helloworld.c.
c. From the File Menu, select Move helloworld.c into; select helloworld.
7. Access the pd library file:
a. Open Windows Explorer or My Computer.
b. Navigate to the pd/bin/ directory on your system.
c. Right-click on pd.lib (file type is: Object File Library) and select Copy.
d. Navigate to the C://TEMP/ directory on your system.
e. Paste the copy of pd.lib in the C://TEMP/ directory (right-click or Ctrl-V).
8. Set configuration properties:
a. Set configuration type to .dll:
1. Back in Visual C++, open the helloworld Property Pages window (Alt+F7).
2. In the left pane, select Configuration Properties >> General.
3. In the right pane, under Project Defaults, click on
Configuration Type, and select Dynamic Library (.dll)
(using the arrow on the right).
b. Add MSW to preprocessor definitions:
1. In the left pane, select
Configuration Properties >> C/C++ >> Preprocessor.
2. In the right pane, type MSW in the Preprocessor Definitions field.
c. Tell compiler which language to use:
1. In the left pane, select
Configuration Properties >> C/C++ >> Advanced.
2. In the right pane, select Compile As.
3. Select Compile as C Code (/TC) by clicking the arrow on the right.
d. Tell linker where to find pd.lib:
1. In the left pane, select Configuration Properties >> Linker >> Input.
2. In the right pane, select Additional Dependencies and enter
C://TEMP/pd.lib.
e. Tell linker to export the setup function:
1. In the left pane, select
Configuration Properties >> Linker >> Command Line.
2. In the right pane, type
/export:helloworld_setup in the Additional options field.
3. Click OK.
9. Compile and link:
a. Use the Build Solution command (F7).
10. Copy the new helloworld.dll file into pd.
a. Open Windows Explorer or My Computer.
b. Navigate to the
My Documents/Visual Studio 2005/Projects/helloworld/Debug/
directory on your system.
c. Right-click on helloworld.dll (file type is: Application Extension)
and select Copy.
d. Navigate to the pd/extra directory on your system.
e. Paste the copy of helloworld.dll in the pd/extra directory
(right-click or Ctrl-V).
11. Test the external in pd.
a. the external should now be a useable object in pd.
b. open a new pd patch and try to create a helloworld object.
c. add a bang to the left inlet and test it out.
d. if the main pd console window displays "Hello world !!",
the external has succeeded.
Hope this helps!
-- middlepedal
Problem compiling external on Windows
This has been answered on pd-list today
Hopefully this is helpful to others. I never go near Windows myself,
but anyway, post copied verbatim for the benefit of all...
> Iohannes Zmoelnig wrote:
> have you tried any online resources: e.g.
> http://puredata.info/docs/developer lists at least 2 pages that only
> deal with compiling on windows
> (http://puredata.info/docs/developer/mingw which basically deals with
> compiling pd itself on windows; but once you are there, it is simple;
> http://nul.jp/2002/pd_bc deals with compiling externals with the
> borland-compiler).
> i can give you a step-by-step guide for compiling zexy though (but mind
> that this is how i _remember_ it; i will not go and search for a windows
> machine with VC installed just to verify each step).
> - purchase M$ VC6 (elitarism on my side...:-)) and install it
> - get pd
> - download zexy (sources!) for free (e.g.
> ftp://ftp.iem.at/pub/pd/Externals/ZEXY/)
> - extract zexy to you favourite folder
> - double-click on the zexy.dsp (or was it zexy.dsw??) in the zexy/src/
> folder; this should open VC
> - to to the Project->Properties (or however this is called in your
> locale) and change the settings to match your setup (mainly these are
> the paths to find pd's headers and libraries; you should basically go
> through every item in the settings for the "release" and/or "debug"
> builds; the most important stuff is in "compiler->preprocessor",
> "compiler->path" and "linker->path"
> - when you are finished, return to the main project window
> - hit "F7" to start the build.
> - if you encounter any errors, either the settings are not yet correct
> (return to item-6) or the project is a bit out-of-date; the latter
> basically means, that the c-files to be included have not been updated;
> to fix this, just delete all the c-files from the project file browser
> (here this used to be un the left-side of the project-window), then
> right click on the folder in the project file browser that used to
> contain these files and select "add"; in the openpanel choose all
> c-files in zexy/src and hit "OK"
> - return to item-8 until you stop getting errors
> mind, that you must not use the dll while it is created (best close pd)
> if you want step-by-step instructions for vc7, vc2000, vc2006 and
> vc3000, please send them to me and i'll give it a go (dev-elitarism
> again)
> pd comes with some externals (e.g. the foo-stuff, or [fiddle~]) and uses
> makefiles to build these.
> for this to work, you have to setup your environment correctly:
-> first open the makefile (e.g. pd/doc/6.externs/makefile) with your
> favourite text-editor and correct all the paths that are wrong
> - VC6 came with a vc6vars.bat (ok the name is wrong but something along
> these lines; it was a .bat-file which would set your envirnment
> variables when run; more modern incarnations might do without the .bat
> - open the dosbox (the rest will happen within the dosbox)
> - run the vc6vars.bat (or however it is called) if this is needed for
> your compiler-incarnation
> - cd to your path (e.g. pd/doc/6.externs/)
> - run "nmake pd_nt"
> if nmake, cl, link cannot be found, you might want to add the paths to
> them to your PATH variable.
Martin Peach wrote:
> If you're on some kind of MSVC, you set up a project to build a dll, in
> "preprocessor defines" define MSW, in "additional include paths" include
> the path to pd/src/m_pd.h, link with pd.lib from pd/bin, and in the
> linker command line add "/export:yourexternal_setup" to export the setup
> function. All the other functions in your code can be static and don't
> need to be exported. After it builds you take the dll from the release
> folder and put it in your pd/extra folder.
> That should be everything you need, but if it's too cryptic I can go
> into more detail...
> Martin
OPEN technologies workshop, Zaragoza, Spain, June 26th - July 1st
OPEN technologies workshop, Zaragoza, Spain, June 26th - July 1st
http://www.0j0.org/pmwiki/index.php/Events/GohanDevelopmentJun07
******* FREE WORKSHOP ANNOUNCEMENT *******
Arduino, Pd, and Processing are becoming more and more intertwined. Sensors controlling software synthesis, robots controlled by video tracking, custom musical instruments, and more. We are a collection of developers working with these free software tools. Join us to work on projects of these combinations, or help us create new possibilities by bringing these tools ever more intertwined.
This event is a combination of a hacklab and a barcamp. We are following the ad hoc, participant-driven nature of the barcamp in combination with the collaborative work studio environment of a hacklab. If you have not been to a hacklab, barcamp, and/or unconference before, here are a couple of good references to get an idea of the way it is done:
BarCamp on wikipedia: http://en.wikipedia.org/wiki/BarCamp
There will be workshops and talks, and plenty of time to work together. We will all be working together to create projects which will then be exhibited in Zaragoza. Bring one or more of the following: ideas, projects, a desire to learn, a desire to teach. Come everyday to pick up skills and finish your project. Come whenever you can to learn new bits and pieces, and help build compelling things to exhibit!
Dates & Location:
June 26th (Tuesday) - July 1st (Sunday)
Centro de Historia
Pl. San Agustín 2
50002 Zaragoza - Spain
http://www.zaragoza.es/centrodehistoria/
Team - Guest developers:
* Hans-Christoph Steiner, Pd, Polytechnic University, community management
* Emanuele Roman, Processing, visual representation[visio imaginorum sonus est]
* XÄ, Pd, electronic music
Team - Resident developers:
* David Cuartielles from Arduino
* Marcos Yarza from Libelium, physical interfaces
Join us! Just sign up on the register page!
http://www.0j0.org/pmwiki/index.php/Jun07/Register
If you live near Zaragoza and are willing to host people, please mark that on the registration page. If you want to come and need a place to stay, contact people on the registration page who marked themselves as hosts.
.hc
4-Point Polynomial Interpolation.. care to explain?
This looks like the relevant code,
for (i = 0; i < n; i++)
{
float findex = *in++;
int index = findex;
float frac, a, b, c, d, cminusb;
static int count;
if (index < 1)
index = 1, frac = 0;
else if (index > maxindex)
index = maxindex, frac = 1;
else frac = findex - index;
fp = buf + index;
a = fp[-1];
b = fp[0];
c = fp[1];
d = fp[2];
/* if (!i && !(count++ & 1023))
post("fp = %lx, shit = %lx, b = %f", fp, buf->b_shit, ; */
cminusb = c-b;
*out++ = b + frac * (
cminusb - 0.1666667f * (1.-frac) * (
(d - a - 3.0f * cminusb) * frac + (d + 2.0f*a - 3.0f*b)
)
);
}
that last line is the one, and it's using the previous, current and next two points as a, b, c d. Is that right? Claude?
Audio port control and tempo recognition
Thats for that hardoff. I managed to get a test patch up and working. As I said, I am not normally on forums so I don't know what is acceptable or not but I am doing half my final year project in pd so I thought I could post the url of a webpage detailing the project and if anyone is interested they might want to have a look and perhaps send on some suggestions.
http://193.1.99.6/%7Ekeogana/forum.htm
Thanks lads,
Ailbhe
PD to control MIDI applications?
If you are running windows I recomend midiYoke.
http://www.midiox.com/index.htm?http://www.midiox.com/myoke.htm
Nu B ?s -Prefs in os x, presets
. for the startup, the preferences is called "flags", you can specify audioi, midi, font , path for your abstractions etc ....
In OsX, I don't know where is the startup files. I remember edit a file pd.command somehwere
for an help with flags see: [url=http://crca.ucsd.edu/~msp/Pd_documentation/x3.htm#s4
]http://crca.ucsd.edu/~msp/Pd_documentation/x3.htm#s4
. for preset , it's a real question. the object qlist, textfile would interest you. You can also use just array to store values. save it and open it like this :
[url=http://giair.music.free.fr/patchs/partage/array/enregistrer_array.gif
]http://giair.music.free.fr/patchs/partage/array/enregistrer_array.gif
there is another object in other libraries : pbank from pdjimmies, xeq from ?, and matrix.
Another way is built with the Rradical solution : [url=http://puredata.info/community/projects/convention04/lectures/tk-barknecht/
]http://puredata.info/community/projects/convention04/lectures/tk-barkn echt/
It seems to be powerful.
. hide cables is impossible but a right click on a subpatch and select graph on parent works well. or use canvas.
. the best way to talk is here in anglish or in idecibel.com in french. the mailing list is very a specialist discussion, not focus on newbie.
. inlets and outlets of an object is showed with a right click on the object and selecting help. for better comprehension you can add a comments near your inlets or outlets to be more clear.