Skip to content

Commit 474a75b

Browse files
Merge pull request #26 from cpp-lln-lab/dev
Merge dev to master for release 0.1.0
2 parents 9a798b0 + 23d6481 commit 474a75b

38 files changed

Lines changed: 1262 additions & 405 deletions

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.wav filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# ignore autosaved file in matlab
2-
*.m~
2+
*.m~
3+
4+
.DS_Store

MOTION.m

Lines changed: 0 additions & 151 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# LePoulpe
2-
In this repo, one can find developing sound bar scripts
2+
3+
This repo contains basic code to generate motion (auditory and visual) with Le Poulpe. It is a rookie release.
4+
5+
In the 'demo' folder there are some examples on how to use the functions inside 'src'.

demo/audioVisualMotion.m

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
% (C) Copyright 2021 CPP LePoulpe developers
2+
3+
% This demo presents auditory or visual motion on LePoulpe.
4+
% It generates sound noises (white, pink, brown noise) in a given length and
5+
% cuts the sound array into chunks to play each chunk in a speaker.
6+
%
7+
% For visual motion it activates LEDs in a given speed, plane (horizontal,
8+
% vertical).
9+
10+
run(fullfile('..', 'initLePoulpe.m'));
11+
12+
pacedByUser = false;
13+
14+
waitForAWhile = 0;
15+
16+
%% set cfg for LEDs
17+
speed = .03;
18+
nbRepetitionLED = 1;
19+
20+
%% set cfg for sounds
21+
fs = 44100;
22+
saveAsWav = 1;
23+
duration = 0.8;
24+
nbRepetitionSound = 2;
25+
waitForSwtich = 1;
26+
27+
% outSound = generateNoise('white', duration, saveAsWav, fs);
28+
outSound = generateNoise('pink', duration, saveAsWav, fs);
29+
30+
nbSpeakers = 31;
31+
32+
% [soundArray] = cutSoundArray(inputSound, inputName, fs, nbSpeakers, saveAsWav);
33+
[soundArray] = cutSoundArray(outSound, 'pinknoise', fs, nbSpeakers, saveAsWav);
34+
35+
36+
% build the speaker arrays for each direction
37+
speakerIdxRightward = generateMotionSpeakerArray('rightward');
38+
39+
speakerIdxLeftward = generateMotionSpeakerArray('leftward');
40+
41+
speakerIdxDownward = generateMotionSpeakerArray('downward');
42+
43+
speakerIdxUpward = generateMotionSpeakerArray('upward');
44+
45+
%% play sounds (auditory motion)
46+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
47+
48+
playMotionSound('horizontal', ...
49+
speakerIdxRightward, ...
50+
soundArray, ...
51+
nbRepetitionSound, ...
52+
waitForSwtich);
53+
54+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
55+
56+
playMotionSound('horizontal', ...
57+
speakerIdxLeftward, ...
58+
soundArray, ...
59+
nbRepetitionSound, ...
60+
waitForSwtich);
61+
62+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
63+
64+
playMotionSound('vertical', ...
65+
speakerIdxDownward, ...
66+
soundArray, ...
67+
nbRepetitionSound, ...
68+
waitForSwtich);
69+
70+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
71+
72+
playMotionSound('vertical', ...
73+
speakerIdxUpward, ...
74+
soundArray, ...
75+
nbRepetitionSound, ...
76+
waitForSwtich);
77+
78+
%% play LEDs (visual motion)
79+
80+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
81+
82+
playVisualMotion('rightward', ...
83+
speed, ...
84+
2, ...
85+
nbRepetitionLED);
86+
87+
88+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
89+
90+
playVisualMotion('leftward', ...
91+
speed, ...
92+
2, ...
93+
nbRepetitionLED)
94+
95+
96+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
97+
98+
playVisualMotion('downward', ...
99+
speed, ...
100+
1, ...
101+
nbRepetitionLED)
102+
103+
104+
pressSpaceForMeOrWait(pacedByUser, waitForAWhile)
105+
106+
playVisualMotion('upward', ...
107+
speed, ...
108+
1, ...
109+
nbRepetitionLED)

0 commit comments

Comments
 (0)