Convert midi files to use with arduino
hey guys!
as the paragliding season is coming i want to build a variometer (flying instrument measuring ascent)
that plays some nice loops instead of annoying beeps. i got an old airpressure sensor out of a broken vario and a arduino. i found a sketch that plays simple melodies. now i need to find some data to feed it with.
arduino needs the following format:
int melody[] = {
NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 8, 8, 4,4,4,4,4 };
i never worked with midi files so i need your help here.
i want to load midi file in pd, and analyse it there, to output a list of NOTES, and one of DURATIONS, to feed the flash memory with kinky gamboy sounds.
any clues for me how to get NOTE + DURATION out of a midi stream?
thx
Sebastian
PD cuts off other sound on the computer
I did.
For command jackd I get this terminal output:
matjaz@matjaz-NV59C:~$ jackd
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
usage: jackdmp [ --no-realtime OR -r ]
[ --realtime OR -R [ --realtime-priority OR -P priority ] ]
(the two previous arguments are mutually exclusive. The default is --realtime)
[ --name OR -n server-name ]
[ --timeout OR -t client-timeout-in-msecs ]
[ --loopback OR -L loopback-port-number ]
[ --port-max OR -p maximum-number-of-ports]
[ --midi OR -X midi-driver ]
[ --verbose OR -v ]
[ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]
[ --replace-registry ]
[ --silent OR -s ]
[ --sync OR -S ]
[ --temporary OR -T ]
[ --version OR -V ]
-d backend [ ... backend args ... ]
Available backends may include: alsa, dummy, freebob, firewire or net
jackdmp -d backend --help
to display options for each backend
and for qjackctl:
The same control GUI opened where I clicked start.
15:38:11.262 Patchbay deactivated.
15:38:11.263 Statistics reset.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:11.286 ALSA connection graph change.
15:38:11.482 ALSA connection change.
15:38:19.241 Startup script...
15:38:19.242 artsshell -q terminate
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
sh: artsshell: not found
15:38:19.646 Startup script terminated with exit status=32512.
15:38:19.646 JACK is starting...
15:38:19.646 /usr/bin/jackd -dalsa -d/dev/dsp -r44100 -p256 -n2 -Xseq
15:38:19.649 JACK was started with PID=2544.
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
Cannot lock down memory area (Cannot allocate memory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
audio_reservation_init
Acquire audio card Audio-1
creating alsa driver ... /dev/dsp|/dev/dsp|256|2|44100|0|0|nomon|swmeter|-|32bit
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
Cannot initialize driver
JackServer::Open() failed with -1
Failed to start server
15:38:19.743 JACK was stopped with exit status=255.
15:38:19.745 Post-shutdown script...
15:38:19.746 killall jackd
jackd: no process found
15:38:20.153 Post-shutdown script terminated with exit status=256.
15:38:21.703 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:31.152 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:42.143 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:39:02.300 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
I'm lost.
PD cuts off other sound on the computer
Hi,
Yes.
I have turned on the computer and freshly started jackd. I start it from qjackcti (http://en.wikipedia.org/wiki/Qjackctl).
Error messages:
1. first window:
Could not connect to JACK server as client.
- Overall operation failed.
- Unable to connect to server.
Please check the messages window for more info.
2. Message window:
13:55:36.236 Patchbay deactivated.
13:55:36.254 Statistics reset.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
13:55:36.336 ALSA connection graph change.
13:55:36.559 ALSA connection change.
13:55:36.560 ALSA connection graph change.
13:55:38.356 Startup script...
13:55:38.357 artsshell -q terminate
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
sh: artsshell: not found
13:55:38.760 Startup script terminated with exit status=32512.
13:55:38.760 JACK is starting...
13:55:38.760 /usr/bin/jackd -dalsa -d/dev/dsp -r44100 -p256 -n2 -Xseq
13:55:38.798 JACK was started with PID=2106.
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
Cannot lock down memory area (Cannot allocate memory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
audio_reservation_init
Acquire audio card Audio-1
creating alsa driver ... /dev/dsp|/dev/dsp|256|2|44100|0|0|nomon|swmeter|-|32bit
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
Cannot initialize driver
JackServer::Open() failed with -1
Failed to start server
13:55:39.278 JACK was stopped with exit status=255.
13:55:39.279 Post-shutdown script...
13:55:39.279 killall jackd
jackd: no process found
13:55:39.700 Post-shutdown script terminated with exit status=256.
13:55:40.822 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
13:55:54.576 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
13:58:38.483 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
13:59:09.197 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
As you can see the last paragraph (...jjack server is not running or cannot be started...) then repeats itself over and over again every 30 seconds.
Seems like Jack isn't working??
Thanks.
Help Building Midi Generative Patches
Hi everyone,
I'm not really a programmer and i need help creating some patches that i can keep and use to generate midi for my compositions. Nothing too complex. I can't afford Max, so will have to be in either PD or Bidule i guess?
Idea 1
I need a patch that generates a metronome rhythm, just a simple note on/note off metronome for one definable note, but with the ability to control the speed of the rhythm, from slow, to really fast, on the fly and with the note length set as a percentage of the interval between notes, again changeable on the fly. This then goes out to my DAW to trigger a sample.
Idea 2
Pretty much the same as Idea 1, but with a definable range of note outputs, so as to trigger different samples within a soft sampler in the DAW, choosing each sample randomly.
Idea 3
Same as Idea 2, but output to go to a synth. So would be cool to be able to output chords and for each note on trigger to also output random triggers for lfo/cut off/other cool parameters etc. too.
Idea 4
I'd also like a simple sequence tool which outputs a short repeating predefined sequence of midi note on and note off to send to the DAW, but where I can control and change the interval/time between each note on trigger on the fly to create varied and interesting patterns and again where the note length is changeable on the fly and set as a percentage of the interval between notes.
I want to record the midi output into a DAW where i can then edit it down into the most interesting bits and build compositions.
None of the ideas need a GUI. I just want these useful tools to keep and produce works with and that I can maybe add to and develop in the future when I've learned how to program!
Any ideas, help building or tips would be really appreciated!
Thanks,
Henry
VisualTracker - request for participants
Here is some more info:
This is development info of VisualTracker for pd (pre alpha 100404)
What is it:
VisualTracker is sample sequencer – it triggers loaded samples in times defined in time line in editor window. Samples can be played in their default speed / length or can be fitted in tempo. In “fit mode” you can define number of bars to fit in and also multiplication of file. All changes have visual interpretation in sample canvases.
VisualTracker for pd (pre alpha 100404) was developed in Pd version 0.41.4-extended, on Windows XP
How to make it work:
- Open VisualTracker_(pre_alpha_100404).pd in pd.
- Editor and Samples window are automatically opened.
- Preset currentstate.vtp is automatically loaded – this preset is saved before closing the patch.
- After first run there are 3 empty sample boxes in samples window and 3 corresponding sample canvases in editor window.
- Load any wav (44100 Hz) by pressing „load“ in selected sample box. No space characters in path or filename are allowed. Loading of these files is aborted and error message appears for several seconds. Name of the successfully loaded sample including full path appears in sample box and also sample canvas in editor window. Size of sample canvas is changed according to the sample length. Try to change global BPM – size of sample canvas is recalculated.
- Check „fit“ to fit sample in current BPM. Set length of sample in bars and multiplication.
- Add another sample by creating object [sample] or just copy existing sample box in samples window.
- Switch to editor window, press CTRL+E to switch to pd edit mode and drag and drop sample canvases to desired position on time line. Sample canvases are automatically snapping to bar columns and rows.
- Switch back to normal mode by CTRL+E
- Press PLAY to replay your sample composition. Samples are played only if corresponding sample canvas is placed in track 1-6. If sample canvas is above the tracks sound is muted.
- Press „save“ in main VisualTracker window to save current preset to a text file. Any name and extension with no spaces is allowed.
- Before closing VisualTracker press „save state & close“. It saves current state to preset named currentstate.vtp and delete all sample boxes from samples window and all sample canvases from editor window. Now you can turn off and eventually save VisualTracker patch. This is important to avoid double appearance of sample canvases because information about samples and composition is stored independently from pd patch and should not be saved inside patch. If there are still some „orphaned“ sample canvases hanging delete them manually.
Components:
- Sample window: place for unlimited amount of [sample] abstractions. Once abstraction is created (by copying or creating the object) corresponding sample canvas is created in editor window. [sample] abstraction is sending data to sample canvas (name, color, size, snapping) and receiving back position. Triggering of sample playback is based on position of sample canvas.
- Editor window: place for sample canvases composition on the top of timeline grid. Sample canvases can be moved by mouse in pd edit mode (CTRL+E). Timeline grid will be extended and improved in next versions.
- Preset save/load: saves and loads presets to/from a text file using [coll] object. Preset contains global values (number of samples in composition, bpm) and local values for each sample box (filename, position, track, multiplication, number of bars, fit switch, color and two unused values).
- Sequencer: located in program subpatch. Very simple - functionality will be extended and improved in next versions
- Other: located in program subpatch. Contains some other patches as colortable, BPM manager, output etc.
Serious problem with poly object!!
I have used the poly object to route the midi notes to voices in order to have polyphony. I am constructing a patch like piano so I use pedals also. I've program the right pedal to cut the velocity 0 message, when it is pressed, in order to have a sustain sound. The problem is that when I repeat a note in the keyboard the route object gives to the same midi note other voice numbers so the same note goes to different voices. I want the same note to remain in the same voice number (note in-note off, or note on-note on without note off). Is there a way for poly object to do such a thing or I have to program every note correspond to a voice sub-patch? Thanx anyone who will help in advance!
Tarmtott - ep by swamps up nostrils
This lil' thing just got released on the great netlabel Control Valve, it is 6 tracks of whacky looping made with PD. Download @:
inforz:
"ctrlvlv#007 IS NOW READY FOR DOWNLOADING!!!!!!!!!!!!!!!!‏ ctrlvlv#007 IS NOW READY FOR DOWNLOADING!!!!!!!!!!!!!!!!‏ ctrlvlv#007 IS NOW READY FOR DOWNLOADING!!!!!!!!!!!!!!!!‏
artist: swamps up nostrils title: tarmtott
artist statement: "Swamps Up Nostrils is a spatiotemporal mishap again and again focusing on both experimental wrongdoings and ancient traditional musical structures like beats and harmonies. What you hear is not what you get but it will however seem pretty close anyway, so why bother? Swirling the eternal wormholes between the familiar and the unknown, we hope to entertain but admit that to most people it must seem like meaningless idiocy, but then again most people seem like meaningless idiots too, including ourselves, so I guess it balances out. Only by admitting to being an idiot yourself will you understand what it means to be one, and understand just how many idiots there are around here. We, the failed abhorritions of monkey-like beings of ancient times, will not let us be controlled by our biological shortcomings, although we admit to them causing us both irritation and confusion. This irritation and confusion is not the source of this music. This music was made by utilizing magick and computers, if you believe in such stuff. If you do not, this music was made by utilizing science and computers, if you believe in such stuff. If you do not, this music was made by utilizing faith and computers, if you believe in such stuff. If you do not, this music was made by utilizing computers and computers, if you believe in such stuff. If you do not, this music was made by utilizing music and music, if you believe in such stuff. If you do not, this mucus was made by utilizing mucus and mucus, if you believe in such stuff. If you do not, this made not was believe and unbelief is by whom was finalized as not more. If you do not, please ignore all above statements as they are irrelevant to the audial experience anyway. There appears not more than what vibrates in your ear, and how your brain interprets that on the basis of your own very personal framework of reference. Anyone telling you otherwise is either trying to highjack your brain or may be lying, or may be convinced of otherwise and acts on a compulsion of good faith, although faith can never exist as something good outside someone's subjective defenition of the matter so the statement is meaningless. Now stop reading this nonsense and listen to the music instead, because, as implied in this body of textual represented idiocies, the point is not to read about this music it is to listen to it. Get it?"
swamps up nostrils is arnfinn killingtveit from trodheim, norway. no one can ever be sure what will come out of the speakers when playing a swamps up nostrils release. the first time i heard one it was some sort of drum and bass mixed with circuit bent electronics, with just a tad of field recordings. you might be getting some sort of techno, drone, noise, minimalism, analog, digital, ect...... whatever it might be, it is always top notch sound work, great composition, and a highly enjoyable listen. killingtveit also runs the superb cd-r label Krakilsk
6 tracks of looping-layered sound composition 320kbps. mp3 cover image"
How do you guys use PD with other audio programs?
didnt know jack also worked for windows xp?
EDIT:just downloaded jack from the website,but i get all kinds of errors when i try to unzip?
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open Versions\Current\Headers (jack-1.9.2\bin\osx_32bits\Jackmp.framework\Headers --> Versions\Current\Headers)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open Versions\Current\Jackmp (jack-1.9.2\bin\osx_32bits\Jackmp.framework\Jackmp --> Versions\Current\Jackmp)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open Versions\Current\Resources (jack-1.9.2\bin\osx_32bits\Jackmp.framework\Resources --> Versions\Current\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create ersions\Current\Headers
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Jackservermp
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Resources
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open jack-1.9.2\bin\osx_32bits\Jackservermp.framework\Resources (A --> jack-1.9.2\bin\osx_32bits\Jackservermp.framework\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Panda
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Resources
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open jack-1.9.2\bin\osx_32bits\Panda.framework\Resources (A --> jack-1.9.2\bin\osx_32bits\Panda.framework\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Headers
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Jackmp
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Resources
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open jack-1.9.2\bin\osx_64bits\Jackmp.framework\Resources (A --> jack-1.9.2\bin\osx_64bits\Jackmp.framework\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Headers
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Jackservermp
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Resources
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open jack-1.9.2\bin\osx_64bits\Jackservermp.framework\Resources (A --> jack-1.9.2\bin\osx_64bits\Jackservermp.framework\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Panda
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create Versions\Current\Resources
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot open jack-1.9.2\bin\osx_64bits\Panda.framework\Resources (A --> jack-1.9.2\bin\osx_64bits\Panda.framework\Resources)
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Symbolic link points to missing file
! C:\Documents and Settings\administartor\Desktop\jack audio\jack-1.9.2.tgz: Cannot create
Changing length of beats/steps/something......?
Sorry, I didn't know exactly how to word this in the subject.... but here goes:
I have a 64 step sequencer with 6 different "tracks" all running off the same metro. (when I say track, I'm referring to the 64 steps for one particular sample) I can change the number of steps for each track, so let's say I can have the track with the bass drum count up to 16 before looping, have the snare track count up to 20 before looping, have the hi-hat track count up to 9 before looping, and so on. They can all be set to the same number of steps or however you want, but they still all follow the same metro bangs. In other words, even if you set them to different odd lengths, they stay sounding in time with each other.
So my question is, can I make it so the overall length of time for each track stay the same and have them count through different amounts of steps? Like I could have the bass drum do a straight 8 count, and have the snare do a 13 count, but have them both begin and end at the same time. Like squeeze (or stretch) one or the other so that you would be offsetting them rhythmically, but the time it takes to count to 8 and the time it takes the other to count to 13 be the same length of time.... just a different number of steps.
Does that make any sense? Maybe not in a musical sense, but in a mathematical sense? I know it's not hard to create chaotic patterns with Pd (which I know would probably be the result of what I'm talking about) but I still want to try it.
Random numbers, timers, projections
Hey everyone.
You'll have to excuse me 'cause I don't have a clue about PD, but need to use it for one of my current projects.
Basically, I want to project some text from my computer onto a blank canvas. I want to use a pressure sensor to detect when a user is sitting down. Once it knows someone is sitting down, I want the text to change.
From here on, I want the text to change after a given amount of time... say... 30 seconds for now?
When it gets to the last slide of text, I want it to do nothing other than display this line of text, until the user places their hand over an LDR. When the user's hand is placed over the LDR, the light will be reduced to a certain level. Once this level is reached, I want PD to time for 15 seconds, and at the end of the 15 seconds, illuminate any random combination of light bulbs and set off a rumble pack beneath where they have put their hand. If the user removes their hand before the 15 seconds is up, I do not want any of the light bulbs to illuminate, and I do not want the rumble pack to go off.
[When certain bulbs are illuminated, I want certain lines of text to be projected.
Say bulbs 1 and 2 are illuminated, but 3, 4 and 5 are not. I would like text to be projected that says "Bulbs 1 and 2 are illuminated. Bulbs 3, 4 and 5 are not". Or say Bulbs 1, 3 and 5 are illuminated, I want text to be projected that says "Bulbs 1, 3 and 5 are illuminated. Bulbs 2 and 4 are not."]
If the user stands up at any point in time, removing pressure from the pressure sensor, I want the initial line of text to be displayed on screen again, and everything to start over.
Sorry if this sounds very complex, please let me know if you can help out at all.
Edit ::
If it makes it any easier, you could ignore the bit that I've put in the square brackets. Instead of this, I would just like one more screen of text to be projected when any combination of the bulbs are illuminated.